From 43053000b248bb5225c05301a686d1307afa3a94 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 20 Aug 2026 19:17:26 +0000 Subject: [PATCH] Configurations: 'specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/tspconfig.yaml', API Version: 2026-04-01-preview, SDK Release Type: beta, and CommitSHA: '9f5271b1ab4f354780443f12755bd097f148f9bc' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6726935 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../azure-resourcemanager-cosmos/CHANGELOG.md | 272 +- .../azure-resourcemanager-cosmos/README.md | 2 +- .../azure-resourcemanager-cosmos/pom.xml | 1 + .../fluent/CassandraClustersClient.java | 314 ++ .../fluent/CassandraResourcesClient.java | 792 +++++ .../cosmos/fluent/ChaosFaultsClient.java | 240 ++ .../cosmos/fluent/CopyJobsClient.java | 420 +++ .../fluent/CosmosDBManagementClient.java | 98 + .../cosmos/fluent/DataTransferJobsClient.java | 421 +++ .../cosmos/fluent/FleetAnalyticsClient.java | 290 ++ .../cosmos/fluent/GarnetClustersClient.java | 460 +++ .../cosmos/fluent/GraphResourcesClient.java | 350 ++ .../cosmos/fluent/MongoDBResourcesClient.java | 786 +++++ ...SecurityPerimeterConfigurationsClient.java | 236 ++ .../SoftDeletedDatabaseAccountsClient.java | 481 +++ .../SoftDeletedSqlContainersClient.java | 494 +++ .../fluent/SoftDeletedSqlDatabasesClient.java | 455 +++ .../cosmos/fluent/SqlResourcesClient.java | 1014 +++++- .../fluent/ThroughputPoolAccountsClient.java | 311 ++ ...hroughputPoolAccountsOperationsClient.java | 61 + .../cosmos/fluent/ThroughputPoolsClient.java | 418 +++ .../ThroughputPoolsOperationsClient.java | 87 + .../fluent/models/BackupResourceInner.java | 166 + .../CassandraViewCreateUpdateProperties.java | 141 + .../models/CassandraViewGetProperties.java | 108 + .../models/CassandraViewGetResultsInner.java | 241 ++ .../fluent/models/ChaosFaultProperties.java | 194 ++ .../models/ChaosFaultResourceInner.java | 256 ++ .../models/CommandPublicResourceInner.java | 241 ++ .../fluent/models/CopyJobGetResultsInner.java | 173 + .../DataTransferJobGetResultsInner.java | 259 ++ .../models/DataTransferJobProperties.java | 313 ++ ...DatabaseAccountCreateUpdateProperties.java | 164 + .../models/DatabaseAccountGetProperties.java | 269 ++ .../DatabaseAccountGetResultsInner.java | 208 ++ .../DatabaseAccountUpdateProperties.java | 163 + .../models/FleetAnalyticsProperties.java | 142 + .../models/FleetAnalyticsResourceInner.java | 212 ++ .../models/GarnetClusterResourceInner.java | 226 ++ .../GraphResourceCreateUpdateProperties.java | 141 + .../models/GraphResourceGetProperties.java | 108 + .../models/GraphResourceGetResultsInner.java | 241 ++ ...rkSecurityPerimeterConfigurationInner.java | 157 + ...alPartitionStorageInfoCollectionInner.java | 91 + ...calPartitionThroughputInfoResultInner.java | 166 + ...rtitionThroughputInfoResultProperties.java | 89 + .../RedistributeThroughputProperties.java | 107 + .../models/RetrieveThroughputProperties.java | 106 + ...tDeletedDatabaseAccountGetResultInner.java | 157 + ...eletedDatabaseAccountsListResultInner.java | 115 + ...SoftDeletedSqlContainerGetResultInner.java | 157 + ...ftDeletedSqlContainersListResultInner.java | 115 + .../SoftDeletedSqlDatabaseGetResultInner.java | 157 + ...oftDeletedSqlDatabasesListResultInner.java | 115 + .../ThroughputPoolAccountProperties.java | 158 + .../ThroughputPoolAccountResourceInner.java | 223 ++ .../models/ThroughputPoolProperties.java | 123 + .../models/ThroughputPoolResourceInner.java | 227 ++ .../CassandraClustersClientImpl.java | 1311 +++++++- .../CassandraResourcesClientImpl.java | 2820 ++++++++++++++--- .../implementation/ChaosFaultsClientImpl.java | 689 ++++ .../implementation/CopyJobsClientImpl.java | 1132 +++++++ .../CosmosDBManagementClientImpl.java | 226 +- .../DataTransferJobsClientImpl.java | 1141 +++++++ .../FleetAnalyticsClientImpl.java | 820 +++++ .../GarnetClustersClientImpl.java | 1277 ++++++++ .../GraphResourcesClientImpl.java | 942 ++++++ .../MongoDBResourcesClientImpl.java | 2246 +++++++++++-- ...rityPerimeterConfigurationsClientImpl.java | 685 ++++ ...SoftDeletedDatabaseAccountsClientImpl.java | 1036 ++++++ .../SoftDeletedSqlContainersClientImpl.java | 1073 +++++++ .../SoftDeletedSqlDatabasesClientImpl.java | 984 ++++++ .../SqlResourcesClientImpl.java | 2365 ++++++++++++-- .../ThroughputPoolAccountsClientImpl.java | 740 +++++ ...ghputPoolAccountsOperationsClientImpl.java | 287 ++ .../ThroughputPoolsClientImpl.java | 948 ++++++ .../ThroughputPoolsOperationsClientImpl.java | 447 +++ .../models/CassandraViewListResult.java | 105 + .../models/ChaosFaultListResponse.java | 113 + .../models/CopyJobFeedResults.java | 113 + .../models/DataTransferJobFeedResults.java | 114 + .../models/FleetAnalyticsListResult.java | 113 + .../models/GraphResourcesListResult.java | 105 + .../implementation/models/ListBackups.java | 105 + .../implementation/models/ListCommands.java | 105 + .../models/ListGarnetClusters.java | 106 + ...urityPerimeterConfigurationListResult.java | 116 + .../ThroughputPoolAccountsListResult.java | 115 + .../models/ThroughputPoolsListResult.java | 114 + .../cosmos/models/AccessRule.java | 102 + .../cosmos/models/AccessRuleDirection.java | 51 + .../cosmos/models/AccessRuleProperties.java | 203 ++ .../AccessRulePropertiesSubscription.java | 85 + .../cosmos/models/AccountKeyMetadata.java | 22 + .../cosmos/models/AllocationState.java | 51 + .../cosmos/models/AzureBlobContainer.java | 102 + .../AzureBlobDataTransferDataSourceSink.java | 150 + .../models/AzureBlobSourceSinkDetails.java | 102 + .../cosmos/models/BackupState.java | 61 + .../cosmos/models/BaseCopyJobProperties.java | 117 + .../cosmos/models/BaseCopyJobTask.java | 119 + .../BaseCosmosDataTransferDataSourceSink.java | 142 + .../BlobToCassandraRUCopyJobProperties.java | 194 ++ .../models/BlobToCassandraRUCopyJobTask.java | 173 + .../cosmos/models/CapacityMode.java | 56 + .../CapacityModeChangeTransitionState.java | 214 ++ .../models/CapacityModeTransitionStatus.java | 66 + .../CassandraRUToBlobCopyJobProperties.java | 194 ++ .../models/CassandraRUToBlobCopyJobTask.java | 173 + ...andraRUToCassandraRUCopyJobProperties.java | 192 ++ .../CassandraRUToCassandraRUCopyJobTask.java | 177 ++ .../CassandraViewCreateUpdateParameters.java | 237 ++ .../CassandraViewGetPropertiesOptions.java | 108 + .../CassandraViewGetPropertiesResource.java | 135 + .../cosmos/models/CassandraViewResource.java | 134 + .../models/ClusterResourceProperties.java | 30 + .../cosmos/models/ClusterType.java | 51 + .../cosmos/models/CommandAsyncPostBody.java | 223 ++ .../cosmos/models/CommandStatus.java | 71 + .../cosmos/models/ContinuousTier.java | 5 + .../cosmos/models/CopyJobMode.java | 51 + .../cosmos/models/CopyJobProperties.java | 260 ++ .../cosmos/models/CopyJobStatus.java | 76 + .../cosmos/models/CopyJobType.java | 71 + ...osCassandraDataTransferDataSourceSink.java | 167 + .../cosmos/models/CosmosDBCassandraTable.java | 135 + .../models/CosmosDBMongoCollection.java | 135 + .../models/CosmosDBMongoVCoreCollection.java | 135 + .../cosmos/models/CosmosDBNoSqlContainer.java | 135 + .../models/CosmosDBSourceSinkDetails.java | 93 + ...CosmosMongoDataTransferDataSourceSink.java | 167 + ...sMongoVCoreDataTransferDataSourceSink.java | 213 ++ .../CosmosSqlDataTransferDataSourceSink.java | 167 + .../cosmos/models/CreateJobRequest.java | 155 + .../cosmos/models/DataMaskingPolicy.java | 160 + .../DataMaskingPolicyExcludedPathsItem.java | 103 + .../DataMaskingPolicyIncludedPathsItem.java | 188 ++ .../cosmos/models/DataTransferComponent.java | 72 + .../models/DataTransferDataSourceSink.java | 118 + .../cosmos/models/DataTransferJobMode.java | 51 + ...DatabaseAccountCreateUpdateParameters.java | 124 + ...atabaseAccountRegenerateKeyParameters.java | 32 + .../DatabaseAccountUpdateParameters.java | 123 + .../cosmos/models/DiagnosticLogSettings.java | 95 + .../cosmos/models/EnableFullTextQuery.java | 61 + ...nalyticsPropertiesStorageLocationType.java | 52 + .../models/GarnetAuthenticationType.java | 46 + .../models/GarnetCacheProvisioningState.java | 71 + .../models/GarnetClusterResourcePatch.java | 97 + .../GarnetClusterResourcePatchProperties.java | 188 ++ .../GarnetClusterResourceProperties.java | 442 +++ ...lusterResourcePropertiesEndPointsItem.java | 102 + .../cosmos/models/GraphResource.java | 101 + .../GraphResourceCreateUpdateParameters.java | 237 ++ .../GraphResourceGetPropertiesOptions.java | 108 + .../GraphResourceGetPropertiesResource.java | 78 + .../cosmos/models/IssueType.java | 64 + .../models/MaterializedViewDefinition.java | 188 ++ .../models/MaterializedViewDetails.java | 121 + .../models/MaterializedViewsProperties.java | 96 + .../cosmos/models/MergeParameters.java | 93 + .../MongoRUToMongoRUCopyJobProperties.java | 190 ++ .../models/MongoRUToMongoRUCopyJobTask.java | 173 + .../MongoRUToMongoVCoreCopyJobProperties.java | 195 ++ .../MongoRUToMongoVCoreCopyJobTask.java | 175 + .../models/MongoVCoreSourceSinkDetails.java | 121 + .../models/NetworkSecurityPerimeter.java | 116 + ...urityPerimeterConfigurationProperties.java | 169 + ...rimeterConfigurationProvisioningState.java | 77 + .../cosmos/models/NetworkSecurityProfile.java | 158 + .../NoSqlRUToNoSqlRUCopyJobProperties.java | 190 ++ .../models/NoSqlRUToNoSqlRUCopyJobTask.java | 173 + .../cosmos/models/PhysicalPartitionId.java | 101 + .../models/PhysicalPartitionStorageInfo.java | 97 + ...icalPartitionThroughputInfoProperties.java | 104 + ...ysicalPartitionThroughputInfoResource.java | 162 + ...hroughputInfoResultPropertiesResource.java | 94 + .../cosmos/models/ProvisioningIssue.java | 100 + .../models/ProvisioningIssueProperties.java | 156 + .../RedistributeThroughputParameters.java | 211 ++ ...istributeThroughputPropertiesResource.java | 187 ++ .../cosmos/models/ResourceAssociation.java | 100 + .../models/ResourceAssociationAccessMode.java | 56 + ...lContainerPropertiesResourceContainer.java | 31 + .../models/RetrieveThroughputParameters.java | 210 ++ .../RetrieveThroughputPropertiesResource.java | 111 + .../cosmos/models/Severity.java | 51 + .../cosmos/models/SoftDeleteActionKind.java | 51 + .../models/SoftDeleteConfiguration.java | 156 + .../SoftDeletedDatabaseAccountProperties.java | 147 + .../SoftDeletedDatabaseAccountResource.java | 131 + .../SoftDeletedSqlContainerProperties.java | 108 + .../SoftDeletedSqlContainerResource.java | 146 + .../SoftDeletedSqlDatabaseProperties.java | 108 + .../SoftDeletedSqlDatabaseResource.java | 108 + .../cosmos/models/SoftDeletionMetadata.java | 120 + .../SqlContainerGetPropertiesResource.java | 30 + .../cosmos/models/SqlContainerResource.java | 133 + .../cosmos/models/SupportedActions.java | 56 + .../models/ThroughputBucketResource.java | 152 + .../cosmos/models/ThroughputPolicyType.java | 56 + .../cosmos/models/ThroughputPoolUpdate.java | 132 + ...roughputSettingsGetPropertiesResource.java | 10 + .../models/ThroughputSettingsResource.java | 35 + ...azure-resourcemanager-cosmos_metadata.json | 2 +- .../proxy-config.json | 2 +- .../CassandraClustersCreateUpdateSamples.java | 2 +- .../CassandraClustersDeallocateSamples.java | 2 +- .../CassandraClustersDeleteSamples.java | 2 +- .../CassandraClustersGetBackupSamples.java | 25 + ...ndraClustersGetByResourceGroupSamples.java | 2 +- ...lustersGetCommandAsyncResourceSamples.java | 25 + ...tersInvokeCommandAsyncResourceSamples.java | 35 + ...CassandraClustersInvokeCommandSamples.java | 18 +- .../CassandraClustersListBackupsSamples.java | 24 + ...draClustersListByResourceGroupSamples.java | 2 +- .../CassandraClustersListCommandSamples.java | 24 + .../CassandraClustersListSamples.java | 2 +- .../CassandraClustersStartSamples.java | 2 +- .../CassandraClustersStatusSamples.java | 2 +- .../CassandraClustersUpdateSamples.java | 2 +- ...ssandraDataCentersCreateUpdateSamples.java | 2 +- .../CassandraDataCentersDeleteSamples.java | 2 +- .../CassandraDataCentersGetSamples.java | 2 +- .../CassandraDataCentersListSamples.java | 2 +- .../CassandraDataCentersUpdateSamples.java | 2 +- ...sCreateUpdateCassandraKeyspaceSamples.java | 2 +- ...eUpdateCassandraRoleAssignmentSamples.java | 2 +- ...eUpdateCassandraRoleDefinitionSamples.java | 2 +- ...rcesCreateUpdateCassandraTableSamples.java | 5 +- ...urcesCreateUpdateCassandraViewSamples.java | 48 + ...sourcesDeleteCassandraKeyspaceSamples.java | 2 +- ...sDeleteCassandraRoleAssignmentSamples.java | 2 +- ...sDeleteCassandraRoleDefinitionSamples.java | 2 +- ...aResourcesDeleteCassandraTableSamples.java | 2 +- ...raResourcesDeleteCassandraViewSamples.java | 24 + ...aResourcesGetCassandraKeyspaceSamples.java | 2 +- ...GetCassandraKeyspaceThroughputSamples.java | 2 +- ...rcesGetCassandraRoleAssignmentSamples.java | 2 +- ...rcesGetCassandraRoleDefinitionSamples.java | 2 +- ...ndraResourcesGetCassandraTableSamples.java | 2 +- ...cesGetCassandraTableThroughputSamples.java | 2 +- ...andraResourcesGetCassandraViewSamples.java | 24 + ...rcesGetCassandraViewThroughputSamples.java | 25 + ...esourcesListCassandraKeyspacesSamples.java | 2 +- ...esListCassandraRoleAssignmentsSamples.java | 2 +- ...esListCassandraRoleDefinitionsSamples.java | 2 +- ...raResourcesListCassandraTablesSamples.java | 2 +- ...draResourcesListCassandraViewsSamples.java | 24 + ...teCassandraKeyspaceToAutoscaleSamples.java | 2 +- ...ndraKeyspaceToManualThroughputSamples.java | 2 +- ...grateCassandraTableToAutoscaleSamples.java | 2 +- ...ssandraTableToManualThroughputSamples.java | 2 +- ...igrateCassandraViewToAutoscaleSamples.java | 25 + ...assandraViewToManualThroughputSamples.java | 26 + ...ateCassandraKeyspaceThroughputSamples.java | 2 +- ...UpdateCassandraTableThroughputSamples.java | 2 +- ...sUpdateCassandraViewThroughputSamples.java | 44 + .../ChaosFaultEnableDisableSamples.java | 32 + .../generated/ChaosFaultGetSamples.java | 24 + .../generated/ChaosFaultListSamples.java | 22 + ...ollectionListMetricDefinitionsSamples.java | 2 +- .../CollectionListMetricsSamples.java | 2 +- .../CollectionListUsagesSamples.java | 2 +- ...CollectionPartitionListMetricsSamples.java | 6 +- .../CollectionPartitionListUsagesSamples.java | 6 +- ...tionPartitionRegionListMetricsSamples.java | 7 +- .../CollectionRegionListMetricsSamples.java | 2 +- .../generated/CopyJobsCancelSamples.java | 22 + .../generated/CopyJobsCompleteSamples.java | 24 + .../generated/CopyJobsCreateSamples.java | 44 + .../cosmos/generated/CopyJobsGetSamples.java | 22 + .../CopyJobsListByDatabaseAccountSamples.java | 22 + .../generated/CopyJobsPauseSamples.java | 22 + .../generated/CopyJobsResumeSamples.java | 22 + .../DataTransferJobsCancelSamples.java | 24 + .../DataTransferJobsCompleteSamples.java | 24 + .../DataTransferJobsCreateSamples.java | 35 + .../generated/DataTransferJobsGetSamples.java | 24 + ...nsferJobsListByDatabaseAccountSamples.java | 24 + .../DataTransferJobsPauseSamples.java | 24 + .../DataTransferJobsResumeSamples.java | 24 + ...tabaseAccountRegionListMetricsSamples.java | 2 +- ...atabaseAccountsCheckNameExistsSamples.java | 2 +- ...DatabaseAccountsCreateOrUpdateSamples.java | 13 +- .../DatabaseAccountsDeleteSamples.java | 2 +- ...AccountsFailoverPriorityChangeSamples.java | 2 +- ...baseAccountsGetByResourceGroupSamples.java | 2 +- ...atabaseAccountsGetReadOnlyKeysSamples.java | 2 +- ...aseAccountsListByResourceGroupSamples.java | 2 +- ...eAccountsListConnectionStringsSamples.java | 4 +- .../DatabaseAccountsListKeysSamples.java | 2 +- ...eAccountsListMetricDefinitionsSamples.java | 2 +- .../DatabaseAccountsListMetricsSamples.java | 2 +- ...tabaseAccountsListReadOnlyKeysSamples.java | 2 +- .../DatabaseAccountsListSamples.java | 2 +- .../DatabaseAccountsListUsagesSamples.java | 2 +- .../DatabaseAccountsOfflineRegionSamples.java | 2 +- .../DatabaseAccountsOnlineRegionSamples.java | 2 +- .../DatabaseAccountsRegenerateKeySamples.java | 6 +- .../DatabaseAccountsUpdateSamples.java | 10 +- .../DatabaseListMetricDefinitionsSamples.java | 2 +- .../generated/DatabaseListMetricsSamples.java | 2 +- .../generated/DatabaseListUsagesSamples.java | 2 +- .../FleetAnalyticsCreateSamples.java | 31 + .../FleetAnalyticsDeleteSamples.java | 24 + .../generated/FleetAnalyticsGetSamples.java | 24 + .../generated/FleetAnalyticsListSamples.java | 22 + .../cosmos/generated/FleetCreateSamples.java | 2 +- .../cosmos/generated/FleetDeleteSamples.java | 2 +- .../FleetGetByResourceGroupSamples.java | 2 +- .../FleetListByResourceGroupSamples.java | 2 +- .../cosmos/generated/FleetListSamples.java | 2 +- .../cosmos/generated/FleetUpdateSamples.java | 2 +- .../FleetspaceAccountCreateSamples.java | 2 +- .../FleetspaceAccountDeleteSamples.java | 2 +- .../FleetspaceAccountGetSamples.java | 2 +- .../FleetspaceAccountListSamples.java | 2 +- .../generated/FleetspaceCreateSamples.java | 2 +- .../generated/FleetspaceDeleteSamples.java | 2 +- .../generated/FleetspaceGetSamples.java | 2 +- .../generated/FleetspaceListSamples.java | 2 +- .../generated/FleetspaceUpdateSamples.java | 8 +- .../GarnetClustersCreateUpdateSamples.java | 51 + .../GarnetClustersDeleteSamples.java | 24 + ...rnetClustersGetByResourceGroupSamples.java | 24 + ...netClustersListByResourceGroupSamples.java | 25 + .../generated/GarnetClustersListSamples.java | 22 + .../GarnetClustersUpdateSamples.java | 34 + ...raphResourcesCreateUpdateGraphSamples.java | 47 + ...phResourcesDeleteGraphResourceSamples.java | 24 + .../GraphResourcesGetGraphSamples.java | 24 + .../GraphResourcesListGraphsSamples.java | 22 + ...cesCreateUpdateGremlinDatabaseSamples.java | 2 +- ...ourcesCreateUpdateGremlinGraphSamples.java | 2 +- ...ateUpdateGremlinRoleAssignmentSamples.java | 2 +- ...ateUpdateGremlinRoleDefinitionSamples.java | 2 +- ...ResourcesDeleteGremlinDatabaseSamples.java | 2 +- ...linResourcesDeleteGremlinGraphSamples.java | 2 +- ...cesDeleteGremlinRoleAssignmentSamples.java | 2 +- ...cesDeleteGremlinRoleDefinitionSamples.java | 2 +- ...linResourcesGetGremlinDatabaseSamples.java | 2 +- ...esGetGremlinDatabaseThroughputSamples.java | 2 +- ...remlinResourcesGetGremlinGraphSamples.java | 2 +- ...urcesGetGremlinGraphThroughputSamples.java | 2 +- ...ourcesGetGremlinRoleAssignmentSamples.java | 2 +- ...ourcesGetGremlinRoleDefinitionSamples.java | 2 +- ...nResourcesListGremlinDatabasesSamples.java | 2 +- ...mlinResourcesListGremlinGraphsSamples.java | 2 +- ...rcesListGremlinRoleAssignmentsSamples.java | 2 +- ...rcesListGremlinRoleDefinitionsSamples.java | 2 +- ...rateGremlinDatabaseToAutoscaleSamples.java | 2 +- ...mlinDatabaseToManualThroughputSamples.java | 2 +- ...MigrateGremlinGraphToAutoscaleSamples.java | 2 +- ...GremlinGraphToManualThroughputSamples.java | 2 +- ...eveContinuousBackupInformationSamples.java | 2 +- ...pdateGremlinDatabaseThroughputSamples.java | 2 +- ...esUpdateGremlinGraphThroughputSamples.java | 2 +- .../cosmos/generated/LocationsGetSamples.java | 2 +- .../generated/LocationsListSamples.java | 2 +- ...sCreateUpdateMongoDBCollectionSamples.java | 32 +- ...cesCreateUpdateMongoDBDatabaseSamples.java | 28 +- ...reateUpdateMongoRoleDefinitionSamples.java | 2 +- ...reateUpdateMongoUserDefinitionSamples.java | 2 +- ...sourcesDeleteMongoDBCollectionSamples.java | 2 +- ...ResourcesDeleteMongoDBDatabaseSamples.java | 2 +- ...urcesDeleteMongoRoleDefinitionSamples.java | 2 +- ...urcesDeleteMongoUserDefinitionSamples.java | 2 +- ...BResourcesGetMongoDBCollectionSamples.java | 2 +- ...GetMongoDBCollectionThroughputSamples.java | 2 +- ...oDBResourcesGetMongoDBDatabaseSamples.java | 2 +- ...esGetMongoDBDatabaseThroughputSamples.java | 2 +- ...esourcesGetMongoRoleDefinitionSamples.java | 2 +- ...esourcesGetMongoUserDefinitionSamples.java | 2 +- ...ongoDBCollectionPartitionMergeSamples.java | 27 + ...esourcesListMongoDBCollectionsSamples.java | 2 +- ...BResourcesListMongoDBDatabasesSamples.java | 2 +- ...ourcesListMongoRoleDefinitionsSamples.java | 2 +- ...ourcesListMongoUserDefinitionsSamples.java | 2 +- ...teMongoDBCollectionToAutoscaleSamples.java | 2 +- ...DBCollectionToManualThroughputSamples.java | 2 +- ...rateMongoDBDatabaseToAutoscaleSamples.java | 2 +- ...goDBDatabaseToManualThroughputSamples.java | 2 +- ...ontainerRedistributeThroughputSamples.java | 40 + ...RetrieveThroughputDistributionSamples.java | 34 + ...sMongoDBDatabasePartitionMergeSamples.java | 27 + ...DatabaseRedistributeThroughputSamples.java | 40 + ...RetrieveThroughputDistributionSamples.java | 34 + ...eveContinuousBackupInformationSamples.java | 2 +- ...ateMongoDBCollectionThroughputSamples.java | 2 +- ...pdateMongoDBDatabaseThroughputSamples.java | 2 +- ...ateUpdateMongoMIRoleAssignmentSamples.java | 2 +- ...ateUpdateMongoMIRoleDefinitionSamples.java | 2 +- ...cesDeleteMongoMIRoleAssignmentSamples.java | 2 +- ...cesDeleteMongoMIRoleDefinitionSamples.java | 2 +- ...ourcesGetMongoMIRoleAssignmentSamples.java | 2 +- ...ourcesGetMongoMIRoleDefinitionSamples.java | 2 +- ...rcesListMongoMIRoleAssignmentsSamples.java | 2 +- ...rcesListMongoMIRoleDefinitionsSamples.java | 2 +- ...rityPerimeterConfigurationsGetSamples.java | 26 + ...ityPerimeterConfigurationsListSamples.java | 25 + ...rimeterConfigurationsReconcileSamples.java | 26 + ...tebookWorkspacesCreateOrUpdateSamples.java | 2 +- .../NotebookWorkspacesDeleteSamples.java | 2 +- .../NotebookWorkspacesGetSamples.java | 2 +- ...orkspacesListByDatabaseAccountSamples.java | 2 +- ...okWorkspacesListConnectionInfoSamples.java | 2 +- ...kWorkspacesRegenerateAuthTokenSamples.java | 2 +- .../NotebookWorkspacesStartSamples.java | 2 +- .../generated/OperationsListSamples.java | 2 +- ...PartitionKeyRangeIdListMetricsSamples.java | 2 +- ...ionKeyRangeIdRegionListMetricsSamples.java | 2 +- .../PercentileListMetricsSamples.java | 2 +- ...centileSourceTargetListMetricsSamples.java | 2 +- .../PercentileTargetListMetricsSamples.java | 2 +- ...pointConnectionsCreateOrUpdateSamples.java | 2 +- ...ivateEndpointConnectionsDeleteSamples.java | 2 +- .../PrivateEndpointConnectionsGetSamples.java | 2 +- ...nnectionsListByDatabaseAccountSamples.java | 2 +- .../PrivateLinkResourcesGetSamples.java | 2 +- ...ResourcesListByDatabaseAccountSamples.java | 2 +- ...eDatabaseAccountsGetByLocationSamples.java | 2 +- ...DatabaseAccountsListByLocationSamples.java | 2 +- ...RestorableDatabaseAccountsListSamples.java | 2 +- ...RestorableGremlinDatabasesListSamples.java | 2 +- .../RestorableGremlinGraphsListSamples.java | 2 +- ...RestorableGremlinResourcesListSamples.java | 2 +- ...storableMongodbCollectionsListSamples.java | 2 +- ...RestorableMongodbDatabasesListSamples.java | 2 +- ...RestorableMongodbResourcesListSamples.java | 2 +- .../RestorableSqlContainersListSamples.java | 2 +- .../RestorableSqlDatabasesListSamples.java | 2 +- .../RestorableSqlResourcesListSamples.java | 2 +- .../RestorableTableResourcesListSamples.java | 2 +- .../RestorableTablesListSamples.java | 2 +- .../generated/ServiceCreateSamples.java | 8 +- .../generated/ServiceDeleteSamples.java | 8 +- .../cosmos/generated/ServiceGetSamples.java | 8 +- .../cosmos/generated/ServiceListSamples.java | 2 +- ...SoftDeletedDatabaseAccountsGetSamples.java | 24 + ...DatabaseAccountsListByLocationSamples.java | 25 + ...ListByResourceGroupAndLocationSamples.java | 25 + ...ftDeletedDatabaseAccountsPurgeSamples.java | 24 + ...DeletedDatabaseAccountsRestoreSamples.java | 25 + .../SoftDeletedSqlContainersGetSamples.java | 25 + .../SoftDeletedSqlContainersListSamples.java | 25 + .../SoftDeletedSqlContainersPurgeSamples.java | 25 + ...oftDeletedSqlContainersRestoreSamples.java | 25 + .../SoftDeletedSqlDatabasesGetSamples.java | 25 + .../SoftDeletedSqlDatabasesListSamples.java | 24 + .../SoftDeletedSqlDatabasesPurgeSamples.java | 24 + ...SoftDeletedSqlDatabasesRestoreSamples.java | 24 + ...reateUpdateClientEncryptionKeySamples.java | 20 +- ...ourcesCreateUpdateSqlContainerSamples.java | 80 +- ...sourcesCreateUpdateSqlDatabaseSamples.java | 28 +- ...sCreateUpdateSqlRoleAssignmentSamples.java | 6 +- ...sCreateUpdateSqlRoleDefinitionSamples.java | 6 +- ...CreateUpdateSqlStoredProcedureSamples.java | 2 +- ...esourcesCreateUpdateSqlTriggerSamples.java | 2 +- ...teUpdateSqlUserDefinedFunctionSamples.java | 2 +- ...SqlResourcesDeleteSqlContainerSamples.java | 2 +- .../SqlResourcesDeleteSqlDatabaseSamples.java | 2 +- ...sourcesDeleteSqlRoleAssignmentSamples.java | 2 +- ...sourcesDeleteSqlRoleDefinitionSamples.java | 2 +- ...ourcesDeleteSqlStoredProcedureSamples.java | 2 +- .../SqlResourcesDeleteSqlTriggerSamples.java | 2 +- ...esDeleteSqlUserDefinedFunctionSamples.java | 2 +- ...esourcesGetClientEncryptionKeySamples.java | 2 +- .../SqlResourcesGetSqlContainerSamples.java | 2 +- ...urcesGetSqlContainerThroughputSamples.java | 2 +- .../SqlResourcesGetSqlDatabaseSamples.java | 2 +- ...ourcesGetSqlDatabaseThroughputSamples.java | 2 +- ...lResourcesGetSqlRoleAssignmentSamples.java | 2 +- ...lResourcesGetSqlRoleDefinitionSamples.java | 2 +- ...ResourcesGetSqlStoredProcedureSamples.java | 2 +- .../SqlResourcesGetSqlTriggerSamples.java | 2 +- ...urcesGetSqlUserDefinedFunctionSamples.java | 2 +- ...ourcesListClientEncryptionKeysSamples.java | 2 +- ...ListSqlContainerPartitionMergeSamples.java | 27 + .../SqlResourcesListSqlContainersSamples.java | 2 +- .../SqlResourcesListSqlDatabasesSamples.java | 2 +- ...esourcesListSqlRoleAssignmentsSamples.java | 2 +- ...esourcesListSqlRoleDefinitionsSamples.java | 2 +- ...sourcesListSqlStoredProceduresSamples.java | 2 +- .../SqlResourcesListSqlTriggersSamples.java | 2 +- ...cesListSqlUserDefinedFunctionsSamples.java | 2 +- ...MigrateSqlContainerToAutoscaleSamples.java | 2 +- ...SqlContainerToManualThroughputSamples.java | 2 +- ...sMigrateSqlDatabaseToAutoscaleSamples.java | 2 +- ...eSqlDatabaseToManualThroughputSamples.java | 2 +- ...eveContinuousBackupInformationSamples.java | 2 +- ...ontainerRedistributeThroughputSamples.java | 40 + ...RetrieveThroughputDistributionSamples.java | 34 + ...urcesSqlDatabasePartitionMergeSamples.java | 27 + ...DatabaseRedistributeThroughputSamples.java | 40 + ...RetrieveThroughputDistributionSamples.java | 34 + ...esUpdateSqlContainerThroughputSamples.java | 2 +- ...cesUpdateSqlDatabaseThroughputSamples.java | 2 +- ...reateUpdateTableRoleAssignmentSamples.java | 2 +- ...reateUpdateTableRoleDefinitionSamples.java | 2 +- ...ableResourcesCreateUpdateTableSamples.java | 2 +- ...urcesDeleteTableRoleAssignmentSamples.java | 2 +- ...urcesDeleteTableRoleDefinitionSamples.java | 2 +- .../TableResourcesDeleteTableSamples.java | 2 +- ...esourcesGetTableRoleAssignmentSamples.java | 2 +- ...esourcesGetTableRoleDefinitionSamples.java | 2 +- .../TableResourcesGetTableSamples.java | 2 +- ...bleResourcesGetTableThroughputSamples.java | 2 +- ...ourcesListTableRoleAssignmentsSamples.java | 2 +- ...ourcesListTableRoleDefinitionsSamples.java | 2 +- .../TableResourcesListTablesSamples.java | 2 +- ...sourcesMigrateTableToAutoscaleSamples.java | 2 +- ...MigrateTableToManualThroughputSamples.java | 2 +- ...eveContinuousBackupInformationSamples.java | 2 +- ...ResourcesUpdateTableThroughputSamples.java | 2 +- .../ThroughputPoolAccountCreateSamples.java | 28 + .../ThroughputPoolAccountDeleteSamples.java | 24 + .../ThroughputPoolAccountGetSamples.java | 24 + ...ghputPoolAccountsOperationListSamples.java | 24 + .../ThroughputPoolCreateOrUpdateSamples.java | 42 + .../ThroughputPoolDeleteSamples.java | 22 + ...roughputPoolGetByResourceGroupSamples.java | 24 + .../ThroughputPoolUpdateSamples.java | 27 + ...lsOperationListByResourceGroupSamples.java | 25 + .../ThroughputPoolsOperationListSamples.java | 22 + ...AccessRulePropertiesSubscriptionTests.java | 18 + .../generated/AccessRulePropertiesTests.java | 28 + .../cosmos/generated/AccessRuleTests.java | 30 + .../generated/AccountKeyMetadataTests.java | 6 +- .../generated/ArmProxyResourceTests.java | 5 +- .../generated/ArmResourcePropertiesTests.java | 26 +- .../AutoUpgradePolicyResourceTests.java | 8 +- .../AutoscaleSettingsResourceTests.java | 14 +- .../generated/AutoscaleSettingsTests.java | 8 +- .../generated/AzureBlobContainerTests.java | 25 + ...reBlobDataTransferDataSourceSinkTests.java | 30 + .../AzureBlobSourceSinkDetailsTests.java | 25 + .../BackupInformationInnerTests.java | 8 +- .../generated/BackupResourceInnerTests.java | 25 + .../cosmos/generated/BackupScheduleTests.java | 23 +- .../generated/BaseCopyJobPropertiesTests.java | 22 + .../generated/BaseCopyJobTaskTests.java | 23 + ...CosmosDataTransferDataSourceSinkTests.java | 27 + ...apacityModeChangeTransitionStateTests.java | 35 + .../cosmos/generated/CapacityTests.java | 8 +- ...raKeyspaceCreateUpdateParametersTests.java | 37 +- ...raKeyspaceCreateUpdatePropertiesTests.java | 20 +- ...ndraKeyspaceGetPropertiesOptionsTests.java | 6 +- ...draKeyspaceGetPropertiesResourceTests.java | 4 +- .../CassandraKeyspaceGetPropertiesTests.java | 8 +- ...CassandraKeyspaceGetResultsInnerTests.java | 14 +- .../CassandraKeyspaceListResultTests.java | 4 +- .../CassandraKeyspaceResourceTests.java | 8 +- .../generated/CassandraPartitionKeyTests.java | 8 +- ...assandraRoleAssignmentListResultTests.java | 10 +- ...andraRoleAssignmentResourceInnerTests.java | 20 +- ...RoleAssignmentResourcePropertiesTests.java | 20 +- ...assandraRoleDefinitionListResultTests.java | 16 +- ...andraRoleDefinitionResourceInnerTests.java | 56 +- ...RoleDefinitionResourcePropertiesTests.java | 56 +- ...ssandraTableGetPropertiesOptionsTests.java | 6 +- ...sandraViewCreateUpdateParametersTests.java | 67 + ...sandraViewCreateUpdatePropertiesTests.java | 38 + ...assandraViewGetPropertiesOptionsTests.java | 20 + ...ssandraViewGetPropertiesResourceTests.java | 20 + .../CassandraViewGetPropertiesTests.java | 22 + .../CassandraViewGetResultsInnerTests.java | 26 + .../CassandraViewListResultTests.java | 19 + .../generated/CassandraViewResourceTests.java | 27 + .../cosmos/generated/CertificateTests.java | 8 +- .../ChaosFaultListResponseTests.java | 24 + .../generated/ChaosFaultPropertiesTests.java | 36 + .../ChaosFaultResourceInnerTests.java | 36 + .../cosmos/generated/ClusterKeyTests.java | 14 +- .../cosmos/generated/ColumnTests.java | 12 +- .../generated/CommandAsyncPostBodyTests.java | 36 + .../generated/CommandOutputInnerTests.java | 4 +- .../generated/CommandPostBodyTests.java | 26 +- .../CommandPublicResourceInnerTests.java | 28 + .../cosmos/generated/CompositePathTests.java | 15 +- .../generated/ComputedPropertyTests.java | 14 +- .../ConflictResolutionPolicyTests.java | 21 +- .../generated/ConnectionErrorTests.java | 13 +- .../ContinuousBackupInformationTests.java | 4 +- .../ContinuousBackupRestoreLocationTests.java | 10 +- .../ContinuousModePropertiesTests.java | 8 +- .../CosmosDBMongoCollectionTests.java | 29 + .../CosmosDBMongoVCoreCollectionTests.java | 29 + .../CosmosDBNoSqlContainerTests.java | 27 + .../CosmosDBSourceSinkDetailsTests.java | 25 + ...sMongoDataTransferDataSourceSinkTests.java | 33 + ...mosSqlDataTransferDataSourceSinkTests.java | 33 + .../generated/CreateUpdateOptionsTests.java | 14 +- ...taMaskingPolicyExcludedPathsItemTests.java | 25 + ...taMaskingPolicyIncludedPathsItemTests.java | 35 + .../generated/DataMaskingPolicyTests.java | 52 + .../DataTransferDataSourceSinkTests.java | 22 + ...aTransferRegionalServiceResourceTests.java | 2 +- ...ceResourceCreateUpdateParametersTests.java | 14 +- ...ransferServiceResourcePropertiesTests.java | 4 +- .../generated/DiagnosticLogSettingsTests.java | 26 + .../cosmos/generated/ExcludedPathTests.java | 8 +- .../generated/FailoverPoliciesTests.java | 16 +- .../FleetAnalyticsListResultTests.java | 23 + .../FleetAnalyticsPropertiesTests.java | 33 + .../FleetAnalyticsResourceInnerTests.java | 33 + .../generated/FleetListResultTests.java | 8 +- .../generated/FleetResourceInnerTests.java | 15 +- .../FleetResourcePropertiesTests.java | 2 +- .../generated/FleetResourceUpdateTests.java | 10 +- .../FleetspaceAccountListResultTests.java | 10 +- ...sGlobalDatabaseAccountPropertiesTests.java | 14 +- .../FleetspaceAccountPropertiesTests.java | 14 +- .../FleetspaceAccountResourceInnerTests.java | 14 +- .../generated/FleetspaceListResultTests.java | 14 +- .../generated/FleetspacePropertiesTests.java | 32 +- ...rtiesThroughputPoolConfigurationTests.java | 26 +- .../FleetspaceResourceInnerTests.java | 32 +- .../generated/FleetspaceUpdateTests.java | 32 +- .../generated/FullTextIndexPathTests.java | 9 +- .../cosmos/generated/FullTextPathTests.java | 14 +- .../cosmos/generated/FullTextPolicyTests.java | 20 +- ...etClusterResourcePatchPropertiesTests.java | 39 + .../GarnetClusterResourcePatchTests.java | 40 + ...rResourcePropertiesEndPointsItemTests.java | 20 + ...piComputeRegionalServiceResourceTests.java | 5 +- ...ceResourceCreateUpdateParametersTests.java | 8 +- ...ComputeServiceResourcePropertiesTests.java | 6 +- ...phResourceCreateUpdateParametersTests.java | 66 + ...phResourceCreateUpdatePropertiesTests.java | 36 + ...raphResourceGetPropertiesOptionsTests.java | 20 + ...aphResourceGetPropertiesResourceTests.java | 18 + .../GraphResourceGetPropertiesTests.java | 21 + .../GraphResourceGetResultsInnerTests.java | 25 + .../cosmos/generated/GraphResourceTests.java | 24 + .../GraphResourcesListResultTests.java | 19 + ...inDatabaseCreateUpdateParametersTests.java | 47 +- ...inDatabaseCreateUpdatePropertiesTests.java | 38 +- ...mlinDatabaseGetPropertiesOptionsTests.java | 6 +- ...linDatabaseGetPropertiesResourceTests.java | 12 +- .../GremlinDatabaseGetPropertiesTests.java | 16 +- .../GremlinDatabaseGetResultsInnerTests.java | 18 +- .../GremlinDatabaseListResultTests.java | 4 +- .../GremlinDatabaseResourceTests.java | 32 +- ...GremlinGraphGetPropertiesOptionsTests.java | 6 +- .../GremlinRoleAssignmentListResultTests.java | 10 +- ...emlinRoleAssignmentResourceInnerTests.java | 20 +- ...RoleAssignmentResourcePropertiesTests.java | 20 +- .../GremlinRoleDefinitionListResultTests.java | 18 +- ...emlinRoleDefinitionResourceInnerTests.java | 44 +- ...RoleDefinitionResourcePropertiesTests.java | 56 +- .../cosmos/generated/IncludedPathTests.java | 20 +- .../cosmos/generated/IndexesTests.java | 8 +- .../generated/KeyWrapMetadataTests.java | 26 +- .../cosmos/generated/ListBackupsTests.java | 19 + .../cosmos/generated/ListCommandsTests.java | 19 + .../LocationGetResultInnerTests.java | 2 +- .../generated/LocationListResultTests.java | 4 +- .../generated/LocationPropertiesTests.java | 2 +- ...dCassandraManagedServiceIdentityTests.java | 10 +- .../ManagedCassandraReaperStatusTests.java | 6 +- .../ManagedServiceIdentityTests.java | 13 +- ...ceIdentityUserAssignedIdentitiesTests.java | 2 +- .../MaterializedViewDefinitionTests.java | 32 + .../MaterializedViewDetailsTests.java | 27 + ...wsBuilderRegionalServiceResourceTests.java | 2 +- ...ceResourceCreateUpdateParametersTests.java | 14 +- ...BuilderServiceResourcePropertiesTests.java | 4 +- .../MaterializedViewsPropertiesTests.java | 25 + .../generated/MergeParametersTests.java | 24 + .../generated/MetricAvailabilityTests.java | 2 +- .../generated/MetricDefinitionInnerTests.java | 2 +- .../MetricDefinitionsListResultTests.java | 4 +- .../cosmos/generated/MetricInnerTests.java | 2 +- .../generated/MetricListResultTests.java | 4 +- .../cosmos/generated/MetricNameTests.java | 2 +- .../cosmos/generated/MetricValueTests.java | 2 +- ...DBCollectionGetPropertiesOptionsTests.java | 6 +- ...DBDatabaseCreateUpdateParametersTests.java | 64 +- ...DBDatabaseCreateUpdatePropertiesTests.java | 38 +- ...goDBDatabaseGetPropertiesOptionsTests.java | 6 +- ...oDBDatabaseGetPropertiesResourceTests.java | 10 +- .../MongoDBDatabaseGetPropertiesTests.java | 14 +- .../MongoDBDatabaseGetResultsInnerTests.java | 20 +- .../MongoDBDatabaseListResultTests.java | 4 +- .../MongoDBDatabaseResourceTests.java | 20 +- .../generated/MongoIndexOptionsTests.java | 8 +- .../MongoMIRoleAssignmentListResultTests.java | 10 +- ...ngoMIRoleAssignmentResourceInnerTests.java | 21 +- ...RoleAssignmentResourcePropertiesTests.java | 20 +- .../MongoMIRoleDefinitionListResultTests.java | 18 +- ...ngoMIRoleDefinitionResourceInnerTests.java | 63 +- ...RoleDefinitionResourcePropertiesTests.java | 50 +- ...ongoRUToMongoRUCopyJobPropertiesTests.java | 51 + .../MongoRUToMongoRUCopyJobTaskTests.java | 36 + .../MongoRUToMongoVCoreCopyJobTaskTests.java | 38 + ...DefinitionCreateUpdateParametersTests.java | 55 +- ...ngoRoleDefinitionGetResultsInnerTests.java | 18 +- .../MongoRoleDefinitionListResultTests.java | 4 +- .../MongoRoleDefinitionResourceTests.java | 58 +- ...urityPerimeterConfigurationInnerTests.java | 41 + ...PerimeterConfigurationListResultTests.java | 33 + ...PerimeterConfigurationPropertiesTests.java | 39 + .../NetworkSecurityPerimeterTests.java | 21 + .../NetworkSecurityProfileTests.java | 36 + ...oSqlRUToNoSqlRUCopyJobPropertiesTests.java | 64 + .../NoSqlRUToNoSqlRUCopyJobTaskTests.java | 37 + ...kWorkspaceCreateUpdateParametersTests.java | 2 +- .../NotebookWorkspaceInnerTests.java | 2 +- .../NotebookWorkspaceListResultTests.java | 4 +- .../NotebookWorkspacePropertiesTests.java | 2 +- .../generated/OptionsResourceTests.java | 6 +- .../generated/PercentileMetricInnerTests.java | 2 +- .../PercentileMetricListResultTests.java | 4 +- .../generated/PercentileMetricValueTests.java | 2 +- .../cosmos/generated/PermissionTests.java | 20 +- .../generated/PhysicalPartitionIdTests.java | 24 + ...titionStorageInfoCollectionInnerTests.java | 17 + .../PhysicalPartitionStorageInfoTests.java | 17 + ...artitionThroughputInfoPropertiesTests.java | 21 + ...lPartitionThroughputInfoResourceTests.java | 32 + ...rtitionThroughputInfoResultInnerTests.java | 27 + ...hputInfoResultPropertiesResourceTests.java | 21 + ...onThroughputInfoResultPropertiesTests.java | 23 + ...vateEndpointConnectionListResultTests.java | 15 +- .../PrivateLinkResourceInnerTests.java | 2 +- .../PrivateLinkResourceListResultTests.java | 4 +- .../PrivateLinkResourcePropertiesTests.java | 5 +- .../generated/PrivilegeResourceTests.java | 15 +- .../cosmos/generated/PrivilegeTests.java | 18 +- .../ProvisioningIssuePropertiesTests.java | 17 + .../generated/ProvisioningIssueTests.java | 17 + ...RedistributeThroughputParametersTests.java | 98 + ...buteThroughputPropertiesResourceTests.java | 60 + ...RedistributeThroughputPropertiesTests.java | 65 + .../RegionForOnlineOfflineTests.java | 8 +- .../RegionalServiceResourceTests.java | 2 +- .../generated/ResourceAssociationTests.java | 20 + .../ResourceRestoreParametersTests.java | 20 +- ...bleDatabaseAccountGetResultInnerTests.java | 12 +- ...torableDatabaseAccountPropertiesTests.java | 10 +- ...orableDatabaseAccountsListResultTests.java | 4 +- ...bleGremlinDatabaseGetResultInnerTests.java | 2 +- ...remlinDatabasePropertiesResourceTests.java | 2 +- ...torableGremlinDatabasePropertiesTests.java | 2 +- ...orableGremlinDatabasesListResultTests.java | 4 +- ...orableGremlinGraphGetResultInnerTests.java | 2 +- ...leGremlinGraphPropertiesResourceTests.java | 2 +- ...RestorableGremlinGraphPropertiesTests.java | 2 +- ...estorableGremlinGraphsListResultTests.java | 4 +- ...leGremlinResourcesGetResultInnerTests.java | 6 +- ...orableGremlinResourcesListResultTests.java | 4 +- .../RestorableLocationResourceTests.java | 2 +- ...eMongodbCollectionGetResultInnerTests.java | 2 +- ...godbCollectionPropertiesResourceTests.java | 2 +- ...rableMongodbCollectionPropertiesTests.java | 2 +- ...ableMongodbCollectionsListResultTests.java | 4 +- ...bleMongodbDatabaseGetResultInnerTests.java | 2 +- ...ongodbDatabasePropertiesResourceTests.java | 2 +- ...torableMongodbDatabasePropertiesTests.java | 2 +- ...orableMongodbDatabasesListResultTests.java | 4 +- ...leMongodbResourcesGetResultInnerTests.java | 6 +- ...orableMongodbResourcesListResultTests.java | 4 +- ...torableSqlDatabaseGetResultInnerTests.java | 12 +- ...tabasePropertiesResourceDatabaseTests.java | 10 +- ...bleSqlDatabasePropertiesResourceTests.java | 10 +- .../RestorableSqlDatabasePropertiesTests.java | 10 +- ...RestorableSqlDatabasesListResultTests.java | 4 +- ...orableSqlResourcesGetResultInnerTests.java | 6 +- ...RestorableSqlResourcesListResultTests.java | 4 +- .../RestorableTableGetResultInnerTests.java | 2 +- ...estorableTablePropertiesResourceTests.java | 2 +- .../RestorableTablePropertiesTests.java | 2 +- ...ableTableResourcesGetResultInnerTests.java | 2 +- ...storableTableResourcesListResultTests.java | 4 +- .../RestorableTablesListResultTests.java | 4 +- .../RetrieveThroughputParametersTests.java | 61 + ...ieveThroughputPropertiesResourceTests.java | 29 + .../RetrieveThroughputPropertiesTests.java | 32 + .../cosmos/generated/RoleTests.java | 12 +- .../cosmos/generated/SeedNodeTests.java | 8 +- ...ceResourceCreateUpdateParametersTests.java | 14 +- ...ceResourceCreateUpdatePropertiesTests.java | 8 +- .../generated/ServiceResourceInnerTests.java | 4 +- .../ServiceResourceListResultTests.java | 4 +- .../ServiceResourcePropertiesTests.java | 4 +- .../SoftDeleteConfigurationTests.java | 32 + ...tedDatabaseAccountGetResultInnerTests.java | 39 + ...DeletedDatabaseAccountPropertiesTests.java | 35 + ...ftDeletedDatabaseAccountResourceTests.java | 27 + ...dDatabaseAccountsListResultInnerTests.java | 30 + ...DeletedSqlDatabaseGetResultInnerTests.java | 24 + ...SoftDeletedSqlDatabasePropertiesTests.java | 23 + .../SoftDeletedSqlDatabaseResourceTests.java | 18 + ...letedSqlDatabasesListResultInnerTests.java | 25 + .../generated/SoftDeletionMetadataTests.java | 21 + .../cosmos/generated/SpatialSpecTests.java | 16 +- ...SqlContainerGetPropertiesOptionsTests.java | 6 +- ...qlDatabaseCreateUpdateParametersTests.java | 62 +- ...qlDatabaseCreateUpdatePropertiesTests.java | 38 +- .../SqlDatabaseGetPropertiesOptionsTests.java | 6 +- ...SqlDatabaseGetPropertiesResourceTests.java | 16 +- .../SqlDatabaseGetPropertiesTests.java | 16 +- .../SqlDatabaseGetResultsInnerTests.java | 22 +- .../generated/SqlDatabaseListResultTests.java | 4 +- .../generated/SqlDatabaseResourceTests.java | 20 +- ...edGatewayRegionalServiceResourceTests.java | 2 +- ...ceResourceCreateUpdateParametersTests.java | 14 +- ...GatewayServiceResourcePropertiesTests.java | 10 +- ...AssignmentCreateUpdateParametersTests.java | 20 +- ...SqlRoleAssignmentGetResultsInnerTests.java | 8 +- .../SqlRoleAssignmentListResultTests.java | 4 +- .../SqlRoleAssignmentResourceTests.java | 24 +- ...DefinitionCreateUpdateParametersTests.java | 44 +- ...SqlRoleDefinitionGetResultsInnerTests.java | 14 +- .../SqlRoleDefinitionListResultTests.java | 4 +- .../SqlRoleDefinitionResourceTests.java | 32 +- ...dProcedureCreateUpdateParametersTests.java | 48 +- ...dProcedureCreateUpdatePropertiesTests.java | 24 +- ...edProcedureGetPropertiesResourceTests.java | 8 +- .../SqlStoredProcedureGetPropertiesTests.java | 6 +- ...qlStoredProcedureGetResultsInnerTests.java | 12 +- .../SqlStoredProcedureListResultTests.java | 4 +- .../SqlStoredProcedureResourceTests.java | 16 +- ...SqlTriggerCreateUpdateParametersTests.java | 56 +- ...SqlTriggerCreateUpdatePropertiesTests.java | 32 +- .../SqlTriggerGetPropertiesResourceTests.java | 8 +- .../SqlTriggerGetPropertiesTests.java | 6 +- .../SqlTriggerGetResultsInnerTests.java | 14 +- .../generated/SqlTriggerListResultTests.java | 4 +- .../generated/SqlTriggerResourceTests.java | 14 +- ...edFunctionCreateUpdateParametersTests.java | 45 +- ...edFunctionCreateUpdatePropertiesTests.java | 24 +- ...nedFunctionGetPropertiesResourceTests.java | 6 +- ...UserDefinedFunctionGetPropertiesTests.java | 6 +- ...erDefinedFunctionGetResultsInnerTests.java | 12 +- ...SqlUserDefinedFunctionListResultTests.java | 4 +- .../SqlUserDefinedFunctionResourceTests.java | 12 +- .../TableCreateUpdateParametersTests.java | 53 +- .../TableCreateUpdatePropertiesTests.java | 38 +- .../TableGetPropertiesOptionsTests.java | 6 +- .../TableGetPropertiesResourceTests.java | 12 +- .../generated/TableGetPropertiesTests.java | 14 +- .../generated/TableGetResultsInnerTests.java | 18 +- .../generated/TableListResultTests.java | 4 +- .../cosmos/generated/TableResourceTests.java | 32 +- .../TableRoleAssignmentListResultTests.java | 10 +- ...TableRoleAssignmentResourceInnerTests.java | 20 +- ...RoleAssignmentResourcePropertiesTests.java | 20 +- .../TableRoleDefinitionListResultTests.java | 16 +- ...TableRoleDefinitionResourceInnerTests.java | 50 +- ...RoleDefinitionResourcePropertiesTests.java | 59 +- .../ThroughputBucketResourceTests.java | 32 + .../ThroughputPolicyResourceTests.java | 8 +- .../ThroughputPoolAccountPropertiesTests.java | 29 + ...roughputPoolAccountResourceInnerTests.java | 30 + ...ThroughputPoolAccountsListResultTests.java | 21 + .../ThroughputPoolPropertiesTests.java | 30 + .../ThroughputPoolResourceInnerTests.java | 50 + .../generated/ThroughputPoolUpdateTests.java | 30 + .../ThroughputPoolsListResultTests.java | 24 + ...putSettingsGetPropertiesResourceTests.java | 11 +- .../ThroughputSettingsGetPropertiesTests.java | 11 +- ...hroughputSettingsGetResultsInnerTests.java | 19 +- .../ThroughputSettingsResourceTests.java | 31 +- ...roughputSettingsUpdateParametersTests.java | 62 +- ...roughputSettingsUpdatePropertiesTests.java | 35 +- .../cosmos/generated/UniqueKeyTests.java | 9 +- .../cosmos/generated/UsageInnerTests.java | 2 +- .../cosmos/generated/UsagesResultTests.java | 4 +- .../generated/VectorEmbeddingPolicyTests.java | 44 +- .../generated/VectorEmbeddingTests.java | 23 +- .../tsp-location.yaml | 2 +- 873 files changed, 57264 insertions(+), 3235 deletions(-) create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ChaosFaultsClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CopyJobsClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DataTransferJobsClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetAnalyticsClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GarnetClustersClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GraphResourcesClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/NetworkSecurityPerimeterConfigurationsClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedDatabaseAccountsClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedSqlContainersClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedSqlDatabasesClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsOperationsClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsOperationsClient.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupResourceInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewCreateUpdateProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetResultsInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultResourceInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandPublicResourceInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CopyJobGetResultsInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobGetResultsInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsResourceInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GarnetClusterResourceInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceCreateUpdateProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetResultsInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NetworkSecurityPerimeterConfigurationInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionStorageInfoCollectionInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RedistributeThroughputProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RetrieveThroughputProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedDatabaseAccountGetResultInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedDatabaseAccountsListResultInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlContainerGetResultInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlContainersListResultInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlDatabaseGetResultInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlDatabasesListResultInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountResourceInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolResourceInner.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ChaosFaultsClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CopyJobsClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DataTransferJobsClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetAnalyticsClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GarnetClustersClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GraphResourcesClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedDatabaseAccountsClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedSqlContainersClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedSqlDatabasesClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsOperationsClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsOperationsClientImpl.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraViewListResult.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ChaosFaultListResponse.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CopyJobFeedResults.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DataTransferJobFeedResults.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetAnalyticsListResult.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GraphResourcesListResult.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListBackups.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListCommands.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListGarnetClusters.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NetworkSecurityPerimeterConfigurationListResult.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolAccountsListResult.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolsListResult.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRule.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleDirection.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRulePropertiesSubscription.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AllocationState.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobContainer.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobDataTransferDataSourceSink.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobSourceSinkDetails.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupState.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobTask.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCosmosDataTransferDataSourceSink.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobTask.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityMode.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeChangeTransitionState.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeTransitionStatus.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobTask.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobTask.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewCreateUpdateParameters.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesOptions.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesResource.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewResource.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterType.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandAsyncPostBody.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandStatus.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobMode.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobStatus.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobType.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosCassandraDataTransferDataSourceSink.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBCassandraTable.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoCollection.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoVCoreCollection.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBNoSqlContainer.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBSourceSinkDetails.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoDataTransferDataSourceSink.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoVCoreDataTransferDataSourceSink.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosSqlDataTransferDataSourceSink.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateJobRequest.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicy.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyExcludedPathsItem.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyIncludedPathsItem.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferComponent.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferDataSourceSink.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferJobMode.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DiagnosticLogSettings.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/EnableFullTextQuery.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetAnalyticsPropertiesStorageLocationType.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetAuthenticationType.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetCacheProvisioningState.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatch.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatchProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourceProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePropertiesEndPointsItem.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResource.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceCreateUpdateParameters.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesOptions.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesResource.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IssueType.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDefinition.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDetails.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MergeParameters.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobTask.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobTask.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoVCoreSourceSinkDetails.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeter.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProvisioningState.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityProfile.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobTask.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionId.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionStorageInfo.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResource.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResultPropertiesResource.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssue.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssueProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputParameters.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputPropertiesResource.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociation.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociationAccessMode.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputParameters.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputPropertiesResource.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Severity.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeleteActionKind.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeleteConfiguration.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedDatabaseAccountProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedDatabaseAccountResource.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlContainerProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlContainerResource.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlDatabaseProperties.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlDatabaseResource.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletionMetadata.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SupportedActions.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputBucketResource.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyType.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPoolUpdate.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetBackupSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetCommandAsyncResourceSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersInvokeCommandAsyncResourceSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListBackupsSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListCommandSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraViewSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraViewSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraViewSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraViewThroughputSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraViewsSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraViewToAutoscaleSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraViewToManualThroughputSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraViewThroughputSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultEnableDisableSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultGetSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultListSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsCancelSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsCompleteSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsCreateSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsGetSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsListByDatabaseAccountSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsPauseSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsResumeSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsCancelSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsCompleteSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsCreateSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsGetSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsListByDatabaseAccountSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsPauseSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsResumeSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsCreateSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsDeleteSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsGetSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsListSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersCreateUpdateSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersDeleteSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersGetByResourceGroupSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersListByResourceGroupSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersListSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersUpdateSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesCreateUpdateGraphSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesDeleteGraphResourceSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesGetGraphSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesListGraphsSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBCollectionPartitionMergeSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBContainerRedistributeThroughputSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBDatabasePartitionMergeSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBDatabaseRedistributeThroughputSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationsListSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsGetSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsListByLocationSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsListByResourceGroupAndLocationSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsPurgeSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsRestoreSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersGetSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersListSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersPurgeSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersRestoreSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesGetSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesListSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesPurgeSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesRestoreSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlContainerPartitionMergeSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlContainerRedistributeThroughputSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlContainerRetrieveThroughputDistributionSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlDatabasePartitionMergeSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlDatabaseRedistributeThroughputSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlDatabaseRetrieveThroughputDistributionSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountCreateSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountDeleteSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountGetSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountsOperationListSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolCreateOrUpdateSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolDeleteSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolGetByResourceGroupSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolUpdateSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolsOperationListByResourceGroupSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolsOperationListSamples.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccessRulePropertiesSubscriptionTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccessRulePropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccessRuleTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AzureBlobContainerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AzureBlobDataTransferDataSourceSinkTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AzureBlobSourceSinkDetailsTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BackupResourceInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BaseCopyJobPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BaseCopyJobTaskTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BaseCosmosDataTransferDataSourceSinkTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CapacityModeChangeTransitionStateTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewCreateUpdateParametersTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewCreateUpdatePropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetPropertiesOptionsTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetPropertiesResourceTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetResultsInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewListResultTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewResourceTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultListResponseTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultResourceInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandAsyncPostBodyTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandPublicResourceInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBMongoCollectionTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBMongoVCoreCollectionTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBNoSqlContainerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBSourceSinkDetailsTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosMongoDataTransferDataSourceSinkTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosSqlDataTransferDataSourceSinkTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataMaskingPolicyExcludedPathsItemTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataMaskingPolicyIncludedPathsItemTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataMaskingPolicyTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferDataSourceSinkTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DiagnosticLogSettingsTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsListResultTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsResourceInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GarnetClusterResourcePatchPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GarnetClusterResourcePatchTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GarnetClusterResourcePropertiesEndPointsItemTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceCreateUpdateParametersTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceCreateUpdatePropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetPropertiesOptionsTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetPropertiesResourceTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetResultsInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesListResultTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ListBackupsTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ListCommandsTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewDefinitionTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewDetailsTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MergeParametersTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRUToMongoRUCopyJobPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRUToMongoRUCopyJobTaskTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRUToMongoVCoreCopyJobTaskTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationListResultTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityProfileTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NoSqlRUToNoSqlRUCopyJobPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NoSqlRUToNoSqlRUCopyJobTaskTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionIdTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionStorageInfoCollectionInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionStorageInfoTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResourceTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResultInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResultPropertiesResourceTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResultPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ProvisioningIssuePropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ProvisioningIssueTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RedistributeThroughputParametersTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RedistributeThroughputPropertiesResourceTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RedistributeThroughputPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ResourceAssociationTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RetrieveThroughputParametersTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RetrieveThroughputPropertiesResourceTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RetrieveThroughputPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeleteConfigurationTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountGetResultInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountResourceTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsListResultInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabaseGetResultInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasePropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabaseResourceTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesListResultInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletionMetadataTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputBucketResourceTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountResourceInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountsListResultTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolPropertiesTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolResourceInnerTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolUpdateTests.java create mode 100644 sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolsListResultTests.java diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/CHANGELOG.md b/sdk/cosmos/azure-resourcemanager-cosmos/CHANGELOG.md index b08465af9ea8..c9582691430e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-resourcemanager-cosmos/CHANGELOG.md @@ -1,14 +1,278 @@ # Release History -## 2.56.0-beta.1 (Unreleased) +## 2.56.0-beta.1 (2026-08-20) + +- Package api-version 2026-04-01-preview. ### Features Added -### Breaking Changes +* `models.ThroughputPoolUpdate` was added -### Bugs Fixed +* `models.CassandraRUToCassandraRUCopyJobTask` was added -### Other Changes +* `models.SoftDeletedSqlContainerProperties` was added + +* `models.GarnetCacheProvisioningState` was added + +* `models.SoftDeletedDatabaseAccountResource` was added + +* `models.CosmosDBMongoCollection` was added + +* `models.CassandraViewCreateUpdateParameters` was added + +* `models.ResourceAssociation` was added + +* `models.GraphResourceGetPropertiesOptions` was added + +* `models.CosmosMongoDataTransferDataSourceSink` was added + +* `models.DataTransferDataSourceSink` was added + +* `models.NoSqlRUToNoSqlRUCopyJobTask` was added + +* `models.CosmosCassandraDataTransferDataSourceSink` was added + +* `models.CosmosSqlDataTransferDataSourceSink` was added + +* `models.CapacityModeTransitionStatus` was added + +* `models.SoftDeletedDatabaseAccountProperties` was added + +* `models.GarnetClusterResourcePatch` was added + +* `models.PhysicalPartitionStorageInfo` was added + +* `models.GarnetClusterResourcePatchProperties` was added + +* `models.BlobToCassandraRUCopyJobTask` was added + +* `models.CosmosDBMongoVCoreCollection` was added + +* `models.CapacityMode` was added + +* `models.CopyJobStatus` was added + +* `models.MergeParameters` was added + +* `models.MongoRUToMongoRUCopyJobTask` was added + +* `models.SoftDeleteConfiguration` was added + +* `models.CassandraViewResource` was added + +* `models.GarnetAuthenticationType` was added + +* `models.GraphResource` was added + +* `models.SoftDeletionMetadata` was added + +* `models.CassandraRUToBlobCopyJobTask` was added + +* `models.AccessRulePropertiesSubscription` was added + +* `models.IssueType` was added + +* `models.ResourceAssociationAccessMode` was added + +* `models.EnableFullTextQuery` was added + +* `models.DataMaskingPolicyIncludedPathsItem` was added + +* `models.CassandraRUToBlobCopyJobProperties` was added + +* `models.DiagnosticLogSettings` was added + +* `models.NetworkSecurityPerimeterConfigurationProperties` was added + +* `models.CosmosDBCassandraTable` was added + +* `models.CommandAsyncPostBody` was added + +* `models.SoftDeletedSqlDatabaseResource` was added + +* `models.BaseCopyJobTask` was added + +* `models.BackupState` was added + +* `models.BlobToCassandraRUCopyJobProperties` was added + +* `models.RetrieveThroughputPropertiesResource` was added + +* `models.MongoRUToMongoRUCopyJobProperties` was added + +* `models.RetrieveThroughputParameters` was added + +* `models.AzureBlobDataTransferDataSourceSink` was added + +* `models.CosmosDBSourceSinkDetails` was added + +* `models.DataMaskingPolicy` was added + +* `models.PhysicalPartitionThroughputInfoResultPropertiesResource` was added + +* `models.MongoRUToMongoVCoreCopyJobTask` was added + +* `models.AzureBlobContainer` was added + +* `models.DataMaskingPolicyExcludedPathsItem` was added + +* `models.SupportedActions` was added + +* `models.CommandStatus` was added + +* `models.DataTransferJobMode` was added + +* `models.PhysicalPartitionThroughputInfoResource` was added + +* `models.MaterializedViewDetails` was added + +* `models.NetworkSecurityProfile` was added + +* `models.CosmosMongoVCoreDataTransferDataSourceSink` was added + +* `models.Severity` was added + +* `models.PhysicalPartitionId` was added + +* `models.BaseCosmosDataTransferDataSourceSink` was added + +* `models.AzureBlobSourceSinkDetails` was added + +* `models.NoSqlRUToNoSqlRUCopyJobProperties` was added + +* `models.MaterializedViewDefinition` was added + +* `models.MongoRUToMongoVCoreCopyJobProperties` was added + +* `models.DataTransferComponent` was added + +* `models.PhysicalPartitionThroughputInfoProperties` was added + +* `models.RedistributeThroughputPropertiesResource` was added + +* `models.ThroughputBucketResource` was added + +* `models.RedistributeThroughputParameters` was added + +* `models.BaseCopyJobProperties` was added + +* `models.CosmosDBNoSqlContainer` was added + +* `models.AccessRuleDirection` was added + +* `models.CapacityModeChangeTransitionState` was added + +* `models.GraphResourceGetPropertiesResource` was added + +* `models.NetworkSecurityPerimeter` was added + +* `models.CopyJobMode` was added + +* `models.NetworkSecurityPerimeterConfigurationProvisioningState` was added + +* `models.GarnetClusterResourceProperties` was added + +* `models.SoftDeletedSqlDatabaseProperties` was added + +* `models.CassandraViewGetPropertiesResource` was added + +* `models.CassandraRUToCassandraRUCopyJobProperties` was added + +* `models.MaterializedViewsProperties` was added + +* `models.AccessRule` was added + +* `models.ProvisioningIssueProperties` was added + +* `models.CreateJobRequest` was added + +* `models.ClusterType` was added + +* `models.MongoVCoreSourceSinkDetails` was added + +* `models.CopyJobProperties` was added + +* `models.GarnetClusterResourcePropertiesEndPointsItem` was added + +* `models.CassandraViewGetPropertiesOptions` was added + +* `models.AccessRuleProperties` was added + +* `models.CopyJobType` was added + +* `models.SoftDeletedSqlContainerResource` was added + +* `models.ThroughputPolicyType` was added + +* `models.AllocationState` was added + +* `models.SoftDeleteActionKind` was added + +* `models.GraphResourceCreateUpdateParameters` was added + +* `models.FleetAnalyticsPropertiesStorageLocationType` was added + +* `models.ProvisioningIssue` was added + +#### `models.DatabaseAccountUpdateParameters` was modified + +* `enableAllVersionsAndDeletesChangeFeed()` was added +* `capacityMode()` was added +* `withCapacityMode(models.CapacityMode)` was added +* `enableMaterializedViews()` was added +* `softDeleteConfiguration()` was added +* `withEnableMaterializedViews(java.lang.Boolean)` was added +* `withSoftDeleteConfiguration(models.SoftDeleteConfiguration)` was added +* `withDiagnosticLogSettings(models.DiagnosticLogSettings)` was added +* `withEnableAllVersionsAndDeletesChangeFeed(java.lang.Boolean)` was added +* `diagnosticLogSettings()` was added + +#### `models.AccountKeyMetadata` was modified + +* `approximateLastUsageTime()` was added + +#### `models.DatabaseAccountCreateUpdateParameters` was modified + +* `withSoftDeleteConfiguration(models.SoftDeleteConfiguration)` was added +* `withCapacityMode(models.CapacityMode)` was added +* `enableAllVersionsAndDeletesChangeFeed()` was added +* `withDiagnosticLogSettings(models.DiagnosticLogSettings)` was added +* `softDeleteConfiguration()` was added +* `diagnosticLogSettings()` was added +* `withEnableAllVersionsAndDeletesChangeFeed(java.lang.Boolean)` was added +* `withEnableMaterializedViews(java.lang.Boolean)` was added +* `enableMaterializedViews()` was added +* `capacityMode()` was added + +#### `models.ClusterResourceProperties` was modified + +* `withClusterType(models.ClusterType)` was added +* `clusterType()` was added + +#### `models.DatabaseAccountRegenerateKeyParameters` was modified + +* `withSkipAccountKeysLastUsageCheck(java.lang.Boolean)` was added +* `skipAccountKeysLastUsageCheck()` was added + +#### `models.SqlContainerResource` was modified + +* `materializedViewsProperties()` was added +* `materializedViews()` was added +* `withMaterializedViewDefinition(models.MaterializedViewDefinition)` was added +* `withDataMaskingPolicy(models.DataMaskingPolicy)` was added +* `withMaterializedViews(java.util.List)` was added +* `withMaterializedViewsProperties(models.MaterializedViewsProperties)` was added +* `dataMaskingPolicy()` was added +* `materializedViewDefinition()` was added + +#### `models.ThroughputSettingsResource` was modified + +* `withThroughputBuckets(java.util.List)` was added +* `throughputBuckets()` was added + +#### `models.ContinuousTier` was modified + +* `CONTINUOUS35DAYS` was added ## 2.55.0 (2026-07-01) diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/README.md b/sdk/cosmos/azure-resourcemanager-cosmos/README.md index 5605890a39e0..4a6e8a090072 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/README.md +++ b/sdk/cosmos/azure-resourcemanager-cosmos/README.md @@ -18,7 +18,7 @@ For documentation on how to use this package, please see [Azure Management Libra com.azure.resourcemanager azure-resourcemanager-cosmos - 2.55.0 + 2.56.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/pom.xml b/sdk/cosmos/azure-resourcemanager-cosmos/pom.xml index 49b0d98d2f9f..4a684b1d3b5d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/pom.xml +++ b/sdk/cosmos/azure-resourcemanager-cosmos/pom.xml @@ -43,6 +43,7 @@ --add-opens com.azure.resourcemanager.cosmos/com.azure.resourcemanager.cosmos=ALL-UNNAMED --add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED + true diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraClustersClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraClustersClient.java index eb19eb6ae780..38367ca9b500 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraClustersClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraClustersClient.java @@ -13,9 +13,12 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.BackupResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CassandraClusterPublicStatusInner; import com.azure.resourcemanager.cosmos.fluent.models.ClusterResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CommandOutputInner; +import com.azure.resourcemanager.cosmos.fluent.models.CommandPublicResourceInner; +import com.azure.resourcemanager.cosmos.models.CommandAsyncPostBody; import com.azure.resourcemanager.cosmos.models.CommandPostBody; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; @@ -570,6 +573,317 @@ SyncPoller, CommandOutputInner> beginInvokeComman CommandOutputInner invokeCommand(String resourceGroupName, String clusterName, CommandPostBody body, Context context); + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representing a command along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> invokeCommandAsyncResourceWithResponseAsync(String resourceGroupName, + String clusterName, CommandAsyncPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resource representing a command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, CommandPublicResourceInner> + beginInvokeCommandAsyncResourceAsync(String resourceGroupName, String clusterName, CommandAsyncPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource representing a command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommandPublicResourceInner> + beginInvokeCommandAsyncResource(String resourceGroupName, String clusterName, CommandAsyncPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource representing a command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommandPublicResourceInner> beginInvokeCommandAsyncResource( + String resourceGroupName, String clusterName, CommandAsyncPostBody body, Context context); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representing a command on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono invokeCommandAsyncResourceAsync(String resourceGroupName, String clusterName, + CommandAsyncPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representing a command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommandPublicResourceInner invokeCommandAsyncResource(String resourceGroupName, String clusterName, + CommandAsyncPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @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 representing a command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommandPublicResourceInner invokeCommandAsyncResource(String resourceGroupName, String clusterName, + CommandAsyncPostBody body, Context context); + + /** + * List all commands currently running on ring info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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. + * @return list of commands for cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listCommandAsync(String resourceGroupName, String clusterName); + + /** + * List all commands currently running on ring info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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. + * @return list of commands for cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCommand(String resourceGroupName, String clusterName); + + /** + * List all commands currently running on ring info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @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 commands for cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCommand(String resourceGroupName, String clusterName, + Context context); + + /** + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a specified command that was run asynchronously along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getCommandAsyncResourceWithResponseAsync(String resourceGroupName, + String clusterName, String commandId); + + /** + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a specified command that was run asynchronously on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getCommandAsyncResourceAsync(String resourceGroupName, String clusterName, + String commandId); + + /** + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a specified command that was run asynchronously along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCommandAsyncResourceWithResponse(String resourceGroupName, + String clusterName, String commandId, Context context); + + /** + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a specified command that was run asynchronously. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommandPublicResourceInner getCommandAsyncResource(String resourceGroupName, String clusterName, String commandId); + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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. + * @return list of restorable backups for a Cassandra cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listBackupsAsync(String resourceGroupName, String clusterName); + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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. + * @return list of restorable backups for a Cassandra cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBackups(String resourceGroupName, String clusterName); + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @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 restorable backups for a Cassandra cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBackups(String resourceGroupName, String clusterName, Context context); + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an individual backup of this cluster that is available to restore along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getBackupWithResponseAsync(String resourceGroupName, String clusterName, + String backupId); + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an individual backup of this cluster that is available to restore on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getBackupAsync(String resourceGroupName, String clusterName, String backupId); + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an individual backup of this cluster that is available to restore along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBackupWithResponse(String resourceGroupName, String clusterName, String backupId, + Context context); + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an individual backup of this cluster that is available to restore. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupResourceInner getBackup(String resourceGroupName, String clusterName, String backupId); + /** * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraResourcesClient.java index b9b04cb91e25..7303d617c257 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraResourcesClient.java @@ -17,9 +17,11 @@ import com.azure.resourcemanager.cosmos.fluent.models.CassandraRoleAssignmentResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CassandraRoleDefinitionResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CassandraTableGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraViewGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; import com.azure.resourcemanager.cosmos.models.CassandraKeyspaceCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.CassandraTableCreateUpdateParameters; +import com.azure.resourcemanager.cosmos.models.CassandraViewCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -888,6 +890,443 @@ ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(String ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context); + /** + * Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getCassandraViewThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String viewName); + + /** + * Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getCassandraViewThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @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 RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCassandraViewThroughputWithResponse(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context); + + /** + * Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner getCassandraViewThroughput(String resourceGroupName, String accountName, + String keyspaceName, String viewName); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateCassandraViewThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateCassandraViewThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateCassandraViewThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateCassandraViewThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateCassandraViewThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner updateCassandraViewThroughput(String resourceGroupName, String accountName, + String keyspaceName, String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner updateCassandraViewThroughput(String resourceGroupName, String accountName, + String keyspaceName, String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> migrateCassandraViewToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + String viewName, Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono migrateCassandraViewToAutoscaleAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner migrateCassandraViewToAutoscale(String resourceGroupName, String accountName, + String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner migrateCassandraViewToAutoscale(String resourceGroupName, String accountName, + String keyspaceName, String viewName, Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> migrateCassandraViewToManualThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughputAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName, Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono migrateCassandraViewToManualThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner migrateCassandraViewToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner migrateCassandraViewToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context); + /** * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. * @@ -1577,6 +2016,359 @@ PagedIterable listCassandraTables(String resource PagedIterable listCassandraTables(String resourceGroupName, String accountName, String keyspaceName, Context context); + /** + * Gets the Cassandra view under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the Cassandra view under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Gets the Cassandra view under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the Cassandra view under an existing Azure Cosmos DB database account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getCassandraViewAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName); + + /** + * Gets the Cassandra view under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @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 Cassandra view under an existing Azure Cosmos DB database account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCassandraViewWithResponse(String resourceGroupName, String accountName, + String keyspaceName, String viewName, Context context); + + /** + * Gets the Cassandra view under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the Cassandra view under an existing Azure Cosmos DB database account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CassandraViewGetResultsInner getCassandraView(String resourceGroupName, String accountName, String keyspaceName, + String viewName); + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Cassandra view along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createUpdateCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Cassandra view. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, CassandraViewGetResultsInner> + beginCreateUpdateCassandraViewAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Cassandra view. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CassandraViewGetResultsInner> beginCreateUpdateCassandraView( + String resourceGroupName, String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Cassandra view. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CassandraViewGetResultsInner> beginCreateUpdateCassandraView( + String resourceGroupName, String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, Context context); + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Cassandra view on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createUpdateCassandraViewAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Cassandra view. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CassandraViewGetResultsInner createUpdateCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @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 an Azure Cosmos DB Cassandra view. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CassandraViewGetResultsInner createUpdateCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, + Context context); + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteCassandraViewWithResponseAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteCassandraViewAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName, Context context); + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteCassandraViewAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteCassandraView(String resourceGroupName, String accountName, String keyspaceName, String viewName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteCassandraView(String resourceGroupName, String accountName, String keyspaceName, String viewName, + Context context); + + /** + * Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace 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. + * @return the List operation response, that contains the Cassandra views and their properties as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listCassandraViewsAsync(String resourceGroupName, String accountName, + String keyspaceName); + + /** + * Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace 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. + * @return the List operation response, that contains the Cassandra views and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCassandraViews(String resourceGroupName, String accountName, + String keyspaceName); + + /** + * Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @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 List operation response, that contains the Cassandra views and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCassandraViews(String resourceGroupName, String accountName, + String keyspaceName, Context context); + /** * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ChaosFaultsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ChaosFaultsClient.java new file mode 100644 index 000000000000..288f7a907862 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ChaosFaultsClient.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.ChaosFaultResourceInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ChaosFaultsClient. + */ +public interface ChaosFaultsClient { + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 chaos Fault for a CosmosdB account for a particular Chaos Fault along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String chaosFault); + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 chaos Fault for a CosmosdB account for a particular Chaos Fault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String accountName, String chaosFault); + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @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 chaos Fault for a CosmosdB account for a particular Chaos Fault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String chaosFault, + Context context); + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 chaos Fault for a CosmosdB account for a particular Chaos Fault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ChaosFaultResourceInner get(String resourceGroupName, String accountName, String chaosFault); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 request object to enable/disable the chaos fault along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> enableDisableWithResponseAsync(String resourceGroupName, String accountName, + String chaosFault, ChaosFaultResourceInner chaosFaultRequest); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ChaosFaultResourceInner> beginEnableDisableAsync( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ChaosFaultResourceInner> beginEnableDisable( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ChaosFaultResourceInner> beginEnableDisable( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest, + Context context); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 request object to enable/disable the chaos fault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono enableDisableAsync(String resourceGroupName, String accountName, String chaosFault, + ChaosFaultResourceInner chaosFaultRequest); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ChaosFaultResourceInner enableDisable(String resourceGroupName, String accountName, String chaosFault, + ChaosFaultResourceInner chaosFaultRequest); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @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 a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ChaosFaultResourceInner enableDisable(String resourceGroupName, String accountName, String chaosFault, + ChaosFaultResourceInner chaosFaultRequest, Context context); + + /** + * List Chaos Faults for CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account 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. + * @return chaos Fault List Response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String accountName); + + /** + * List Chaos Faults for CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account 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. + * @return chaos Fault List Response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List Chaos Faults for CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 chaos Fault List Response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CopyJobsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CopyJobsClient.java new file mode 100644 index 000000000000..c75156bd1ddf --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CopyJobsClient.java @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.fluent.models.CopyJobGetResultsInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CopyJobsClient. + */ +public interface CopyJobsClient { + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 a Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String jobName, + Context context); + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CopyJobGetResultsInner get(String resourceGroupName, String accountName, String jobName); + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String jobName, CopyJobGetResultsInner jobCreateParameters); + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String accountName, String jobName, + CopyJobGetResultsInner jobCreateParameters); + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String accountName, String jobName, + CopyJobGetResultsInner jobCreateParameters, Context context); + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CopyJobGetResultsInner create(String resourceGroupName, String accountName, String jobName, + CopyJobGetResultsInner jobCreateParameters); + + /** + * Get a list of Copy jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account 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. + * @return a list of Copy jobs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName); + + /** + * Get a list of Copy jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account 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. + * @return a list of Copy jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName); + + /** + * Get a list of Copy jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 a list of Copy jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, + Context context); + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> pauseWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono pauseAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 a Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response pauseWithResponse(String resourceGroupName, String accountName, String jobName, + Context context); + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CopyJobGetResultsInner pause(String resourceGroupName, String accountName, String jobName); + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> resumeWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono resumeAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 a Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response resumeWithResponse(String resourceGroupName, String accountName, String jobName, + Context context); + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CopyJobGetResultsInner resume(String resourceGroupName, String accountName, String jobName); + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> cancelWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono cancelAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 a Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response cancelWithResponse(String resourceGroupName, String accountName, String jobName, + Context context); + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CopyJobGetResultsInner cancel(String resourceGroupName, String accountName, String jobName); + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> completeWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono completeAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 a Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response completeWithResponse(String resourceGroupName, String accountName, String jobName, + Context context); + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CopyJobGetResultsInner complete(String resourceGroupName, String accountName, String jobName); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CosmosDBManagementClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CosmosDBManagementClient.java index 1243831d876e..76a02cea34ef 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CosmosDBManagementClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CosmosDBManagementClient.java @@ -60,6 +60,20 @@ public interface CosmosDBManagementClient { */ DatabaseAccountsClient getDatabaseAccounts(); + /** + * Gets the CopyJobsClient object to access its operations. + * + * @return the CopyJobsClient object. + */ + CopyJobsClient getCopyJobs(); + + /** + * Gets the GraphResourcesClient object to access its operations. + * + * @return the GraphResourcesClient object. + */ + GraphResourcesClient getGraphResources(); + /** * Gets the SqlResourcesClient object to access its operations. * @@ -95,6 +109,27 @@ public interface CosmosDBManagementClient { */ GremlinResourcesClient getGremlinResources(); + /** + * Gets the DataTransferJobsClient object to access its operations. + * + * @return the DataTransferJobsClient object. + */ + DataTransferJobsClient getDataTransferJobs(); + + /** + * Gets the GarnetClustersClient object to access its operations. + * + * @return the GarnetClustersClient object. + */ + GarnetClustersClient getGarnetClusters(); + + /** + * Gets the NetworkSecurityPerimeterConfigurationsClient object to access its operations. + * + * @return the NetworkSecurityPerimeterConfigurationsClient object. + */ + NetworkSecurityPerimeterConfigurationsClient getNetworkSecurityPerimeterConfigurations(); + /** * Gets the NotebookWorkspacesClient object to access its operations. * @@ -116,6 +151,34 @@ public interface CosmosDBManagementClient { */ PrivateLinkResourcesClient getPrivateLinkResources(); + /** + * Gets the SoftDeletedDatabaseAccountsClient object to access its operations. + * + * @return the SoftDeletedDatabaseAccountsClient object. + */ + SoftDeletedDatabaseAccountsClient getSoftDeletedDatabaseAccounts(); + + /** + * Gets the SoftDeletedSqlDatabasesClient object to access its operations. + * + * @return the SoftDeletedSqlDatabasesClient object. + */ + SoftDeletedSqlDatabasesClient getSoftDeletedSqlDatabases(); + + /** + * Gets the SoftDeletedSqlContainersClient object to access its operations. + * + * @return the SoftDeletedSqlContainersClient object. + */ + SoftDeletedSqlContainersClient getSoftDeletedSqlContainers(); + + /** + * Gets the ChaosFaultsClient object to access its operations. + * + * @return the ChaosFaultsClient object. + */ + ChaosFaultsClient getChaosFaults(); + /** * Gets the DatabasesClient object to access its operations. * @@ -305,6 +368,34 @@ public interface CosmosDBManagementClient { */ ServicesClient getServices(); + /** + * Gets the ThroughputPoolsClient object to access its operations. + * + * @return the ThroughputPoolsClient object. + */ + ThroughputPoolsClient getThroughputPools(); + + /** + * Gets the ThroughputPoolsOperationsClient object to access its operations. + * + * @return the ThroughputPoolsOperationsClient object. + */ + ThroughputPoolsOperationsClient getThroughputPoolsOperations(); + + /** + * Gets the ThroughputPoolAccountsClient object to access its operations. + * + * @return the ThroughputPoolAccountsClient object. + */ + ThroughputPoolAccountsClient getThroughputPoolAccounts(); + + /** + * Gets the ThroughputPoolAccountsOperationsClient object to access its operations. + * + * @return the ThroughputPoolAccountsOperationsClient object. + */ + ThroughputPoolAccountsOperationsClient getThroughputPoolAccountsOperations(); + /** * Gets the MongoMIResourcesClient object to access its operations. * @@ -319,6 +410,13 @@ public interface CosmosDBManagementClient { */ FleetsClient getFleets(); + /** + * Gets the FleetAnalyticsClient object to access its operations. + * + * @return the FleetAnalyticsClient object. + */ + FleetAnalyticsClient getFleetAnalytics(); + /** * Gets the FleetspacesClient object to access its operations. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DataTransferJobsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DataTransferJobsClient.java new file mode 100644 index 000000000000..611d044b6ef6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DataTransferJobsClient.java @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.fluent.models.DataTransferJobGetResultsInner; +import com.azure.resourcemanager.cosmos.models.CreateJobRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DataTransferJobsClient. + */ +public interface DataTransferJobsClient { + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 a Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String jobName, Context context); + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTransferJobGetResultsInner get(String resourceGroupName, String accountName, String jobName); + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String jobName, CreateJobRequest jobCreateParameters); + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String accountName, String jobName, + CreateJobRequest jobCreateParameters); + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String accountName, + String jobName, CreateJobRequest jobCreateParameters, Context context); + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTransferJobGetResultsInner create(String resourceGroupName, String accountName, String jobName, + CreateJobRequest jobCreateParameters); + + /** + * Get a list of Data Transfer jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account 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. + * @return a list of Data Transfer jobs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName); + + /** + * Get a list of Data Transfer jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account 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. + * @return a list of Data Transfer jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName); + + /** + * Get a list of Data Transfer jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 a list of Data Transfer jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, + Context context); + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> pauseWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono pauseAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 a Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response pauseWithResponse(String resourceGroupName, String accountName, + String jobName, Context context); + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTransferJobGetResultsInner pause(String resourceGroupName, String accountName, String jobName); + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> resumeWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono resumeAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 a Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response resumeWithResponse(String resourceGroupName, String accountName, + String jobName, Context context); + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTransferJobGetResultsInner resume(String resourceGroupName, String accountName, String jobName); + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> cancelWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono cancelAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 a Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response cancelWithResponse(String resourceGroupName, String accountName, + String jobName, Context context); + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTransferJobGetResultsInner cancel(String resourceGroupName, String accountName, String jobName); + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> completeWithResponseAsync(String resourceGroupName, + String accountName, String jobName); + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono completeAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 a Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response completeWithResponse(String resourceGroupName, String accountName, + String jobName, Context context); + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTransferJobGetResultsInner complete(String resourceGroupName, String accountName, String jobName); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetAnalyticsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetAnalyticsClient.java new file mode 100644 index 000000000000..04788f625d0d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetAnalyticsClient.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.FleetAnalyticsResourceInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FleetAnalyticsClient. + */ +public interface FleetAnalyticsClient { + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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. + * @return an Azure Cosmos DB FleetAnalytics along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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. + * @return an Azure Cosmos DB FleetAnalytics on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String fleetName, String fleetAnalyticsName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @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 an Azure Cosmos DB FleetAnalytics along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String fleetName, + String fleetAnalyticsName, Context context); + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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. + * @return an Azure Cosmos DB FleetAnalytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetAnalyticsResourceInner get(String resourceGroupName, String fleetName, String fleetAnalyticsName); + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB FleetAnalytics along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName, FleetAnalyticsResourceInner body); + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB FleetAnalytics on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String fleetName, String fleetAnalyticsName, + FleetAnalyticsResourceInner body); + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @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 an Azure Cosmos DB FleetAnalytics along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String fleetName, + String fleetAnalyticsName, FleetAnalyticsResourceInner body, Context context); + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB FleetAnalytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetAnalyticsResourceInner create(String resourceGroupName, String fleetName, String fleetAnalyticsName, + FleetAnalyticsResourceInner body); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName, + String fleetAnalyticsName); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName, + String fleetAnalyticsName, Context context); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String fleetName, String fleetAnalyticsName); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String fleetName, String fleetAnalyticsName); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String fleetName, String fleetAnalyticsName, Context context); + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetAnalyticsResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String fleetName); + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetAnalyticsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String fleetName); + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetAnalyticsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String fleetName, Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GarnetClustersClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GarnetClustersClient.java new file mode 100644 index 000000000000..dc7dda1d54d3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GarnetClustersClient.java @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.GarnetClusterResourceInner; +import com.azure.resourcemanager.cosmos.models.GarnetClusterResourcePatch; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GarnetClustersClient. + */ +public interface GarnetClustersClient extends InnerSupportsGet, + InnerSupportsListing, InnerSupportsDelete { + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName); + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByResourceGroupAsync(String resourceGroupName, String clusterName); + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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 properties of a Garnet cache cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context); + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GarnetClusterResourceInner getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representation of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, GarnetClusterResourceInner> + beginCreateUpdateAsync(String resourceGroupName, String clusterName, GarnetClusterResourceInner body); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GarnetClusterResourceInner> + beginCreateUpdate(String resourceGroupName, String clusterName, GarnetClusterResourceInner body); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GarnetClusterResourceInner> beginCreateUpdate( + String resourceGroupName, String clusterName, GarnetClusterResourceInner body, Context context); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representation of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createUpdateAsync(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GarnetClusterResourceInner createUpdate(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GarnetClusterResourceInner createUpdate(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body, Context context); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representation of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, GarnetClusterResourceInner> + beginUpdateAsync(String resourceGroupName, String clusterName, GarnetClusterResourcePatch body); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GarnetClusterResourceInner> beginUpdate(String resourceGroupName, + String clusterName, GarnetClusterResourcePatch body); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GarnetClusterResourceInner> beginUpdate(String resourceGroupName, + String clusterName, GarnetClusterResourcePatch body, Context context); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representation of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GarnetClusterResourceInner update(String resourceGroupName, String clusterName, GarnetClusterResourcePatch body); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GarnetClusterResourceInner update(String resourceGroupName, String clusterName, GarnetClusterResourcePatch body, + Context context); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String clusterName); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all Garnet clusters in this 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. + * @throws com.azure.core.management.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 Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List all Garnet clusters in this 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 Garnet clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * List all Garnet clusters in this 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 Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all Garnet clusters in this 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 list of Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GraphResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GraphResourcesClient.java new file mode 100644 index 000000000000..c603299fa374 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GraphResourcesClient.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.GraphResourceGetResultsInner; +import com.azure.resourcemanager.cosmos.models.GraphResourceCreateUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GraphResourcesClient. + */ +public interface GraphResourcesClient { + /** + * Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Graph resource under an existing Azure Cosmos DB database account with the provided name along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getGraphWithResponseAsync(String resourceGroupName, String accountName, + String graphName); + + /** + * Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Graph resource under an existing Azure Cosmos DB database account with the provided name on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getGraphAsync(String resourceGroupName, String accountName, String graphName); + + /** + * Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @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 Graph resource under an existing Azure Cosmos DB database account with the provided name along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getGraphWithResponse(String resourceGroupName, String accountName, + String graphName, Context context); + + /** + * Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Graph resource under an existing Azure Cosmos DB database account with the provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GraphResourceGetResultsInner getGraph(String resourceGroupName, String accountName, String graphName); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Graph resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createUpdateGraphWithResponseAsync(String resourceGroupName, String accountName, + String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, GraphResourceGetResultsInner> beginCreateUpdateGraphAsync( + String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GraphResourceGetResultsInner> beginCreateUpdateGraph( + String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GraphResourceGetResultsInner> beginCreateUpdateGraph( + String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters, Context context); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Graph resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createUpdateGraphAsync(String resourceGroupName, String accountName, + String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Graph resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GraphResourceGetResultsInner createUpdateGraph(String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 an Azure Cosmos DB Graph resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GraphResourceGetResultsInner createUpdateGraph(String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters, Context context); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph 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. + * @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>> deleteGraphResourceWithResponseAsync(String resourceGroupName, String accountName, + String graphName); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteGraphResourceAsync(String resourceGroupName, String accountName, + String graphName); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteGraphResource(String resourceGroupName, String accountName, + String graphName); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteGraphResource(String resourceGroupName, String accountName, + String graphName, Context context); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph 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. + * @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 deleteGraphResourceAsync(String resourceGroupName, String accountName, String graphName); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteGraphResource(String resourceGroupName, String accountName, String graphName); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteGraphResource(String resourceGroupName, String accountName, String graphName, Context context); + + /** + * Lists the graphs under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account 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. + * @return the List operation response, that contains the Graph resource and their properties as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listGraphsAsync(String resourceGroupName, String accountName); + + /** + * Lists the graphs under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account 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. + * @return the List operation response, that contains the Graph resource and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGraphs(String resourceGroupName, String accountName); + + /** + * Lists the graphs under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 List operation response, that contains the Graph resource and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGraphs(String resourceGroupName, String accountName, + Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java index ab470784aae2..4d59793f7c1f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java @@ -18,12 +18,17 @@ import com.azure.resourcemanager.cosmos.fluent.models.MongoDBDatabaseGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.MongoRoleDefinitionGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.MongoUserDefinitionGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionStorageInfoCollectionInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionThroughputInfoResultInner; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation; +import com.azure.resourcemanager.cosmos.models.MergeParameters; import com.azure.resourcemanager.cosmos.models.MongoDBCollectionCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.MongoDBDatabaseCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.MongoRoleDefinitionCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.MongoUserDefinitionCreateUpdateParameters; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -447,6 +452,261 @@ ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughput(Strin ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName, Context context); + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> mongoDBDatabaseRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, Context context); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono mongoDBDatabaseRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> mongoDBDatabaseRedistributeThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughputAsync(String resourceGroupName, String accountName, + String databaseName, RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono mongoDBDatabaseRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters, + Context context); + /** * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the * provided name. @@ -655,6 +915,280 @@ ThroughputSettingsGetResultsInner updateMongoDBCollectionThroughput(String resou String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> mongoDBContainerRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono mongoDBContainerRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBContainerRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBContainerRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> mongoDBContainerRedistributeThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, RedistributeThroughputParameters redistributeThroughputParameters, Context context); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono mongoDBContainerRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context); + /** * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. * @@ -1220,6 +1754,128 @@ SyncPoller, Void> beginDeleteMongoDBDatabase(String resourceGro PagedIterable listMongoDBDatabases(String resourceGroupName, String accountName, Context context); + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> mongoDBDatabasePartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters); + + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters); + + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters, Context context); + + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono mongoDBDatabasePartitionMergeAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner mongoDBDatabasePartitionMerge(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner mongoDBDatabasePartitionMerge(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters, Context context); + /** * Gets the MongoDB collection under an existing Azure Cosmos DB database account. * @@ -1578,6 +2234,136 @@ PagedIterable listMongoDBCollections(String re PagedIterable listMongoDBCollections(String resourceGroupName, String accountName, String databaseName, Context context); + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> listMongoDBCollectionPartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters, Context context); + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listMongoDBCollectionPartitionMergeAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner listMongoDBCollectionPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String collectionName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner listMongoDBCollectionPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String collectionName, MergeParameters mergeParameters, + Context context); + /** * Retrieves continuous backup information for a Mongodb collection. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/NetworkSecurityPerimeterConfigurationsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/NetworkSecurityPerimeterConfigurationsClient.java new file mode 100644 index 000000000000..75aa08a90abe --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/NetworkSecurityPerimeterConfigurationsClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * NetworkSecurityPerimeterConfigurationsClient. + */ +public interface NetworkSecurityPerimeterConfigurationsClient { + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 effective Network Security Perimeter Configuration for association along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String networkSecurityPerimeterConfigurationName); + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 effective Network Security Perimeter Configuration for association on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 effective Network Security Perimeter Configuration for association along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 effective Network Security Perimeter Configuration for association. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account 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. + * @return list of effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String accountName); + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account 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. + * @return list of effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + Context context); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> reconcileWithResponseAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginReconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono reconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reconcile(String resourceGroupName, String accountName, String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reconcile(String resourceGroupName, String accountName, String networkSecurityPerimeterConfigurationName, + Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedDatabaseAccountsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedDatabaseAccountsClient.java new file mode 100644 index 000000000000..a96867c2863d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedDatabaseAccountsClient.java @@ -0,0 +1,481 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedDatabaseAccountGetResultInner; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedDatabaseAccountsListResultInner; +import com.azure.resourcemanager.cosmos.models.SoftDeleteActionKind; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SoftDeletedDatabaseAccountsClient. + */ +public interface SoftDeletedDatabaseAccountsClient { + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB database account by location and accountName. This + * call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + * @return a Azure Cosmos DB soft-deleted database account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String location, String accountName); + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB database account by location and accountName. This + * call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + * @return a Azure Cosmos DB soft-deleted database account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String location, + String accountName); + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB database account by location and accountName. This + * call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @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 a Azure Cosmos DB soft-deleted database account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String location, + String accountName, Context context); + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB database account by location and accountName. This + * call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + * @return a Azure Cosmos DB soft-deleted database account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SoftDeletedDatabaseAccountGetResultInner get(String resourceGroupName, String location, String accountName); + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the subscription and in a region. + * This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 List operation response, that contains the soft-deleted database accounts and their properties along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> listByLocationWithResponseAsync(String location); + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the subscription and in a region. + * This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 List operation response, that contains the soft-deleted database accounts and their properties on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listByLocationAsync(String location); + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the subscription and in a region. + * This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param location The name of the Azure region. + * @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 List operation response, that contains the soft-deleted database accounts and their properties along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByLocationWithResponse(String location, Context context); + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the subscription and in a region. + * This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 List operation response, that contains the soft-deleted database accounts and their properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SoftDeletedDatabaseAccountsListResultInner listByLocation(String location); + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the given resource group and in a + * region. This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 List operation response, that contains the soft-deleted database accounts and their properties along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> + listByResourceGroupAndLocationWithResponseAsync(String resourceGroupName, String location); + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the given resource group and in a + * region. This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 List operation response, that contains the soft-deleted database accounts and their properties on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listByResourceGroupAndLocationAsync(String resourceGroupName, + String location); + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the given resource group and in a + * region. This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @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 List operation response, that contains the soft-deleted database accounts and their properties along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response + listByResourceGroupAndLocationWithResponse(String resourceGroupName, String location, Context context); + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the given resource group and in a + * region. This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 List operation response, that contains the soft-deleted database accounts and their properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SoftDeletedDatabaseAccountsListResultInner listByResourceGroupAndLocation(String resourceGroupName, + String location); + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> restoreWithResponseAsync(String resourceGroupName, String location, + String accountName, SoftDeleteActionKind softDeleteActionKind); + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind); + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, String accountName); + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestore(String resourceGroupName, String location, String accountName); + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestore(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind, Context context); + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono restoreAsync(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind); + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono restoreAsync(String resourceGroupName, String location, String accountName); + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restore(String resourceGroupName, String location, String accountName); + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restore(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind, Context context); + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> purgeWithResponseAsync(String resourceGroupName, String location, + String accountName, SoftDeleteActionKind softDeleteActionKind); + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind); + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, String accountName); + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurge(String resourceGroupName, String location, String accountName); + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurge(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind, Context context); + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono purgeAsync(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind); + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono purgeAsync(String resourceGroupName, String location, String accountName); + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purge(String resourceGroupName, String location, String accountName); + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purge(String resourceGroupName, String location, String accountName, SoftDeleteActionKind softDeleteActionKind, + Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedSqlContainersClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedSqlContainersClient.java new file mode 100644 index 000000000000..99d3b278a237 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedSqlContainersClient.java @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedSqlContainerGetResultInner; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedSqlContainersListResultInner; +import com.azure.resourcemanager.cosmos.models.SoftDeleteActionKind; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SoftDeletedSqlContainersClient. + */ +public interface SoftDeletedSqlContainersClient { + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL container. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container 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. + * @return an Azure Cosmos DB soft-deleted SQL container along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String location, String accountName, String databaseName, String containerName); + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL container. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container 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. + * @return an Azure Cosmos DB soft-deleted SQL container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String location, String accountName, + String databaseName, String containerName); + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL container. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @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 an Azure Cosmos DB soft-deleted SQL container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, Context context); + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL container. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container 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. + * @return an Azure Cosmos DB soft-deleted SQL container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SoftDeletedSqlContainerGetResultInner get(String resourceGroupName, String location, String accountName, + String databaseName, String containerName); + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL containers under a soft-deleted SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + * @return the List operation response, that contains the soft-deleted SQL containers and their properties along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> listWithResponseAsync(String resourceGroupName, + String location, String accountName, String databaseName); + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL containers under a soft-deleted SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + * @return the List operation response, that contains the soft-deleted SQL containers and their properties on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listAsync(String resourceGroupName, String location, + String accountName, String databaseName); + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL containers under a soft-deleted SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @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 List operation response, that contains the soft-deleted SQL containers and their properties along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String location, + String accountName, String databaseName, Context context); + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL containers under a soft-deleted SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + * @return the List operation response, that contains the soft-deleted SQL containers and their properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SoftDeletedSqlContainersListResultInner list(String resourceGroupName, String location, String accountName, + String databaseName); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> restoreWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, String accountName, + String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container 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. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, String accountName, + String databaseName, String containerName); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container 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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestore(String resourceGroupName, String location, String accountName, + String databaseName, String containerName); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestore(String resourceGroupName, String location, String accountName, + String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind, Context context); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono restoreAsync(String resourceGroupName, String location, String accountName, String databaseName, + String containerName, SoftDeleteActionKind softDeleteActionKind); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container 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. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono restoreAsync(String resourceGroupName, String location, String accountName, String databaseName, + String containerName); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restore(String resourceGroupName, String location, String accountName, String databaseName, + String containerName); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restore(String resourceGroupName, String location, String accountName, String databaseName, + String containerName, SoftDeleteActionKind softDeleteActionKind, Context context); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> purgeWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, String accountName, + String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container 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. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, String accountName, + String databaseName, String containerName); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container 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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurge(String resourceGroupName, String location, String accountName, + String databaseName, String containerName); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurge(String resourceGroupName, String location, String accountName, + String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind, Context context); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono purgeAsync(String resourceGroupName, String location, String accountName, String databaseName, + String containerName, SoftDeleteActionKind softDeleteActionKind); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container 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. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono purgeAsync(String resourceGroupName, String location, String accountName, String databaseName, + String containerName); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purge(String resourceGroupName, String location, String accountName, String databaseName, + String containerName); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purge(String resourceGroupName, String location, String accountName, String databaseName, String containerName, + SoftDeleteActionKind softDeleteActionKind, Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedSqlDatabasesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedSqlDatabasesClient.java new file mode 100644 index 000000000000..56915965c20f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedSqlDatabasesClient.java @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedSqlDatabaseGetResultInner; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedSqlDatabasesListResultInner; +import com.azure.resourcemanager.cosmos.models.SoftDeleteActionKind; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SoftDeletedSqlDatabasesClient. + */ +public interface SoftDeletedSqlDatabasesClient { + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + * @return an Azure Cosmos DB soft-deleted SQL database along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName); + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + * @return an Azure Cosmos DB soft-deleted SQL database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String location, String accountName, + String databaseName); + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @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 an Azure Cosmos DB soft-deleted SQL database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String location, + String accountName, String databaseName, Context context); + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + * @return an Azure Cosmos DB soft-deleted SQL database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SoftDeletedSqlDatabaseGetResultInner get(String resourceGroupName, String location, String accountName, + String databaseName); + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL databases under a soft-deleted database account. This call + * requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + * @return the List operation response, that contains the soft-deleted SQL databases and their properties along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> listWithResponseAsync(String resourceGroupName, + String location, String accountName); + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL databases under a soft-deleted database account. This call + * requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + * @return the List operation response, that contains the soft-deleted SQL databases and their properties on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listAsync(String resourceGroupName, String location, + String accountName); + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL databases under a soft-deleted database account. This call + * requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @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 List operation response, that contains the soft-deleted SQL databases and their properties along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String location, + String accountName, Context context); + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL databases under a soft-deleted database account. This call + * requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account 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. + * @return the List operation response, that contains the soft-deleted SQL databases and their properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SoftDeletedSqlDatabasesListResultInner list(String resourceGroupName, String location, String accountName); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> restoreWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName, SoftDeleteActionKind softDeleteActionKind); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, String accountName, + String databaseName, SoftDeleteActionKind softDeleteActionKind); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, String accountName, + String databaseName); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestore(String resourceGroupName, String location, String accountName, + String databaseName); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestore(String resourceGroupName, String location, String accountName, + String databaseName, SoftDeleteActionKind softDeleteActionKind, Context context); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono restoreAsync(String resourceGroupName, String location, String accountName, String databaseName, + SoftDeleteActionKind softDeleteActionKind); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono restoreAsync(String resourceGroupName, String location, String accountName, String databaseName); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restore(String resourceGroupName, String location, String accountName, String databaseName); + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restore(String resourceGroupName, String location, String accountName, String databaseName, + SoftDeleteActionKind softDeleteActionKind, Context context); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> purgeWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName, SoftDeleteActionKind softDeleteActionKind); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, String accountName, + String databaseName, SoftDeleteActionKind softDeleteActionKind); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, String accountName, + String databaseName); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurge(String resourceGroupName, String location, String accountName, + String databaseName); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurge(String resourceGroupName, String location, String accountName, + String databaseName, SoftDeleteActionKind softDeleteActionKind, Context context); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono purgeAsync(String resourceGroupName, String location, String accountName, String databaseName, + SoftDeleteActionKind softDeleteActionKind); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono purgeAsync(String resourceGroupName, String location, String accountName, String databaseName); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purge(String resourceGroupName, String location, String accountName, String databaseName); + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purge(String resourceGroupName, String location, String accountName, String databaseName, + SoftDeleteActionKind softDeleteActionKind, Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SqlResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SqlResourcesClient.java index 1dc2d9d43f9c..964ae34be985 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SqlResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SqlResourcesClient.java @@ -15,6 +15,8 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.models.BackupInformationInner; import com.azure.resourcemanager.cosmos.fluent.models.ClientEncryptionKeyGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionStorageInfoCollectionInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionThroughputInfoResultInner; import com.azure.resourcemanager.cosmos.fluent.models.SqlContainerGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.SqlDatabaseGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.SqlRoleAssignmentGetResultsInner; @@ -25,6 +27,9 @@ import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; import com.azure.resourcemanager.cosmos.models.ClientEncryptionKeyCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation; +import com.azure.resourcemanager.cosmos.models.MergeParameters; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; import com.azure.resourcemanager.cosmos.models.SqlContainerCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.SqlDatabaseCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.SqlRoleAssignmentCreateUpdateParameters; @@ -367,6 +372,128 @@ SyncPoller, Void> beginDeleteSqlDatabase(String resourceGroupNa PagedIterable listSqlDatabases(String resourceGroupName, String accountName, Context context); + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> sqlDatabasePartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters); + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters); + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters, Context context); + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono sqlDatabasePartitionMergeAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner sqlDatabasePartitionMerge(String resourceGroupName, String accountName, + String databaseName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner sqlDatabasePartitionMerge(String resourceGroupName, String accountName, + String databaseName, MergeParameters mergeParameters, Context context); + /** * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided * name. @@ -773,6 +900,260 @@ ThroughputSettingsGetResultsInner migrateSqlDatabaseToManualThroughput(String re ThroughputSettingsGetResultsInner migrateSqlDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName, Context context); + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> sqlDatabaseRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, Context context); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono sqlDatabaseRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner sqlDatabaseRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner sqlDatabaseRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context); + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> sqlDatabaseRedistributeThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughputAsync(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context); + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono sqlDatabaseRedistributeThroughputAsync(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner sqlDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner sqlDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters, + Context context); + /** * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. * @@ -783,15 +1164,263 @@ ThroughputSettingsGetResultsInner migrateSqlDatabaseToManualThroughput(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 RUs per second of the SQL container under an existing Azure Cosmos DB database account along with - * {@link Response} on successful completion of {@link Mono}. + * @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getSqlContainerThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName); + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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. + * @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getSqlContainerThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String containerName); + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @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 RUs per second of the SQL container under an existing Azure Cosmos DB database account along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSqlContainerThroughputWithResponse(String resourceGroupName, + String accountName, String databaseName, String containerName, Context context); + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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. + * @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner getSqlContainerThroughput(String resourceGroupName, String accountName, + String databaseName, String containerName); + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateSqlContainerThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateSqlContainerThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner updateSqlContainerThroughput(String resourceGroupName, String accountName, + String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner updateSqlContainerThroughput(String resourceGroupName, String accountName, + String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context); + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> migrateSqlContainerToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName); + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, + String containerName); + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateSqlContainerToAutoscale(String resourceGroupName, String accountName, String databaseName, + String containerName); + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSqlContainerThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String containerName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateSqlContainerToAutoscale(String resourceGroupName, String accountName, String databaseName, + String containerName, Context context); /** - * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -800,55 +1429,52 @@ Mono> getSqlContainerThroughputWithR * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 RUs per second of the SQL container under an existing Azure Cosmos DB database account on successful - * completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSqlContainerThroughputAsync(String resourceGroupName, String accountName, - String databaseName, String containerName); + Mono migrateSqlContainerToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName, String containerName); /** - * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @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 RUs per second of the SQL container under an existing Azure Cosmos DB database account along with - * {@link Response}. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getSqlContainerThroughputWithResponse(String resourceGroupName, - String accountName, String databaseName, String containerName, Context context); + ThroughputSettingsGetResultsInner migrateSqlContainerToAutoscale(String resourceGroupName, String accountName, + String databaseName, String containerName); /** - * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @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 RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner getSqlContainerThroughput(String resourceGroupName, String accountName, - String databaseName, String containerName); + ThroughputSettingsGetResultsInner migrateSqlContainerToAutoscale(String resourceGroupName, String accountName, + String databaseName, String containerName, Context context); /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -856,18 +1482,16 @@ ThroughputSettingsGetResultsInner getSqlContainerThroughput(String resourceGroup * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateSqlContainerThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + Mono>> migrateSqlContainerToManualThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName); /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -875,17 +1499,16 @@ Mono>> updateSqlContainerThroughputWithResponseAsync(S */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, - String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters); + beginMigrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String containerName); /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -893,17 +1516,16 @@ Mono>> updateSqlContainerThroughputWithResponseAsync(S */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, - String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters); + beginMigrateSqlContainerToManualThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName); /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @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. @@ -912,52 +1534,48 @@ Mono>> updateSqlContainerThroughputWithResponseAsync(S */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, - String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + beginMigrateSqlContainerToManualThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, Context context); /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateSqlContainerThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + Mono migrateSqlContainerToManualThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String containerName); /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner updateSqlContainerThroughput(String resourceGroupName, String accountName, - String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters); + ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(String resourceGroupName, + String accountName, String databaseName, String containerName); /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @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. @@ -965,245 +1583,281 @@ ThroughputSettingsGetResultsInner updateSqlContainerThroughput(String resourceGr * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner updateSqlContainerThroughput(String resourceGroupName, String accountName, - String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, - Context context); + ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(String resourceGroupName, + String accountName, String databaseName, String containerName, Context context); /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateSqlContainerToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String containerName); + Mono>> sqlContainerRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters); /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, - String containerName); + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters); /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToAutoscale(String resourceGroupName, String accountName, String databaseName, - String containerName); + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters); /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToAutoscale(String resourceGroupName, String accountName, String databaseName, - String containerName, Context context); + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context); /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateSqlContainerToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName, String containerName); + Mono sqlContainerRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters); /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateSqlContainerToAutoscale(String resourceGroupName, String accountName, - String databaseName, String containerName); + PhysicalPartitionThroughputInfoResultInner sqlContainerRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters); /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @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 an Azure Cosmos DB resource throughput. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateSqlContainerToAutoscale(String resourceGroupName, String accountName, - String databaseName, String containerName, Context context); + PhysicalPartitionThroughputInfoResultInner sqlContainerRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context); /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateSqlContainerToManualThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String containerName); + Mono>> sqlContainerRedistributeThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters); /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName, String containerName); + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters); /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToManualThroughput(String resourceGroupName, String accountName, String databaseName, - String containerName); + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters); /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToManualThroughput(String resourceGroupName, String accountName, String databaseName, - String containerName, Context context); + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters, Context context); /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateSqlContainerToManualThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String containerName); + Mono sqlContainerRedistributeThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters); /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 an Azure Cosmos DB resource throughput. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(String resourceGroupName, - String accountName, String databaseName, String containerName); + PhysicalPartitionThroughputInfoResultInner sqlContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters); /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @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 an Azure Cosmos DB resource throughput. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(String resourceGroupName, - String accountName, String databaseName, String containerName, Context context); + PhysicalPartitionThroughputInfoResultInner sqlContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context); /** * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. @@ -1814,6 +2468,136 @@ PagedIterable listSqlContainers(String resourceGrou PagedIterable listSqlContainers(String resourceGroupName, String accountName, String databaseName, Context context); + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> listSqlContainerPartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters, Context context); + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listSqlContainerPartitionMergeAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner listSqlContainerPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner listSqlContainerPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters, + Context context); + /** * Retrieves continuous backup information for a container resource. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsClient.java new file mode 100644 index 000000000000..993c1993d89b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsClient.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolAccountResourceInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolAccountsClient. + */ +public interface ThroughputPoolAccountsClient { + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 an Azure Cosmos DB Throughputpool Account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String throughputPoolName, String throughputPoolAccountName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 an Azure Cosmos DB Throughputpool Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, Context context); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolAccountResourceInner get(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Throughputpool Account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createWithResponseAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputPoolAccountResourceInner> beginCreateAsync( + String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputPoolAccountResourceInner> beginCreate( + String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputPoolAccountResourceInner> beginCreate( + String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body, Context context); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Throughputpool Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolAccountResourceInner create(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolAccountResourceInner create(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body, Context context); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, Context context); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsOperationsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsOperationsClient.java new file mode 100644 index 000000000000..d4c007e372b1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsOperationsClient.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.util.Context; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolAccountResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolAccountsOperationsClient. + */ +public interface ThroughputPoolAccountsOperationsClient { + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return the response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String throughputPoolName); + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return the response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String throughputPoolName); + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @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 response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String throughputPoolName, + Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsClient.java new file mode 100644 index 000000000000..c5a632c582cb --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsClient.java @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolResourceInner; +import com.azure.resourcemanager.cosmos.models.ThroughputPoolUpdate; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolsClient. + */ +public interface ThroughputPoolsClient + extends InnerSupportsGet, InnerSupportsDelete { + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return an Azure Cosmos DB Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String throughputPoolName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return an Azure Cosmos DB Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByResourceGroupAsync(String resourceGroupName, String throughputPoolName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @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 an Azure Cosmos DB Throughputpool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String throughputPoolName, Context context); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolResourceInner getByResourceGroup(String resourceGroupName, String throughputPoolName); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String throughputPoolName, ThroughputPoolResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputPoolResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputPoolResourceInner> + beginCreateOrUpdate(String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputPoolResourceInner> beginCreateOrUpdate( + String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body, Context context); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolResourceInner createOrUpdate(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolResourceInner createOrUpdate(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body, Context context); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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 an Azure Cosmos DB Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolUpdate body); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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 an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputPoolResourceInner> + beginUpdateAsync(String resourceGroupName, String throughputPoolName, ThroughputPoolUpdate body); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputPoolResourceInner> + beginUpdateAsync(String resourceGroupName, String throughputPoolName); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputPoolResourceInner> + beginUpdate(String resourceGroupName, String throughputPoolName); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputPoolResourceInner> + beginUpdate(String resourceGroupName, String throughputPoolName, ThroughputPoolUpdate body, Context context); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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 an Azure Cosmos DB Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolUpdate body); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return an Azure Cosmos DB Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String throughputPoolName); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolResourceInner update(String resourceGroupName, String throughputPoolName); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolResourceInner update(String resourceGroupName, String throughputPoolName, ThroughputPoolUpdate body, + Context context); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String throughputPoolName); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String throughputPoolName); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String throughputPoolName); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String throughputPoolName, + Context context); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String throughputPoolName); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String throughputPoolName); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String throughputPoolName, Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsOperationsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsOperationsClient.java new file mode 100644 index 000000000000..e54bd7e98a63 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsOperationsClient.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.util.Context; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolResourceInner; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolsOperationsClient. + */ +public interface ThroughputPoolsOperationsClient extends InnerSupportsListing { + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the ThroughputPools in a given 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under 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 the response of a ThroughputPoolResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under 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 the response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under 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 the response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupResourceInner.java new file mode 100644 index 000000000000..f0bef0e75abb --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupResourceInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +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.cosmos.models.BackupState; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * A restorable backup of a Cassandra cluster. + */ +@Immutable +public final class BackupResourceInner implements JsonSerializable { + /* + * The unique identifier of backup. + */ + private String backupId; + + /* + * The current state of the backup. + */ + private BackupState backupState; + + /* + * The time at which the backup process begins. + */ + private OffsetDateTime backupStartTimestamp; + + /* + * The time at which the backup process ends. + */ + private OffsetDateTime backupStopTimestamp; + + /* + * The time at which the backup will expire. + */ + private OffsetDateTime backupExpiryTimestamp; + + /** + * Creates an instance of BackupResourceInner class. + */ + private BackupResourceInner() { + } + + /** + * Get the backupId property: The unique identifier of backup. + * + * @return the backupId value. + */ + public String backupId() { + return this.backupId; + } + + /** + * Get the backupState property: The current state of the backup. + * + * @return the backupState value. + */ + public BackupState backupState() { + return this.backupState; + } + + /** + * Get the backupStartTimestamp property: The time at which the backup process begins. + * + * @return the backupStartTimestamp value. + */ + public OffsetDateTime backupStartTimestamp() { + return this.backupStartTimestamp; + } + + /** + * Get the backupStopTimestamp property: The time at which the backup process ends. + * + * @return the backupStopTimestamp value. + */ + public OffsetDateTime backupStopTimestamp() { + return this.backupStopTimestamp; + } + + /** + * Get the backupExpiryTimestamp property: The time at which the backup will expire. + * + * @return the backupExpiryTimestamp value. + */ + public OffsetDateTime backupExpiryTimestamp() { + return this.backupExpiryTimestamp; + } + + /** + * 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("backupId", this.backupId); + jsonWriter.writeStringField("backupState", this.backupState == null ? null : this.backupState.toString()); + jsonWriter.writeStringField("backupStartTimestamp", + this.backupStartTimestamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.backupStartTimestamp)); + jsonWriter.writeStringField("backupStopTimestamp", + this.backupStopTimestamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.backupStopTimestamp)); + jsonWriter.writeStringField("backupExpiryTimestamp", + this.backupExpiryTimestamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.backupExpiryTimestamp)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupResourceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BackupResourceInner. + */ + public static BackupResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupResourceInner deserializedBackupResourceInner = new BackupResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupId".equals(fieldName)) { + deserializedBackupResourceInner.backupId = reader.getString(); + } else if ("backupState".equals(fieldName)) { + deserializedBackupResourceInner.backupState = BackupState.fromString(reader.getString()); + } else if ("backupStartTimestamp".equals(fieldName)) { + deserializedBackupResourceInner.backupStartTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("backupStopTimestamp".equals(fieldName)) { + deserializedBackupResourceInner.backupStopTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("backupExpiryTimestamp".equals(fieldName)) { + deserializedBackupResourceInner.backupExpiryTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewCreateUpdateProperties.java new file mode 100644 index 000000000000..a1cbdc91afe9 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewCreateUpdateProperties.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.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.cosmos.models.CassandraViewResource; +import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; +import java.io.IOException; + +/** + * Properties to create and update Azure Cosmos DB Cassandra view. + */ +@Fluent +public final class CassandraViewCreateUpdateProperties + implements JsonSerializable { + /* + * The standard JSON format of a Cassandra view + */ + private CassandraViewResource resource; + + /* + * A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + */ + private CreateUpdateOptions options; + + /** + * Creates an instance of CassandraViewCreateUpdateProperties class. + */ + public CassandraViewCreateUpdateProperties() { + } + + /** + * Get the resource property: The standard JSON format of a Cassandra view. + * + * @return the resource value. + */ + public CassandraViewResource resource() { + return this.resource; + } + + /** + * Set the resource property: The standard JSON format of a Cassandra view. + * + * @param resource the resource value to set. + * @return the CassandraViewCreateUpdateProperties object itself. + */ + public CassandraViewCreateUpdateProperties withResource(CassandraViewResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @return the options value. + */ + public CreateUpdateOptions options() { + return this.options; + } + + /** + * Set the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @param options the options value to set. + * @return the CassandraViewCreateUpdateProperties object itself. + */ + public CassandraViewCreateUpdateProperties withOptions(CreateUpdateOptions options) { + this.options = options; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resource in model CassandraViewCreateUpdateProperties")); + } else { + resource().validate(); + } + if (options() != null) { + options().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraViewCreateUpdateProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + jsonWriter.writeJsonField("options", this.options); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewCreateUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewCreateUpdateProperties 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 CassandraViewCreateUpdateProperties. + */ + public static CassandraViewCreateUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewCreateUpdateProperties deserializedCassandraViewCreateUpdateProperties + = new CassandraViewCreateUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedCassandraViewCreateUpdateProperties.resource = CassandraViewResource.fromJson(reader); + } else if ("options".equals(fieldName)) { + deserializedCassandraViewCreateUpdateProperties.options = CreateUpdateOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewCreateUpdateProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetProperties.java new file mode 100644 index 000000000000..39ee31616821 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.models.CassandraViewGetPropertiesOptions; +import com.azure.resourcemanager.cosmos.models.CassandraViewGetPropertiesResource; +import java.io.IOException; + +/** + * The properties of an Azure Cosmos DB Cassandra view. + */ +@Immutable +public final class CassandraViewGetProperties implements JsonSerializable { + /* + * The resource property. + */ + private CassandraViewGetPropertiesResource resource; + + /* + * The options property. + */ + private CassandraViewGetPropertiesOptions options; + + /** + * Creates an instance of CassandraViewGetProperties class. + */ + private CassandraViewGetProperties() { + } + + /** + * Get the resource property: The resource property. + * + * @return the resource value. + */ + public CassandraViewGetPropertiesResource resource() { + return this.resource; + } + + /** + * Get the options property: The options property. + * + * @return the options value. + */ + public CassandraViewGetPropertiesOptions options() { + return this.options; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() != null) { + resource().validate(); + } + if (options() != null) { + options().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + jsonWriter.writeJsonField("options", this.options); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewGetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewGetProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CassandraViewGetProperties. + */ + public static CassandraViewGetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewGetProperties deserializedCassandraViewGetProperties = new CassandraViewGetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedCassandraViewGetProperties.resource + = CassandraViewGetPropertiesResource.fromJson(reader); + } else if ("options".equals(fieldName)) { + deserializedCassandraViewGetProperties.options = CassandraViewGetPropertiesOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewGetProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetResultsInner.java new file mode 100644 index 000000000000..d193cc94a604 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetResultsInner.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +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.cosmos.models.CassandraViewGetPropertiesOptions; +import com.azure.resourcemanager.cosmos.models.CassandraViewGetPropertiesResource; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; +import java.io.IOException; +import java.util.Map; + +/** + * An Azure Cosmos DB Cassandra view. + */ +@Immutable +public final class CassandraViewGetResultsInner extends ProxyResource { + /* + * The properties of an Azure Cosmos DB Cassandra view + */ + private CassandraViewGetProperties innerProperties; + + /* + * The location of the resource group to which the resource belongs. + */ + private String location; + + /* + * Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping + * this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a + * key no greater than 128 characters and value no greater than 256 characters. For example, the default experience + * for a template type is set with + * \"defaultExperience\": \"Cassandra\". Current \"defaultExperience\" values also include \"Table\", \"Graph\", \"DocumentDB\", and \"MongoDB\" + * . + */ + private Map tags; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CassandraViewGetResultsInner class. + */ + private CassandraViewGetResultsInner() { + } + + /** + * Get the innerProperties property: The properties of an Azure Cosmos DB Cassandra view. + * + * @return the innerProperties value. + */ + private CassandraViewGetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the location property: The location of the resource group to which the resource belongs. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the tags property: Tags are a list of key-value pairs that describe the resource. These tags can be used in + * viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. + * Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, + * the default experience for a template type is set with \"defaultExperience\": \"Cassandra\". Current + * \"defaultExperience\" values also include \"Table\", \"Graph\", \"DocumentDB\", and \"MongoDB\". + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the resource property: The resource property. + * + * @return the resource value. + */ + public CassandraViewGetPropertiesResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Get the options property: The options property. + * + * @return the options value. + */ + public CassandraViewGetPropertiesOptions options() { + return this.innerProperties() == null ? null : this.innerProperties().options(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewGetResultsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewGetResultsInner 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 CassandraViewGetResultsInner. + */ + public static CassandraViewGetResultsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewGetResultsInner deserializedCassandraViewGetResultsInner = new CassandraViewGetResultsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.innerProperties + = CassandraViewGetProperties.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.location = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCassandraViewGetResultsInner.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewGetResultsInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultProperties.java new file mode 100644 index 000000000000..1082245896ad --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultProperties.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.models.SupportedActions; +import java.io.IOException; + +/** + * A request object to enable/disable the chaos fault. + */ +@Fluent +public final class ChaosFaultProperties implements JsonSerializable { + /* + * Indicates whether what action to take for the Chaos Fault. + */ + private SupportedActions action; + + /* + * Region of the account where the Chaos Fault is to be enabled/disabled. + */ + private String region; + + /* + * Database name. + */ + private String databaseName; + + /* + * Container name. + */ + private String containerName; + + /* + * A provisioning state of the Chaos Fault. + */ + private String provisioningState; + + /** + * Creates an instance of ChaosFaultProperties class. + */ + public ChaosFaultProperties() { + } + + /** + * Get the action property: Indicates whether what action to take for the Chaos Fault. + * + * @return the action value. + */ + public SupportedActions action() { + return this.action; + } + + /** + * Set the action property: Indicates whether what action to take for the Chaos Fault. + * + * @param action the action value to set. + * @return the ChaosFaultProperties object itself. + */ + public ChaosFaultProperties withAction(SupportedActions action) { + this.action = action; + return this; + } + + /** + * Get the region property: Region of the account where the Chaos Fault is to be enabled/disabled. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Region of the account where the Chaos Fault is to be enabled/disabled. + * + * @param region the region value to set. + * @return the ChaosFaultProperties object itself. + */ + public ChaosFaultProperties withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the databaseName property: Database name. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Database name. + * + * @param databaseName the databaseName value to set. + * @return the ChaosFaultProperties object itself. + */ + public ChaosFaultProperties withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the containerName property: Container name. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Container name. + * + * @param containerName the containerName value to set. + * @return the ChaosFaultProperties object itself. + */ + public ChaosFaultProperties withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the provisioningState property: A provisioning state of the Chaos Fault. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * 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("region", this.region); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("containerName", this.containerName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChaosFaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChaosFaultProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChaosFaultProperties. + */ + public static ChaosFaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChaosFaultProperties deserializedChaosFaultProperties = new ChaosFaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedChaosFaultProperties.action = SupportedActions.fromString(reader.getString()); + } else if ("region".equals(fieldName)) { + deserializedChaosFaultProperties.region = reader.getString(); + } else if ("databaseName".equals(fieldName)) { + deserializedChaosFaultProperties.databaseName = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedChaosFaultProperties.containerName = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedChaosFaultProperties.provisioningState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedChaosFaultProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultResourceInner.java new file mode 100644 index 000000000000..65d6b6e8da21 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultResourceInner.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.SupportedActions; +import java.io.IOException; + +/** + * A request object to enable/disable the chaos fault. + */ +@Fluent +public final class ChaosFaultResourceInner extends ProxyResource { + /* + * A request object to enable/disable the chaos fault. + */ + private ChaosFaultProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ChaosFaultResourceInner class. + */ + public ChaosFaultResourceInner() { + } + + /** + * Get the innerProperties property: A request object to enable/disable the chaos fault. + * + * @return the innerProperties value. + */ + private ChaosFaultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the action property: Indicates whether what action to take for the Chaos Fault. + * + * @return the action value. + */ + public SupportedActions action() { + return this.innerProperties() == null ? null : this.innerProperties().action(); + } + + /** + * Set the action property: Indicates whether what action to take for the Chaos Fault. + * + * @param action the action value to set. + * @return the ChaosFaultResourceInner object itself. + */ + public ChaosFaultResourceInner withAction(SupportedActions action) { + if (this.innerProperties() == null) { + this.innerProperties = new ChaosFaultProperties(); + } + this.innerProperties().withAction(action); + return this; + } + + /** + * Get the region property: Region of the account where the Chaos Fault is to be enabled/disabled. + * + * @return the region value. + */ + public String region() { + return this.innerProperties() == null ? null : this.innerProperties().region(); + } + + /** + * Set the region property: Region of the account where the Chaos Fault is to be enabled/disabled. + * + * @param region the region value to set. + * @return the ChaosFaultResourceInner object itself. + */ + public ChaosFaultResourceInner withRegion(String region) { + if (this.innerProperties() == null) { + this.innerProperties = new ChaosFaultProperties(); + } + this.innerProperties().withRegion(region); + return this; + } + + /** + * Get the databaseName property: Database name. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.innerProperties() == null ? null : this.innerProperties().databaseName(); + } + + /** + * Set the databaseName property: Database name. + * + * @param databaseName the databaseName value to set. + * @return the ChaosFaultResourceInner object itself. + */ + public ChaosFaultResourceInner withDatabaseName(String databaseName) { + if (this.innerProperties() == null) { + this.innerProperties = new ChaosFaultProperties(); + } + this.innerProperties().withDatabaseName(databaseName); + return this; + } + + /** + * Get the containerName property: Container name. + * + * @return the containerName value. + */ + public String containerName() { + return this.innerProperties() == null ? null : this.innerProperties().containerName(); + } + + /** + * Set the containerName property: Container name. + * + * @param containerName the containerName value to set. + * @return the ChaosFaultResourceInner object itself. + */ + public ChaosFaultResourceInner withContainerName(String containerName) { + if (this.innerProperties() == null) { + this.innerProperties = new ChaosFaultProperties(); + } + this.innerProperties().withContainerName(containerName); + return this; + } + + /** + * Get the provisioningState property: A provisioning state of the Chaos Fault. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + 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 ChaosFaultResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChaosFaultResourceInner 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 ChaosFaultResourceInner. + */ + public static ChaosFaultResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChaosFaultResourceInner deserializedChaosFaultResourceInner = new ChaosFaultResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedChaosFaultResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedChaosFaultResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedChaosFaultResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedChaosFaultResourceInner.innerProperties = ChaosFaultProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedChaosFaultResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedChaosFaultResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandPublicResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandPublicResourceInner.java new file mode 100644 index 000000000000..71b6ff0a40fb --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandPublicResourceInner.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.models.CommandStatus; +import java.io.IOException; + +/** + * resource representing a command. + */ +@Immutable +public final class CommandPublicResourceInner implements JsonSerializable { + /* + * The command which should be run + */ + private String command; + + /* + * The unique id of command + */ + private String commandId; + + /* + * The arguments for the command to be run + */ + private Object arguments; + + /* + * IP address of the cassandra host to run the command on + */ + private String host; + + /* + * Whether command has admin privileges + */ + private Boolean isAdmin; + + /* + * If true, stops cassandra before executing the command and then start it again + */ + private Boolean cassandraStopStart; + + /* + * If true, allows the command to *write* to the cassandra directory, otherwise read-only. + */ + private Boolean readWrite; + + /* + * Result output of the command. + */ + private String result; + + /* + * Status of the command. + */ + private CommandStatus status; + + /* + * The name of the file where the result is written. + */ + private String outputFile; + + /** + * Creates an instance of CommandPublicResourceInner class. + */ + private CommandPublicResourceInner() { + } + + /** + * Get the command property: The command which should be run. + * + * @return the command value. + */ + public String command() { + return this.command; + } + + /** + * Get the commandId property: The unique id of command. + * + * @return the commandId value. + */ + public String commandId() { + return this.commandId; + } + + /** + * Get the arguments property: The arguments for the command to be run. + * + * @return the arguments value. + */ + public Object arguments() { + return this.arguments; + } + + /** + * Get the host property: IP address of the cassandra host to run the command on. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Get the isAdmin property: Whether command has admin privileges. + * + * @return the isAdmin value. + */ + public Boolean isAdmin() { + return this.isAdmin; + } + + /** + * Get the cassandraStopStart property: If true, stops cassandra before executing the command and then start it + * again. + * + * @return the cassandraStopStart value. + */ + public Boolean cassandraStopStart() { + return this.cassandraStopStart; + } + + /** + * Get the readWrite property: If true, allows the command to *write* to the cassandra directory, otherwise + * read-only. + * + * @return the readWrite value. + */ + public Boolean readWrite() { + return this.readWrite; + } + + /** + * Get the result property: Result output of the command. + * + * @return the result value. + */ + public String result() { + return this.result; + } + + /** + * Get the status property: Status of the command. + * + * @return the status value. + */ + public CommandStatus status() { + return this.status; + } + + /** + * Get the outputFile property: The name of the file where the result is written. + * + * @return the outputFile value. + */ + public String outputFile() { + return this.outputFile; + } + + /** + * 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("command", this.command); + jsonWriter.writeStringField("commandId", this.commandId); + if (this.arguments != null) { + jsonWriter.writeUntypedField("arguments", this.arguments); + } + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeBooleanField("isAdmin", this.isAdmin); + jsonWriter.writeBooleanField("cassandraStopStart", this.cassandraStopStart); + jsonWriter.writeBooleanField("readWrite", this.readWrite); + jsonWriter.writeStringField("result", this.result); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("outputFile", this.outputFile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CommandPublicResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CommandPublicResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CommandPublicResourceInner. + */ + public static CommandPublicResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CommandPublicResourceInner deserializedCommandPublicResourceInner = new CommandPublicResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("command".equals(fieldName)) { + deserializedCommandPublicResourceInner.command = reader.getString(); + } else if ("commandId".equals(fieldName)) { + deserializedCommandPublicResourceInner.commandId = reader.getString(); + } else if ("arguments".equals(fieldName)) { + deserializedCommandPublicResourceInner.arguments = reader.readUntyped(); + } else if ("host".equals(fieldName)) { + deserializedCommandPublicResourceInner.host = reader.getString(); + } else if ("isAdmin".equals(fieldName)) { + deserializedCommandPublicResourceInner.isAdmin = reader.getNullable(JsonReader::getBoolean); + } else if ("cassandraStopStart".equals(fieldName)) { + deserializedCommandPublicResourceInner.cassandraStopStart + = reader.getNullable(JsonReader::getBoolean); + } else if ("readWrite".equals(fieldName)) { + deserializedCommandPublicResourceInner.readWrite = reader.getNullable(JsonReader::getBoolean); + } else if ("result".equals(fieldName)) { + deserializedCommandPublicResourceInner.result = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedCommandPublicResourceInner.status = CommandStatus.fromString(reader.getString()); + } else if ("outputFile".equals(fieldName)) { + deserializedCommandPublicResourceInner.outputFile = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCommandPublicResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CopyJobGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CopyJobGetResultsInner.java new file mode 100644 index 000000000000..7efbc9c53f3f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CopyJobGetResultsInner.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.CopyJobProperties; +import java.io.IOException; + +/** + * A Cosmos DB Copy Job. + */ +@Fluent +public final class CopyJobGetResultsInner extends ProxyResource { + /* + * The properties of a Copy Job + */ + private CopyJobProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CopyJobGetResultsInner class. + */ + public CopyJobGetResultsInner() { + } + + /** + * Get the properties property: The properties of a Copy Job. + * + * @return the properties value. + */ + public CopyJobProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of a Copy Job. + * + * @param properties the properties value to set. + * @return the CopyJobGetResultsInner object itself. + */ + public CopyJobGetResultsInner withProperties(CopyJobProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model CopyJobGetResultsInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CopyJobGetResultsInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CopyJobGetResultsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CopyJobGetResultsInner 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 CopyJobGetResultsInner. + */ + public static CopyJobGetResultsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CopyJobGetResultsInner deserializedCopyJobGetResultsInner = new CopyJobGetResultsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCopyJobGetResultsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCopyJobGetResultsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCopyJobGetResultsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCopyJobGetResultsInner.properties = CopyJobProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCopyJobGetResultsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCopyJobGetResultsInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobGetResultsInner.java new file mode 100644 index 000000000000..09337d8691f0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobGetResultsInner.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.DataTransferDataSourceSink; +import com.azure.resourcemanager.cosmos.models.DataTransferJobMode; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * A Cosmos DB Data Transfer Job. + */ +@Immutable +public final class DataTransferJobGetResultsInner extends ProxyResource { + /* + * The properties of a DataTransfer Job + */ + private DataTransferJobProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DataTransferJobGetResultsInner class. + */ + private DataTransferJobGetResultsInner() { + } + + /** + * Get the innerProperties property: The properties of a DataTransfer Job. + * + * @return the innerProperties value. + */ + private DataTransferJobProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the jobName property: Job Name. + * + * @return the jobName value. + */ + public String jobName() { + return this.innerProperties() == null ? null : this.innerProperties().jobName(); + } + + /** + * Get the source property: Source DataStore details. + * + * @return the source value. + */ + public DataTransferDataSourceSink source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Get the destination property: Destination DataStore details. + * + * @return the destination value. + */ + public DataTransferDataSourceSink destination() { + return this.innerProperties() == null ? null : this.innerProperties().destination(); + } + + /** + * Get the status property: Job Status. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the processedCount property: Processed Count. + * + * @return the processedCount value. + */ + public Long processedCount() { + return this.innerProperties() == null ? null : this.innerProperties().processedCount(); + } + + /** + * Get the totalCount property: Total Count. + * + * @return the totalCount value. + */ + public Long totalCount() { + return this.innerProperties() == null ? null : this.innerProperties().totalCount(); + } + + /** + * Get the lastUpdatedUtcTime property: Last Updated Time (ISO-8601 format). + * + * @return the lastUpdatedUtcTime value. + */ + public OffsetDateTime lastUpdatedUtcTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedUtcTime(); + } + + /** + * Get the workerCount property: Worker count. + * + * @return the workerCount value. + */ + public Integer workerCount() { + return this.innerProperties() == null ? null : this.innerProperties().workerCount(); + } + + /** + * Get the error property: Error response for Faulted job. + * + * @return the error value. + */ + public ManagementError error() { + return this.innerProperties() == null ? null : this.innerProperties().error(); + } + + /** + * Get the duration property: Total Duration of Job. + * + * @return the duration value. + */ + public String duration() { + return this.innerProperties() == null ? null : this.innerProperties().duration(); + } + + /** + * Get the mode property: Mode of job execution. + * + * @return the mode value. + */ + public DataTransferJobMode mode() { + return this.innerProperties() == null ? null : this.innerProperties().mode(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + 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 DataTransferJobGetResultsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTransferJobGetResultsInner 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 DataTransferJobGetResultsInner. + */ + public static DataTransferJobGetResultsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTransferJobGetResultsInner deserializedDataTransferJobGetResultsInner + = new DataTransferJobGetResultsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDataTransferJobGetResultsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDataTransferJobGetResultsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDataTransferJobGetResultsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDataTransferJobGetResultsInner.innerProperties + = DataTransferJobProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDataTransferJobGetResultsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTransferJobGetResultsInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobProperties.java new file mode 100644 index 000000000000..72bb55a42b0b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +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.cosmos.models.DataTransferDataSourceSink; +import com.azure.resourcemanager.cosmos.models.DataTransferJobMode; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The properties of a DataTransfer Job. + */ +@Fluent +public final class DataTransferJobProperties implements JsonSerializable { + /* + * Job Name + */ + private String jobName; + + /* + * Source DataStore details + */ + private DataTransferDataSourceSink source; + + /* + * Destination DataStore details + */ + private DataTransferDataSourceSink destination; + + /* + * Job Status + */ + private String status; + + /* + * Processed Count. + */ + private Long processedCount; + + /* + * Total Count. + */ + private Long totalCount; + + /* + * Last Updated Time (ISO-8601 format). + */ + private OffsetDateTime lastUpdatedUtcTime; + + /* + * Worker count + */ + private Integer workerCount; + + /* + * Error response for Faulted job + */ + private ManagementError error; + + /* + * Total Duration of Job + */ + private String duration; + + /* + * Mode of job execution + */ + private DataTransferJobMode mode; + + /** + * Creates an instance of DataTransferJobProperties class. + */ + public DataTransferJobProperties() { + } + + /** + * Get the jobName property: Job Name. + * + * @return the jobName value. + */ + public String jobName() { + return this.jobName; + } + + /** + * Get the source property: Source DataStore details. + * + * @return the source value. + */ + public DataTransferDataSourceSink source() { + return this.source; + } + + /** + * Set the source property: Source DataStore details. + * + * @param source the source value to set. + * @return the DataTransferJobProperties object itself. + */ + public DataTransferJobProperties withSource(DataTransferDataSourceSink source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination DataStore details. + * + * @return the destination value. + */ + public DataTransferDataSourceSink destination() { + return this.destination; + } + + /** + * Set the destination property: Destination DataStore details. + * + * @param destination the destination value to set. + * @return the DataTransferJobProperties object itself. + */ + public DataTransferJobProperties withDestination(DataTransferDataSourceSink destination) { + this.destination = destination; + return this; + } + + /** + * Get the status property: Job Status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the processedCount property: Processed Count. + * + * @return the processedCount value. + */ + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Total Count. + * + * @return the totalCount value. + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Get the lastUpdatedUtcTime property: Last Updated Time (ISO-8601 format). + * + * @return the lastUpdatedUtcTime value. + */ + public OffsetDateTime lastUpdatedUtcTime() { + return this.lastUpdatedUtcTime; + } + + /** + * Get the workerCount property: Worker count. + * + * @return the workerCount value. + */ + public Integer workerCount() { + return this.workerCount; + } + + /** + * Set the workerCount property: Worker count. + * + * @param workerCount the workerCount value to set. + * @return the DataTransferJobProperties object itself. + */ + public DataTransferJobProperties withWorkerCount(Integer workerCount) { + this.workerCount = workerCount; + return this; + } + + /** + * Get the error property: Error response for Faulted job. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the duration property: Total Duration of Job. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Get the mode property: Mode of job execution. + * + * @return the mode value. + */ + public DataTransferJobMode mode() { + return this.mode; + } + + /** + * Set the mode property: Mode of job execution. + * + * @param mode the mode value to set. + * @return the DataTransferJobProperties object itself. + */ + public DataTransferJobProperties withMode(DataTransferJobMode mode) { + this.mode = mode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model DataTransferJobProperties")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model DataTransferJobProperties")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataTransferJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + jsonWriter.writeNumberField("workerCount", this.workerCount); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataTransferJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTransferJobProperties 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 DataTransferJobProperties. + */ + public static DataTransferJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTransferJobProperties deserializedDataTransferJobProperties = new DataTransferJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("source".equals(fieldName)) { + deserializedDataTransferJobProperties.source = DataTransferDataSourceSink.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedDataTransferJobProperties.destination = DataTransferDataSourceSink.fromJson(reader); + } else if ("jobName".equals(fieldName)) { + deserializedDataTransferJobProperties.jobName = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedDataTransferJobProperties.status = reader.getString(); + } else if ("processedCount".equals(fieldName)) { + deserializedDataTransferJobProperties.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("totalCount".equals(fieldName)) { + deserializedDataTransferJobProperties.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("lastUpdatedUtcTime".equals(fieldName)) { + deserializedDataTransferJobProperties.lastUpdatedUtcTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("workerCount".equals(fieldName)) { + deserializedDataTransferJobProperties.workerCount = reader.getNullable(JsonReader::getInt); + } else if ("error".equals(fieldName)) { + deserializedDataTransferJobProperties.error = ManagementError.fromJson(reader); + } else if ("duration".equals(fieldName)) { + deserializedDataTransferJobProperties.duration = reader.getString(); + } else if ("mode".equals(fieldName)) { + deserializedDataTransferJobProperties.mode = DataTransferJobMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTransferJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountCreateUpdateProperties.java index 098a9ad69aba..bdab15ec2246 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountCreateUpdateProperties.java @@ -15,18 +15,21 @@ import com.azure.resourcemanager.cosmos.models.BackupPolicy; import com.azure.resourcemanager.cosmos.models.Capability; import com.azure.resourcemanager.cosmos.models.Capacity; +import com.azure.resourcemanager.cosmos.models.CapacityMode; import com.azure.resourcemanager.cosmos.models.ConnectorOffer; import com.azure.resourcemanager.cosmos.models.ConsistencyPolicy; import com.azure.resourcemanager.cosmos.models.CorsPolicy; import com.azure.resourcemanager.cosmos.models.CreateMode; import com.azure.resourcemanager.cosmos.models.DatabaseAccountKeysMetadata; import com.azure.resourcemanager.cosmos.models.DefaultPriorityLevel; +import com.azure.resourcemanager.cosmos.models.DiagnosticLogSettings; import com.azure.resourcemanager.cosmos.models.IpAddressOrRange; import com.azure.resourcemanager.cosmos.models.Location; import com.azure.resourcemanager.cosmos.models.MinimalTlsVersion; import com.azure.resourcemanager.cosmos.models.NetworkAclBypass; import com.azure.resourcemanager.cosmos.models.PublicNetworkAccess; import com.azure.resourcemanager.cosmos.models.RestoreParameters; +import com.azure.resourcemanager.cosmos.models.SoftDeleteConfiguration; import com.azure.resourcemanager.cosmos.models.VirtualNetworkRule; import java.io.IOException; import java.util.List; @@ -160,6 +163,11 @@ public final class DatabaseAccountCreateUpdateProperties */ private List networkAclBypassResourceIds; + /* + * The Object representing the different Diagnostic log settings for the Cosmos DB Account. + */ + private DiagnosticLogSettings diagnosticLogSettings; + /* * Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ @@ -175,6 +183,16 @@ public final class DatabaseAccountCreateUpdateProperties */ private Capacity capacity; + /* + * Indicates the capacityMode of the Cosmos DB account. + */ + private CapacityMode capacityMode; + + /* + * Flag to indicate whether to enable MaterializedViews on the Cosmos DB account + */ + private Boolean enableMaterializedViews; + /* * This property is ignored during the update/create operation, as the metadata is read-only. The object represents * the metadata for the Account Keys of the Cosmos DB account. @@ -218,6 +236,16 @@ public final class DatabaseAccountCreateUpdateProperties */ private Boolean enablePerRegionPerPartitionAutoscale; + /* + * Flag to indicate if All Versions and Deletes Change feed feature is enabled on the account + */ + private Boolean enableAllVersionsAndDeletesChangeFeed; + + /* + * The configuration for soft delete on the Cosmos DB account. + */ + private SoftDeleteConfiguration softDeleteConfiguration; + /* * Flag to indicate enabling/disabling of hierarchical partition key ID last level enforcement on the account. */ @@ -719,6 +747,29 @@ public List networkAclBypassResourceIds() { return this; } + /** + * Get the diagnosticLogSettings property: The Object representing the different Diagnostic log settings for the + * Cosmos DB Account. + * + * @return the diagnosticLogSettings value. + */ + public DiagnosticLogSettings diagnosticLogSettings() { + return this.diagnosticLogSettings; + } + + /** + * Set the diagnosticLogSettings property: The Object representing the different Diagnostic log settings for the + * Cosmos DB Account. + * + * @param diagnosticLogSettings the diagnosticLogSettings value to set. + * @return the DatabaseAccountCreateUpdateProperties object itself. + */ + public DatabaseAccountCreateUpdateProperties + withDiagnosticLogSettings(DiagnosticLogSettings diagnosticLogSettings) { + this.diagnosticLogSettings = diagnosticLogSettings; + return this; + } + /** * Get the disableLocalAuth property: Opt-out of local authentication and ensure only MSI and AAD can be used * exclusively for authentication. @@ -783,6 +834,48 @@ public DatabaseAccountCreateUpdateProperties withCapacity(Capacity capacity) { return this; } + /** + * Get the capacityMode property: Indicates the capacityMode of the Cosmos DB account. + * + * @return the capacityMode value. + */ + public CapacityMode capacityMode() { + return this.capacityMode; + } + + /** + * Set the capacityMode property: Indicates the capacityMode of the Cosmos DB account. + * + * @param capacityMode the capacityMode value to set. + * @return the DatabaseAccountCreateUpdateProperties object itself. + */ + public DatabaseAccountCreateUpdateProperties withCapacityMode(CapacityMode capacityMode) { + this.capacityMode = capacityMode; + return this; + } + + /** + * Get the enableMaterializedViews property: Flag to indicate whether to enable MaterializedViews on the Cosmos DB + * account. + * + * @return the enableMaterializedViews value. + */ + public Boolean enableMaterializedViews() { + return this.enableMaterializedViews; + } + + /** + * Set the enableMaterializedViews property: Flag to indicate whether to enable MaterializedViews on the Cosmos DB + * account. + * + * @param enableMaterializedViews the enableMaterializedViews value to set. + * @return the DatabaseAccountCreateUpdateProperties object itself. + */ + public DatabaseAccountCreateUpdateProperties withEnableMaterializedViews(Boolean enableMaterializedViews) { + this.enableMaterializedViews = enableMaterializedViews; + return this; + } + /** * Get the keysMetadata property: This property is ignored during the update/create operation, as the metadata is * read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. @@ -949,6 +1042,50 @@ public Boolean enablePerRegionPerPartitionAutoscale() { return this; } + /** + * Get the enableAllVersionsAndDeletesChangeFeed property: Flag to indicate if All Versions and Deletes Change feed + * feature is enabled on the account. + * + * @return the enableAllVersionsAndDeletesChangeFeed value. + */ + public Boolean enableAllVersionsAndDeletesChangeFeed() { + return this.enableAllVersionsAndDeletesChangeFeed; + } + + /** + * Set the enableAllVersionsAndDeletesChangeFeed property: Flag to indicate if All Versions and Deletes Change feed + * feature is enabled on the account. + * + * @param enableAllVersionsAndDeletesChangeFeed the enableAllVersionsAndDeletesChangeFeed value to set. + * @return the DatabaseAccountCreateUpdateProperties object itself. + */ + public DatabaseAccountCreateUpdateProperties + withEnableAllVersionsAndDeletesChangeFeed(Boolean enableAllVersionsAndDeletesChangeFeed) { + this.enableAllVersionsAndDeletesChangeFeed = enableAllVersionsAndDeletesChangeFeed; + return this; + } + + /** + * Get the softDeleteConfiguration property: The configuration for soft delete on the Cosmos DB account. + * + * @return the softDeleteConfiguration value. + */ + public SoftDeleteConfiguration softDeleteConfiguration() { + return this.softDeleteConfiguration; + } + + /** + * Set the softDeleteConfiguration property: The configuration for soft delete on the Cosmos DB account. + * + * @param softDeleteConfiguration the softDeleteConfiguration value to set. + * @return the DatabaseAccountCreateUpdateProperties object itself. + */ + public DatabaseAccountCreateUpdateProperties + withSoftDeleteConfiguration(SoftDeleteConfiguration softDeleteConfiguration) { + this.softDeleteConfiguration = softDeleteConfiguration; + return this; + } + /** * Get the enforceHierarchicalPartitionKeyIdLastLevel property: Flag to indicate enabling/disabling of hierarchical * partition key ID last level enforcement on the account. @@ -1009,6 +1146,9 @@ public void validate() { if (cors() != null) { cors().forEach(e -> e.validate()); } + if (diagnosticLogSettings() != null) { + diagnosticLogSettings().validate(); + } if (restoreParameters() != null) { restoreParameters().validate(); } @@ -1018,6 +1158,9 @@ public void validate() { if (keysMetadata() != null) { keysMetadata().validate(); } + if (softDeleteConfiguration() != null) { + softDeleteConfiguration().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(DatabaseAccountCreateUpdateProperties.class); @@ -1057,9 +1200,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.networkAclBypass == null ? null : this.networkAclBypass.toString()); jsonWriter.writeArrayField("networkAclBypassResourceIds", this.networkAclBypassResourceIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("diagnosticLogSettings", this.diagnosticLogSettings); jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); jsonWriter.writeJsonField("restoreParameters", this.restoreParameters); jsonWriter.writeJsonField("capacity", this.capacity); + jsonWriter.writeStringField("capacityMode", this.capacityMode == null ? null : this.capacityMode.toString()); + jsonWriter.writeBooleanField("enableMaterializedViews", this.enableMaterializedViews); jsonWriter.writeBooleanField("enablePartitionMerge", this.enablePartitionMerge); jsonWriter.writeBooleanField("enableBurstCapacity", this.enableBurstCapacity); jsonWriter.writeStringField("minimalTlsVersion", @@ -1069,6 +1215,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("defaultPriorityLevel", this.defaultPriorityLevel == null ? null : this.defaultPriorityLevel.toString()); jsonWriter.writeBooleanField("enablePerRegionPerPartitionAutoscale", this.enablePerRegionPerPartitionAutoscale); + jsonWriter.writeBooleanField("enableAllVersionsAndDeletesChangeFeed", + this.enableAllVersionsAndDeletesChangeFeed); + jsonWriter.writeJsonField("softDeleteConfiguration", this.softDeleteConfiguration); jsonWriter.writeBooleanField("enforceHierarchicalPartitionKeyIdLastLevel", this.enforceHierarchicalPartitionKeyIdLastLevel); return jsonWriter.writeEndObject(); @@ -1158,6 +1307,9 @@ public static DatabaseAccountCreateUpdateProperties fromJson(JsonReader jsonRead List networkAclBypassResourceIds = reader.readArray(reader1 -> reader1.getString()); deserializedDatabaseAccountCreateUpdateProperties.networkAclBypassResourceIds = networkAclBypassResourceIds; + } else if ("diagnosticLogSettings".equals(fieldName)) { + deserializedDatabaseAccountCreateUpdateProperties.diagnosticLogSettings + = DiagnosticLogSettings.fromJson(reader); } else if ("disableLocalAuth".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); @@ -1166,6 +1318,12 @@ public static DatabaseAccountCreateUpdateProperties fromJson(JsonReader jsonRead = RestoreParameters.fromJson(reader); } else if ("capacity".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.capacity = Capacity.fromJson(reader); + } else if ("capacityMode".equals(fieldName)) { + deserializedDatabaseAccountCreateUpdateProperties.capacityMode + = CapacityMode.fromString(reader.getString()); + } else if ("enableMaterializedViews".equals(fieldName)) { + deserializedDatabaseAccountCreateUpdateProperties.enableMaterializedViews + = reader.getNullable(JsonReader::getBoolean); } else if ("keysMetadata".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.keysMetadata = DatabaseAccountKeysMetadata.fromJson(reader); @@ -1189,6 +1347,12 @@ public static DatabaseAccountCreateUpdateProperties fromJson(JsonReader jsonRead } else if ("enablePerRegionPerPartitionAutoscale".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.enablePerRegionPerPartitionAutoscale = reader.getNullable(JsonReader::getBoolean); + } else if ("enableAllVersionsAndDeletesChangeFeed".equals(fieldName)) { + deserializedDatabaseAccountCreateUpdateProperties.enableAllVersionsAndDeletesChangeFeed + = reader.getNullable(JsonReader::getBoolean); + } else if ("softDeleteConfiguration".equals(fieldName)) { + deserializedDatabaseAccountCreateUpdateProperties.softDeleteConfiguration + = SoftDeleteConfiguration.fromJson(reader); } else if ("enforceHierarchicalPartitionKeyIdLastLevel".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.enforceHierarchicalPartitionKeyIdLastLevel = reader.getNullable(JsonReader::getBoolean); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetProperties.java index 5def49b5b14e..5c8d7ca75e5d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetProperties.java @@ -14,6 +14,8 @@ import com.azure.resourcemanager.cosmos.models.BackupPolicy; import com.azure.resourcemanager.cosmos.models.Capability; import com.azure.resourcemanager.cosmos.models.Capacity; +import com.azure.resourcemanager.cosmos.models.CapacityMode; +import com.azure.resourcemanager.cosmos.models.CapacityModeChangeTransitionState; import com.azure.resourcemanager.cosmos.models.ConnectorOffer; import com.azure.resourcemanager.cosmos.models.ConsistencyPolicy; import com.azure.resourcemanager.cosmos.models.CorsPolicy; @@ -21,6 +23,7 @@ import com.azure.resourcemanager.cosmos.models.DatabaseAccountKeysMetadata; import com.azure.resourcemanager.cosmos.models.DatabaseAccountOfferType; import com.azure.resourcemanager.cosmos.models.DefaultPriorityLevel; +import com.azure.resourcemanager.cosmos.models.DiagnosticLogSettings; import com.azure.resourcemanager.cosmos.models.FailoverPolicy; import com.azure.resourcemanager.cosmos.models.IpAddressOrRange; import com.azure.resourcemanager.cosmos.models.Location; @@ -28,6 +31,7 @@ import com.azure.resourcemanager.cosmos.models.NetworkAclBypass; import com.azure.resourcemanager.cosmos.models.PublicNetworkAccess; import com.azure.resourcemanager.cosmos.models.RestoreParameters; +import com.azure.resourcemanager.cosmos.models.SoftDeleteConfiguration; import com.azure.resourcemanager.cosmos.models.VirtualNetworkRule; import java.io.IOException; import java.util.List; @@ -200,6 +204,11 @@ public final class DatabaseAccountGetProperties implements JsonSerializable networkAclBypassResourceIds; + /* + * The Object representing the different Diagnostic log settings for the Cosmos DB Account. + */ + private DiagnosticLogSettings diagnosticLogSettings; + /* * Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ @@ -210,6 +219,21 @@ public final class DatabaseAccountGetProperties implements JsonSerializable return this; } + /** + * Get the diagnosticLogSettings property: The Object representing the different Diagnostic log settings for the + * Cosmos DB Account. + * + * @return the diagnosticLogSettings value. + */ + public DiagnosticLogSettings diagnosticLogSettings() { + return this.diagnosticLogSettings; + } + + /** + * Set the diagnosticLogSettings property: The Object representing the different Diagnostic log settings for the + * Cosmos DB Account. + * + * @param diagnosticLogSettings the diagnosticLogSettings value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties withDiagnosticLogSettings(DiagnosticLogSettings diagnosticLogSettings) { + this.diagnosticLogSettings = diagnosticLogSettings; + return this; + } + /** * Get the disableLocalAuth property: Opt-out of local authentication and ensure only MSI and AAD can be used * exclusively for authentication. @@ -871,6 +941,71 @@ public DatabaseAccountGetProperties withCapacity(Capacity capacity) { return this; } + /** + * Get the capacityMode property: Indicates the capacityMode of the Cosmos DB account. + * + * @return the capacityMode value. + */ + public CapacityMode capacityMode() { + return this.capacityMode; + } + + /** + * Set the capacityMode property: Indicates the capacityMode of the Cosmos DB account. + * + * @param capacityMode the capacityMode value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties withCapacityMode(CapacityMode capacityMode) { + this.capacityMode = capacityMode; + return this; + } + + /** + * Get the capacityModeChangeTransitionState property: The object that represents the migration state for the + * CapacityMode of the Cosmos DB account. + * + * @return the capacityModeChangeTransitionState value. + */ + public CapacityModeChangeTransitionState capacityModeChangeTransitionState() { + return this.capacityModeChangeTransitionState; + } + + /** + * Set the capacityModeChangeTransitionState property: The object that represents the migration state for the + * CapacityMode of the Cosmos DB account. + * + * @param capacityModeChangeTransitionState the capacityModeChangeTransitionState value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties + withCapacityModeChangeTransitionState(CapacityModeChangeTransitionState capacityModeChangeTransitionState) { + this.capacityModeChangeTransitionState = capacityModeChangeTransitionState; + return this; + } + + /** + * Get the enableMaterializedViews property: Flag to indicate whether to enable MaterializedViews on the Cosmos DB + * account. + * + * @return the enableMaterializedViews value. + */ + public Boolean enableMaterializedViews() { + return this.enableMaterializedViews; + } + + /** + * Set the enableMaterializedViews property: Flag to indicate whether to enable MaterializedViews on the Cosmos DB + * account. + * + * @param enableMaterializedViews the enableMaterializedViews value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties withEnableMaterializedViews(Boolean enableMaterializedViews) { + this.enableMaterializedViews = enableMaterializedViews; + return this; + } + /** * Get the keysMetadata property: The object that represents the metadata for the Account Keys of the Cosmos DB * account. @@ -1046,6 +1181,99 @@ public Boolean enablePerRegionPerPartitionAutoscale() { return this; } + /** + * Get the enableAllVersionsAndDeletesChangeFeed property: Flag to indicate if All Versions and Deletes Change feed + * feature is enabled on the account. + * + * @return the enableAllVersionsAndDeletesChangeFeed value. + */ + public Boolean enableAllVersionsAndDeletesChangeFeed() { + return this.enableAllVersionsAndDeletesChangeFeed; + } + + /** + * Set the enableAllVersionsAndDeletesChangeFeed property: Flag to indicate if All Versions and Deletes Change feed + * feature is enabled on the account. + * + * @param enableAllVersionsAndDeletesChangeFeed the enableAllVersionsAndDeletesChangeFeed value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties + withEnableAllVersionsAndDeletesChangeFeed(Boolean enableAllVersionsAndDeletesChangeFeed) { + this.enableAllVersionsAndDeletesChangeFeed = enableAllVersionsAndDeletesChangeFeed; + return this; + } + + /** + * Get the softDeleteConfiguration property: The configuration for soft delete on the Cosmos DB account. + * + * @return the softDeleteConfiguration value. + */ + public SoftDeleteConfiguration softDeleteConfiguration() { + return this.softDeleteConfiguration; + } + + /** + * Set the softDeleteConfiguration property: The configuration for soft delete on the Cosmos DB account. + * + * @param softDeleteConfiguration the softDeleteConfiguration value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties withSoftDeleteConfiguration(SoftDeleteConfiguration softDeleteConfiguration) { + this.softDeleteConfiguration = softDeleteConfiguration; + return this; + } + + /** + * Get the throughputPoolDedicatedRUs property: Total dedicated throughput (RU/s) for database account. Represents + * the sum of all manual provisioned throughput and all autoscale max RU/s across all shared throughput databases + * and dedicated throughput containers in the account for 1 region. READ ONLY. + * + * @return the throughputPoolDedicatedRUs value. + */ + public Long throughputPoolDedicatedRUs() { + return this.throughputPoolDedicatedRUs; + } + + /** + * Set the throughputPoolDedicatedRUs property: Total dedicated throughput (RU/s) for database account. Represents + * the sum of all manual provisioned throughput and all autoscale max RU/s across all shared throughput databases + * and dedicated throughput containers in the account for 1 region. READ ONLY. + * + * @param throughputPoolDedicatedRUs the throughputPoolDedicatedRUs value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties withThroughputPoolDedicatedRUs(Long throughputPoolDedicatedRUs) { + this.throughputPoolDedicatedRUs = throughputPoolDedicatedRUs; + return this; + } + + /** + * Get the throughputPoolMaxConsumableRUs property: When this account is part of a fleetspace with throughput + * pooling enabled, this is the maximum additional throughput (RU/s) that can be consumed from the pool, summed + * across all shared throughput databases and dedicated throughput containers in the account for 1 region. READ + * ONLY. + * + * @return the throughputPoolMaxConsumableRUs value. + */ + public Long throughputPoolMaxConsumableRUs() { + return this.throughputPoolMaxConsumableRUs; + } + + /** + * Set the throughputPoolMaxConsumableRUs property: When this account is part of a fleetspace with throughput + * pooling enabled, this is the maximum additional throughput (RU/s) that can be consumed from the pool, summed + * across all shared throughput databases and dedicated throughput containers in the account for 1 region. READ + * ONLY. + * + * @param throughputPoolMaxConsumableRUs the throughputPoolMaxConsumableRUs value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties withThroughputPoolMaxConsumableRUs(Long throughputPoolMaxConsumableRUs) { + this.throughputPoolMaxConsumableRUs = throughputPoolMaxConsumableRUs; + return this; + } + /** * Get the enforceHierarchicalPartitionKeyIdLastLevel property: Flag to indicate enabling/disabling of hierarchical * partition key ID last level enforcement on the account. @@ -1117,12 +1345,21 @@ public void validate() { if (cors() != null) { cors().forEach(e -> e.validate()); } + if (diagnosticLogSettings() != null) { + diagnosticLogSettings().validate(); + } if (capacity() != null) { capacity().validate(); } + if (capacityModeChangeTransitionState() != null) { + capacityModeChangeTransitionState().validate(); + } if (keysMetadata() != null) { keysMetadata().validate(); } + if (softDeleteConfiguration() != null) { + softDeleteConfiguration().validate(); + } } /** @@ -1159,8 +1396,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.networkAclBypass == null ? null : this.networkAclBypass.toString()); jsonWriter.writeArrayField("networkAclBypassResourceIds", this.networkAclBypassResourceIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("diagnosticLogSettings", this.diagnosticLogSettings); jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); jsonWriter.writeJsonField("capacity", this.capacity); + jsonWriter.writeStringField("capacityMode", this.capacityMode == null ? null : this.capacityMode.toString()); + jsonWriter.writeJsonField("capacityModeChangeTransitionState", this.capacityModeChangeTransitionState); + jsonWriter.writeBooleanField("enableMaterializedViews", this.enableMaterializedViews); jsonWriter.writeBooleanField("enablePartitionMerge", this.enablePartitionMerge); jsonWriter.writeBooleanField("enableBurstCapacity", this.enableBurstCapacity); jsonWriter.writeStringField("minimalTlsVersion", @@ -1170,6 +1411,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("defaultPriorityLevel", this.defaultPriorityLevel == null ? null : this.defaultPriorityLevel.toString()); jsonWriter.writeBooleanField("enablePerRegionPerPartitionAutoscale", this.enablePerRegionPerPartitionAutoscale); + jsonWriter.writeBooleanField("enableAllVersionsAndDeletesChangeFeed", + this.enableAllVersionsAndDeletesChangeFeed); + jsonWriter.writeJsonField("softDeleteConfiguration", this.softDeleteConfiguration); + jsonWriter.writeNumberField("throughputPoolDedicatedRUs", this.throughputPoolDedicatedRUs); + jsonWriter.writeNumberField("throughputPoolMaxConsumableRUs", this.throughputPoolMaxConsumableRUs); jsonWriter.writeBooleanField("enforceHierarchicalPartitionKeyIdLastLevel", this.enforceHierarchicalPartitionKeyIdLastLevel); return jsonWriter.writeEndObject(); @@ -1279,11 +1525,22 @@ public static DatabaseAccountGetProperties fromJson(JsonReader jsonReader) throw } else if ("networkAclBypassResourceIds".equals(fieldName)) { List networkAclBypassResourceIds = reader.readArray(reader1 -> reader1.getString()); deserializedDatabaseAccountGetProperties.networkAclBypassResourceIds = networkAclBypassResourceIds; + } else if ("diagnosticLogSettings".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.diagnosticLogSettings + = DiagnosticLogSettings.fromJson(reader); } else if ("disableLocalAuth".equals(fieldName)) { deserializedDatabaseAccountGetProperties.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); } else if ("capacity".equals(fieldName)) { deserializedDatabaseAccountGetProperties.capacity = Capacity.fromJson(reader); + } else if ("capacityMode".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.capacityMode = CapacityMode.fromString(reader.getString()); + } else if ("capacityModeChangeTransitionState".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.capacityModeChangeTransitionState + = CapacityModeChangeTransitionState.fromJson(reader); + } else if ("enableMaterializedViews".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.enableMaterializedViews + = reader.getNullable(JsonReader::getBoolean); } else if ("keysMetadata".equals(fieldName)) { deserializedDatabaseAccountGetProperties.keysMetadata = DatabaseAccountKeysMetadata.fromJson(reader); @@ -1309,6 +1566,18 @@ public static DatabaseAccountGetProperties fromJson(JsonReader jsonReader) throw } else if ("enablePerRegionPerPartitionAutoscale".equals(fieldName)) { deserializedDatabaseAccountGetProperties.enablePerRegionPerPartitionAutoscale = reader.getNullable(JsonReader::getBoolean); + } else if ("enableAllVersionsAndDeletesChangeFeed".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.enableAllVersionsAndDeletesChangeFeed + = reader.getNullable(JsonReader::getBoolean); + } else if ("softDeleteConfiguration".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.softDeleteConfiguration + = SoftDeleteConfiguration.fromJson(reader); + } else if ("throughputPoolDedicatedRUs".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.throughputPoolDedicatedRUs + = reader.getNullable(JsonReader::getLong); + } else if ("throughputPoolMaxConsumableRUs".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.throughputPoolMaxConsumableRUs + = reader.getNullable(JsonReader::getLong); } else if ("enforceHierarchicalPartitionKeyIdLastLevel".equals(fieldName)) { deserializedDatabaseAccountGetProperties.enforceHierarchicalPartitionKeyIdLastLevel = reader.getNullable(JsonReader::getBoolean); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetResultsInner.java index fa253b867825..4ad1661c109a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetResultsInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetResultsInner.java @@ -14,6 +14,8 @@ import com.azure.resourcemanager.cosmos.models.BackupPolicy; import com.azure.resourcemanager.cosmos.models.Capability; import com.azure.resourcemanager.cosmos.models.Capacity; +import com.azure.resourcemanager.cosmos.models.CapacityMode; +import com.azure.resourcemanager.cosmos.models.CapacityModeChangeTransitionState; import com.azure.resourcemanager.cosmos.models.ConnectorOffer; import com.azure.resourcemanager.cosmos.models.ConsistencyPolicy; import com.azure.resourcemanager.cosmos.models.CorsPolicy; @@ -22,6 +24,7 @@ import com.azure.resourcemanager.cosmos.models.DatabaseAccountKind; import com.azure.resourcemanager.cosmos.models.DatabaseAccountOfferType; import com.azure.resourcemanager.cosmos.models.DefaultPriorityLevel; +import com.azure.resourcemanager.cosmos.models.DiagnosticLogSettings; import com.azure.resourcemanager.cosmos.models.FailoverPolicy; import com.azure.resourcemanager.cosmos.models.IpAddressOrRange; import com.azure.resourcemanager.cosmos.models.Location; @@ -30,6 +33,7 @@ import com.azure.resourcemanager.cosmos.models.NetworkAclBypass; import com.azure.resourcemanager.cosmos.models.PublicNetworkAccess; import com.azure.resourcemanager.cosmos.models.RestoreParameters; +import com.azure.resourcemanager.cosmos.models.SoftDeleteConfiguration; import com.azure.resourcemanager.cosmos.models.VirtualNetworkRule; import java.io.IOException; import java.util.List; @@ -861,6 +865,31 @@ public DatabaseAccountGetResultsInner withNetworkAclBypassResourceIds(List networkAclBypassResourceIds; + /* + * The Object representing the different Diagnostic log settings for the Cosmos DB Account. + */ + private DiagnosticLogSettings diagnosticLogSettings; + /* * Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ @@ -156,6 +164,16 @@ public final class DatabaseAccountUpdateProperties implements JsonSerializable e.validate()); } + if (diagnosticLogSettings() != null) { + diagnosticLogSettings().validate(); + } if (capacity() != null) { capacity().validate(); } if (keysMetadata() != null) { keysMetadata().validate(); } + if (softDeleteConfiguration() != null) { + softDeleteConfiguration().validate(); + } } /** @@ -974,8 +1116,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.networkAclBypass == null ? null : this.networkAclBypass.toString()); jsonWriter.writeArrayField("networkAclBypassResourceIds", this.networkAclBypassResourceIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("diagnosticLogSettings", this.diagnosticLogSettings); jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); jsonWriter.writeJsonField("capacity", this.capacity); + jsonWriter.writeStringField("capacityMode", this.capacityMode == null ? null : this.capacityMode.toString()); + jsonWriter.writeBooleanField("enableMaterializedViews", this.enableMaterializedViews); jsonWriter.writeBooleanField("enablePartitionMerge", this.enablePartitionMerge); jsonWriter.writeBooleanField("enableBurstCapacity", this.enableBurstCapacity); jsonWriter.writeStringField("minimalTlsVersion", @@ -985,6 +1130,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("defaultPriorityLevel", this.defaultPriorityLevel == null ? null : this.defaultPriorityLevel.toString()); jsonWriter.writeBooleanField("enablePerRegionPerPartitionAutoscale", this.enablePerRegionPerPartitionAutoscale); + jsonWriter.writeBooleanField("enableAllVersionsAndDeletesChangeFeed", + this.enableAllVersionsAndDeletesChangeFeed); + jsonWriter.writeJsonField("softDeleteConfiguration", this.softDeleteConfiguration); jsonWriter.writeBooleanField("enforceHierarchicalPartitionKeyIdLastLevel", this.enforceHierarchicalPartitionKeyIdLastLevel); return jsonWriter.writeEndObject(); @@ -1069,11 +1217,20 @@ public static DatabaseAccountUpdateProperties fromJson(JsonReader jsonReader) th List networkAclBypassResourceIds = reader.readArray(reader1 -> reader1.getString()); deserializedDatabaseAccountUpdateProperties.networkAclBypassResourceIds = networkAclBypassResourceIds; + } else if ("diagnosticLogSettings".equals(fieldName)) { + deserializedDatabaseAccountUpdateProperties.diagnosticLogSettings + = DiagnosticLogSettings.fromJson(reader); } else if ("disableLocalAuth".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); } else if ("capacity".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.capacity = Capacity.fromJson(reader); + } else if ("capacityMode".equals(fieldName)) { + deserializedDatabaseAccountUpdateProperties.capacityMode + = CapacityMode.fromString(reader.getString()); + } else if ("enableMaterializedViews".equals(fieldName)) { + deserializedDatabaseAccountUpdateProperties.enableMaterializedViews + = reader.getNullable(JsonReader::getBoolean); } else if ("keysMetadata".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.keysMetadata = DatabaseAccountKeysMetadata.fromJson(reader); @@ -1097,6 +1254,12 @@ public static DatabaseAccountUpdateProperties fromJson(JsonReader jsonReader) th } else if ("enablePerRegionPerPartitionAutoscale".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.enablePerRegionPerPartitionAutoscale = reader.getNullable(JsonReader::getBoolean); + } else if ("enableAllVersionsAndDeletesChangeFeed".equals(fieldName)) { + deserializedDatabaseAccountUpdateProperties.enableAllVersionsAndDeletesChangeFeed + = reader.getNullable(JsonReader::getBoolean); + } else if ("softDeleteConfiguration".equals(fieldName)) { + deserializedDatabaseAccountUpdateProperties.softDeleteConfiguration + = SoftDeleteConfiguration.fromJson(reader); } else if ("enforceHierarchicalPartitionKeyIdLastLevel".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.enforceHierarchicalPartitionKeyIdLastLevel = reader.getNullable(JsonReader::getBoolean); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsProperties.java new file mode 100644 index 000000000000..aa7e960946e6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.models.FleetAnalyticsPropertiesStorageLocationType; +import com.azure.resourcemanager.cosmos.models.Status; +import java.io.IOException; + +/** + * The FleetAnalyticsProperties model. + */ +@Fluent +public final class FleetAnalyticsProperties implements JsonSerializable { + /* + * A provisioning state of the FleetAnalytics. + */ + private Status provisioningState; + + /* + * The type of the fleet analytics resource. + */ + private FleetAnalyticsPropertiesStorageLocationType storageLocationType; + + /* + * The unique identifier of the fleet analytics resource. + */ + private String storageLocationUri; + + /** + * Creates an instance of FleetAnalyticsProperties class. + */ + public FleetAnalyticsProperties() { + } + + /** + * Get the provisioningState property: A provisioning state of the FleetAnalytics. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.provisioningState; + } + + /** + * Get the storageLocationType property: The type of the fleet analytics resource. + * + * @return the storageLocationType value. + */ + public FleetAnalyticsPropertiesStorageLocationType storageLocationType() { + return this.storageLocationType; + } + + /** + * Set the storageLocationType property: The type of the fleet analytics resource. + * + * @param storageLocationType the storageLocationType value to set. + * @return the FleetAnalyticsProperties object itself. + */ + public FleetAnalyticsProperties + withStorageLocationType(FleetAnalyticsPropertiesStorageLocationType storageLocationType) { + this.storageLocationType = storageLocationType; + return this; + } + + /** + * Get the storageLocationUri property: The unique identifier of the fleet analytics resource. + * + * @return the storageLocationUri value. + */ + public String storageLocationUri() { + return this.storageLocationUri; + } + + /** + * Set the storageLocationUri property: The unique identifier of the fleet analytics resource. + * + * @param storageLocationUri the storageLocationUri value to set. + * @return the FleetAnalyticsProperties object itself. + */ + public FleetAnalyticsProperties withStorageLocationUri(String storageLocationUri) { + this.storageLocationUri = storageLocationUri; + 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("storageLocationType", + this.storageLocationType == null ? null : this.storageLocationType.toString()); + jsonWriter.writeStringField("storageLocationUri", this.storageLocationUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FleetAnalyticsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FleetAnalyticsProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FleetAnalyticsProperties. + */ + public static FleetAnalyticsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FleetAnalyticsProperties deserializedFleetAnalyticsProperties = new FleetAnalyticsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedFleetAnalyticsProperties.provisioningState = Status.fromString(reader.getString()); + } else if ("storageLocationType".equals(fieldName)) { + deserializedFleetAnalyticsProperties.storageLocationType + = FleetAnalyticsPropertiesStorageLocationType.fromString(reader.getString()); + } else if ("storageLocationUri".equals(fieldName)) { + deserializedFleetAnalyticsProperties.storageLocationUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFleetAnalyticsProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsResourceInner.java new file mode 100644 index 000000000000..9ff5fc03313d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsResourceInner.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.FleetAnalyticsPropertiesStorageLocationType; +import com.azure.resourcemanager.cosmos.models.Status; +import java.io.IOException; + +/** + * An Azure Cosmos DB FleetAnalytics. + */ +@Fluent +public final class FleetAnalyticsResourceInner extends ProxyResource { + /* + * The properties property. + */ + private FleetAnalyticsProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of FleetAnalyticsResourceInner class. + */ + public FleetAnalyticsResourceInner() { + } + + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private FleetAnalyticsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: A provisioning state of the FleetAnalytics. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the storageLocationType property: The type of the fleet analytics resource. + * + * @return the storageLocationType value. + */ + public FleetAnalyticsPropertiesStorageLocationType storageLocationType() { + return this.innerProperties() == null ? null : this.innerProperties().storageLocationType(); + } + + /** + * Set the storageLocationType property: The type of the fleet analytics resource. + * + * @param storageLocationType the storageLocationType value to set. + * @return the FleetAnalyticsResourceInner object itself. + */ + public FleetAnalyticsResourceInner + withStorageLocationType(FleetAnalyticsPropertiesStorageLocationType storageLocationType) { + if (this.innerProperties() == null) { + this.innerProperties = new FleetAnalyticsProperties(); + } + this.innerProperties().withStorageLocationType(storageLocationType); + return this; + } + + /** + * Get the storageLocationUri property: The unique identifier of the fleet analytics resource. + * + * @return the storageLocationUri value. + */ + public String storageLocationUri() { + return this.innerProperties() == null ? null : this.innerProperties().storageLocationUri(); + } + + /** + * Set the storageLocationUri property: The unique identifier of the fleet analytics resource. + * + * @param storageLocationUri the storageLocationUri value to set. + * @return the FleetAnalyticsResourceInner object itself. + */ + public FleetAnalyticsResourceInner withStorageLocationUri(String storageLocationUri) { + if (this.innerProperties() == null) { + this.innerProperties = new FleetAnalyticsProperties(); + } + this.innerProperties().withStorageLocationUri(storageLocationUri); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + 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 FleetAnalyticsResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FleetAnalyticsResourceInner 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 FleetAnalyticsResourceInner. + */ + public static FleetAnalyticsResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FleetAnalyticsResourceInner deserializedFleetAnalyticsResourceInner = new FleetAnalyticsResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFleetAnalyticsResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFleetAnalyticsResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFleetAnalyticsResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFleetAnalyticsResourceInner.innerProperties = FleetAnalyticsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFleetAnalyticsResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFleetAnalyticsResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GarnetClusterResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GarnetClusterResourceInner.java new file mode 100644 index 000000000000..d81f899a03b9 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GarnetClusterResourceInner.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.GarnetClusterResourceProperties; +import com.azure.resourcemanager.cosmos.models.ManagedCassandraManagedServiceIdentity; +import java.io.IOException; +import java.util.Map; + +/** + * Representation of a Garnet cache cluster. + */ +@Fluent +public final class GarnetClusterResourceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private GarnetClusterResourceProperties properties; + + /* + * Identity for the resource. + */ + private ManagedCassandraManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GarnetClusterResourceInner class. + */ + public GarnetClusterResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public GarnetClusterResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the GarnetClusterResourceInner object itself. + */ + public GarnetClusterResourceInner withProperties(GarnetClusterResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedCassandraManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the GarnetClusterResourceInner object itself. + */ + public GarnetClusterResourceInner withIdentity(ManagedCassandraManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public GarnetClusterResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GarnetClusterResourceInner 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) { + properties().validate(); + } + if (identity() != null) { + 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("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GarnetClusterResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GarnetClusterResourceInner 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 GarnetClusterResourceInner. + */ + public static GarnetClusterResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GarnetClusterResourceInner deserializedGarnetClusterResourceInner = new GarnetClusterResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGarnetClusterResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGarnetClusterResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGarnetClusterResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedGarnetClusterResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGarnetClusterResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedGarnetClusterResourceInner.properties + = GarnetClusterResourceProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedGarnetClusterResourceInner.identity + = ManagedCassandraManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGarnetClusterResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGarnetClusterResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceCreateUpdateProperties.java new file mode 100644 index 000000000000..b551a7383790 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceCreateUpdateProperties.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.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.cosmos.models.CreateUpdateOptions; +import com.azure.resourcemanager.cosmos.models.GraphResource; +import java.io.IOException; + +/** + * Properties to create and update Azure Cosmos DB Graph resource. + */ +@Fluent +public final class GraphResourceCreateUpdateProperties + implements JsonSerializable { + /* + * The standard JSON format of a Graph resource + */ + private GraphResource resource; + + /* + * A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + */ + private CreateUpdateOptions options; + + /** + * Creates an instance of GraphResourceCreateUpdateProperties class. + */ + public GraphResourceCreateUpdateProperties() { + } + + /** + * Get the resource property: The standard JSON format of a Graph resource. + * + * @return the resource value. + */ + public GraphResource resource() { + return this.resource; + } + + /** + * Set the resource property: The standard JSON format of a Graph resource. + * + * @param resource the resource value to set. + * @return the GraphResourceCreateUpdateProperties object itself. + */ + public GraphResourceCreateUpdateProperties withResource(GraphResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @return the options value. + */ + public CreateUpdateOptions options() { + return this.options; + } + + /** + * Set the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @param options the options value to set. + * @return the GraphResourceCreateUpdateProperties object itself. + */ + public GraphResourceCreateUpdateProperties withOptions(CreateUpdateOptions options) { + this.options = options; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resource in model GraphResourceCreateUpdateProperties")); + } else { + resource().validate(); + } + if (options() != null) { + options().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GraphResourceCreateUpdateProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + jsonWriter.writeJsonField("options", this.options); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourceCreateUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourceCreateUpdateProperties 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 GraphResourceCreateUpdateProperties. + */ + public static GraphResourceCreateUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourceCreateUpdateProperties deserializedGraphResourceCreateUpdateProperties + = new GraphResourceCreateUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedGraphResourceCreateUpdateProperties.resource = GraphResource.fromJson(reader); + } else if ("options".equals(fieldName)) { + deserializedGraphResourceCreateUpdateProperties.options = CreateUpdateOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourceCreateUpdateProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetProperties.java new file mode 100644 index 000000000000..f910b60b16e8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.models.GraphResourceGetPropertiesOptions; +import com.azure.resourcemanager.cosmos.models.GraphResourceGetPropertiesResource; +import java.io.IOException; + +/** + * The properties of an Azure Cosmos DB SQL database. + */ +@Immutable +public final class GraphResourceGetProperties implements JsonSerializable { + /* + * The resource property. + */ + private GraphResourceGetPropertiesResource resource; + + /* + * The options property. + */ + private GraphResourceGetPropertiesOptions options; + + /** + * Creates an instance of GraphResourceGetProperties class. + */ + private GraphResourceGetProperties() { + } + + /** + * Get the resource property: The resource property. + * + * @return the resource value. + */ + public GraphResourceGetPropertiesResource resource() { + return this.resource; + } + + /** + * Get the options property: The options property. + * + * @return the options value. + */ + public GraphResourceGetPropertiesOptions options() { + return this.options; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() != null) { + resource().validate(); + } + if (options() != null) { + options().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + jsonWriter.writeJsonField("options", this.options); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourceGetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourceGetProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphResourceGetProperties. + */ + public static GraphResourceGetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourceGetProperties deserializedGraphResourceGetProperties = new GraphResourceGetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedGraphResourceGetProperties.resource + = GraphResourceGetPropertiesResource.fromJson(reader); + } else if ("options".equals(fieldName)) { + deserializedGraphResourceGetProperties.options = GraphResourceGetPropertiesOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourceGetProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetResultsInner.java new file mode 100644 index 000000000000..1a95ae468e58 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetResultsInner.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +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.cosmos.models.GraphResourceGetPropertiesOptions; +import com.azure.resourcemanager.cosmos.models.GraphResourceGetPropertiesResource; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; +import java.io.IOException; +import java.util.Map; + +/** + * An Azure Cosmos DB Graph resource. + */ +@Immutable +public final class GraphResourceGetResultsInner extends ProxyResource { + /* + * The properties of an Azure Cosmos DB Graph resource. + */ + private GraphResourceGetProperties innerProperties; + + /* + * The location of the resource group to which the resource belongs. + */ + private String location; + + /* + * Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping + * this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a + * key no greater than 128 characters and value no greater than 256 characters. For example, the default experience + * for a template type is set with + * \"defaultExperience\": \"Cassandra\". Current \"defaultExperience\" values also include \"Table\", \"Graph\", \"DocumentDB\", and \"MongoDB\" + * . + */ + private Map tags; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GraphResourceGetResultsInner class. + */ + private GraphResourceGetResultsInner() { + } + + /** + * Get the innerProperties property: The properties of an Azure Cosmos DB Graph resource. + * + * @return the innerProperties value. + */ + private GraphResourceGetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the location property: The location of the resource group to which the resource belongs. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the tags property: Tags are a list of key-value pairs that describe the resource. These tags can be used in + * viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. + * Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, + * the default experience for a template type is set with \"defaultExperience\": \"Cassandra\". Current + * \"defaultExperience\" values also include \"Table\", \"Graph\", \"DocumentDB\", and \"MongoDB\". + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the resource property: The resource property. + * + * @return the resource value. + */ + public GraphResourceGetPropertiesResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Get the options property: The options property. + * + * @return the options value. + */ + public GraphResourceGetPropertiesOptions options() { + return this.innerProperties() == null ? null : this.innerProperties().options(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourceGetResultsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourceGetResultsInner 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 GraphResourceGetResultsInner. + */ + public static GraphResourceGetResultsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourceGetResultsInner deserializedGraphResourceGetResultsInner = new GraphResourceGetResultsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.innerProperties + = GraphResourceGetProperties.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.location = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGraphResourceGetResultsInner.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourceGetResultsInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NetworkSecurityPerimeterConfigurationInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NetworkSecurityPerimeterConfigurationInner.java new file mode 100644 index 000000000000..45958799e1d5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NetworkSecurityPerimeterConfigurationInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +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.cosmos.models.NetworkSecurityPerimeterConfigurationProperties; +import java.io.IOException; + +/** + * Network security perimeter (NSP) configuration resource. + */ +@Immutable +public final class NetworkSecurityPerimeterConfigurationInner extends ProxyResource { + /* + * Network security configuration properties. + */ + private NetworkSecurityPerimeterConfigurationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationInner class. + */ + private NetworkSecurityPerimeterConfigurationInner() { + } + + /** + * Get the properties property: Network security configuration properties. + * + * @return the properties value. + */ + public NetworkSecurityPerimeterConfigurationProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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.properties + = NetworkSecurityPerimeterConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionStorageInfoCollectionInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionStorageInfoCollectionInner.java new file mode 100644 index 000000000000..d2d32e770dc7 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionStorageInfoCollectionInner.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.models.PhysicalPartitionStorageInfo; +import java.io.IOException; +import java.util.List; + +/** + * List of physical partitions and their properties returned by a merge operation. + */ +@Immutable +public final class PhysicalPartitionStorageInfoCollectionInner + implements JsonSerializable { + /* + * List of physical partitions and their properties. + */ + private List physicalPartitionStorageInfoCollection; + + /** + * Creates an instance of PhysicalPartitionStorageInfoCollectionInner class. + */ + private PhysicalPartitionStorageInfoCollectionInner() { + } + + /** + * Get the physicalPartitionStorageInfoCollection property: List of physical partitions and their properties. + * + * @return the physicalPartitionStorageInfoCollection value. + */ + public List physicalPartitionStorageInfoCollection() { + return this.physicalPartitionStorageInfoCollection; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (physicalPartitionStorageInfoCollection() != null) { + physicalPartitionStorageInfoCollection().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionStorageInfoCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionStorageInfoCollectionInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PhysicalPartitionStorageInfoCollectionInner. + */ + public static PhysicalPartitionStorageInfoCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionStorageInfoCollectionInner deserializedPhysicalPartitionStorageInfoCollectionInner + = new PhysicalPartitionStorageInfoCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("physicalPartitionStorageInfoCollection".equals(fieldName)) { + List physicalPartitionStorageInfoCollection + = reader.readArray(reader1 -> PhysicalPartitionStorageInfo.fromJson(reader1)); + deserializedPhysicalPartitionStorageInfoCollectionInner.physicalPartitionStorageInfoCollection + = physicalPartitionStorageInfoCollection; + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionStorageInfoCollectionInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultInner.java new file mode 100644 index 000000000000..5b1af924c213 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.ArmResourceProperties; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoResultPropertiesResource; +import java.io.IOException; +import java.util.Map; + +/** + * An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ +@Immutable +public final class PhysicalPartitionThroughputInfoResultInner extends ArmResourceProperties { + /* + * The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object + */ + private PhysicalPartitionThroughputInfoResultProperties innerProperties; + + /* + * The type of Azure resource. + */ + private String type; + + /* + * The name of the ARM resource. + */ + private String name; + + /* + * The unique resource identifier of the ARM resource. + */ + private String id; + + /** + * Creates an instance of PhysicalPartitionThroughputInfoResultInner class. + */ + private PhysicalPartitionThroughputInfoResultInner() { + } + + /** + * Get the innerProperties property: The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult + * object. + * + * @return the innerProperties value. + */ + private PhysicalPartitionThroughputInfoResultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the ARM resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The unique resource identifier of the ARM resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the resource property: properties of physical partition throughput info. + * + * @return the resource value. + */ + public PhysicalPartitionThroughputInfoResultPropertiesResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + 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("identity", identity()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionThroughputInfoResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionThroughputInfoResultInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PhysicalPartitionThroughputInfoResultInner. + */ + public static PhysicalPartitionThroughputInfoResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionThroughputInfoResultInner deserializedPhysicalPartitionThroughputInfoResultInner + = new PhysicalPartitionThroughputInfoResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPhysicalPartitionThroughputInfoResultInner.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultInner + .withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultInner.innerProperties + = PhysicalPartitionThroughputInfoResultProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionThroughputInfoResultInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultProperties.java new file mode 100644 index 000000000000..56cfe13432cd --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultProperties.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.models.PhysicalPartitionThroughputInfoResultPropertiesResource; +import java.io.IOException; + +/** + * The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ +@Immutable +public final class PhysicalPartitionThroughputInfoResultProperties + implements JsonSerializable { + /* + * properties of physical partition throughput info + */ + private PhysicalPartitionThroughputInfoResultPropertiesResource resource; + + /** + * Creates an instance of PhysicalPartitionThroughputInfoResultProperties class. + */ + private PhysicalPartitionThroughputInfoResultProperties() { + } + + /** + * Get the resource property: properties of physical partition throughput info. + * + * @return the resource value. + */ + public PhysicalPartitionThroughputInfoResultPropertiesResource resource() { + return this.resource; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() != null) { + resource().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionThroughputInfoResultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionThroughputInfoResultProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PhysicalPartitionThroughputInfoResultProperties. + */ + public static PhysicalPartitionThroughputInfoResultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionThroughputInfoResultProperties deserializedPhysicalPartitionThroughputInfoResultProperties + = new PhysicalPartitionThroughputInfoResultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultProperties.resource + = PhysicalPartitionThroughputInfoResultPropertiesResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionThroughputInfoResultProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RedistributeThroughputProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RedistributeThroughputProperties.java new file mode 100644 index 000000000000..d971bccf91b3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RedistributeThroughputProperties.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.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.cosmos.models.RedistributeThroughputPropertiesResource; +import java.io.IOException; + +/** + * Properties to redistribute throughput for Azure Cosmos DB resource. + */ +@Fluent +public final class RedistributeThroughputProperties implements JsonSerializable { + /* + * The standard JSON format of a resource throughput + */ + private RedistributeThroughputPropertiesResource resource; + + /** + * Creates an instance of RedistributeThroughputProperties class. + */ + public RedistributeThroughputProperties() { + } + + /** + * Get the resource property: The standard JSON format of a resource throughput. + * + * @return the resource value. + */ + public RedistributeThroughputPropertiesResource resource() { + return this.resource; + } + + /** + * Set the resource property: The standard JSON format of a resource throughput. + * + * @param resource the resource value to set. + * @return the RedistributeThroughputProperties object itself. + */ + public RedistributeThroughputProperties withResource(RedistributeThroughputPropertiesResource resource) { + this.resource = resource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resource in model RedistributeThroughputProperties")); + } else { + resource().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedistributeThroughputProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedistributeThroughputProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedistributeThroughputProperties 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 RedistributeThroughputProperties. + */ + public static RedistributeThroughputProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedistributeThroughputProperties deserializedRedistributeThroughputProperties + = new RedistributeThroughputProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedRedistributeThroughputProperties.resource + = RedistributeThroughputPropertiesResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRedistributeThroughputProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RetrieveThroughputProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RetrieveThroughputProperties.java new file mode 100644 index 000000000000..7d3d036003fa --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RetrieveThroughputProperties.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.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.cosmos.models.RetrieveThroughputPropertiesResource; +import java.io.IOException; + +/** + * Properties to retrieve throughput for Azure Cosmos DB resource. + */ +@Fluent +public final class RetrieveThroughputProperties implements JsonSerializable { + /* + * The standard JSON format of a resource throughput + */ + private RetrieveThroughputPropertiesResource resource; + + /** + * Creates an instance of RetrieveThroughputProperties class. + */ + public RetrieveThroughputProperties() { + } + + /** + * Get the resource property: The standard JSON format of a resource throughput. + * + * @return the resource value. + */ + public RetrieveThroughputPropertiesResource resource() { + return this.resource; + } + + /** + * Set the resource property: The standard JSON format of a resource throughput. + * + * @param resource the resource value to set. + * @return the RetrieveThroughputProperties object itself. + */ + public RetrieveThroughputProperties withResource(RetrieveThroughputPropertiesResource resource) { + this.resource = resource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resource in model RetrieveThroughputProperties")); + } else { + resource().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RetrieveThroughputProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RetrieveThroughputProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RetrieveThroughputProperties 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 RetrieveThroughputProperties. + */ + public static RetrieveThroughputProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RetrieveThroughputProperties deserializedRetrieveThroughputProperties = new RetrieveThroughputProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedRetrieveThroughputProperties.resource + = RetrieveThroughputPropertiesResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRetrieveThroughputProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedDatabaseAccountGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedDatabaseAccountGetResultInner.java new file mode 100644 index 000000000000..ebd4a1e247a5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedDatabaseAccountGetResultInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +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.cosmos.models.SoftDeletedDatabaseAccountProperties; +import java.io.IOException; + +/** + * A Azure Cosmos DB soft-deleted database account. + */ +@Immutable +public final class SoftDeletedDatabaseAccountGetResultInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private SoftDeletedDatabaseAccountProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SoftDeletedDatabaseAccountGetResultInner class. + */ + private SoftDeletedDatabaseAccountGetResultInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SoftDeletedDatabaseAccountProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftDeletedDatabaseAccountGetResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletedDatabaseAccountGetResultInner 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 SoftDeletedDatabaseAccountGetResultInner. + */ + public static SoftDeletedDatabaseAccountGetResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletedDatabaseAccountGetResultInner deserializedSoftDeletedDatabaseAccountGetResultInner + = new SoftDeletedDatabaseAccountGetResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSoftDeletedDatabaseAccountGetResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSoftDeletedDatabaseAccountGetResultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSoftDeletedDatabaseAccountGetResultInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSoftDeletedDatabaseAccountGetResultInner.properties + = SoftDeletedDatabaseAccountProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSoftDeletedDatabaseAccountGetResultInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletedDatabaseAccountGetResultInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedDatabaseAccountsListResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedDatabaseAccountsListResultInner.java new file mode 100644 index 000000000000..9137d504287b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedDatabaseAccountsListResultInner.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The List operation response, that contains the soft-deleted database accounts and their properties. + */ +@Immutable +public final class SoftDeletedDatabaseAccountsListResultInner + implements JsonSerializable { + /* + * The SoftDeletedDatabaseAccountGetResult items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SoftDeletedDatabaseAccountsListResultInner class. + */ + private SoftDeletedDatabaseAccountsListResultInner() { + } + + /** + * Get the value property: The SoftDeletedDatabaseAccountGetResult items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SoftDeletedDatabaseAccountsListResultInner")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SoftDeletedDatabaseAccountsListResultInner.class); + + /** + * {@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 SoftDeletedDatabaseAccountsListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletedDatabaseAccountsListResultInner 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 SoftDeletedDatabaseAccountsListResultInner. + */ + public static SoftDeletedDatabaseAccountsListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletedDatabaseAccountsListResultInner deserializedSoftDeletedDatabaseAccountsListResultInner + = new SoftDeletedDatabaseAccountsListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SoftDeletedDatabaseAccountGetResultInner.fromJson(reader1)); + deserializedSoftDeletedDatabaseAccountsListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSoftDeletedDatabaseAccountsListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletedDatabaseAccountsListResultInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlContainerGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlContainerGetResultInner.java new file mode 100644 index 000000000000..203b56553d12 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlContainerGetResultInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +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.cosmos.models.SoftDeletedSqlContainerProperties; +import java.io.IOException; + +/** + * An Azure Cosmos DB soft-deleted SQL container. + */ +@Immutable +public final class SoftDeletedSqlContainerGetResultInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private SoftDeletedSqlContainerProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SoftDeletedSqlContainerGetResultInner class. + */ + private SoftDeletedSqlContainerGetResultInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SoftDeletedSqlContainerProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftDeletedSqlContainerGetResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletedSqlContainerGetResultInner 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 SoftDeletedSqlContainerGetResultInner. + */ + public static SoftDeletedSqlContainerGetResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletedSqlContainerGetResultInner deserializedSoftDeletedSqlContainerGetResultInner + = new SoftDeletedSqlContainerGetResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSoftDeletedSqlContainerGetResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSoftDeletedSqlContainerGetResultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSoftDeletedSqlContainerGetResultInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSoftDeletedSqlContainerGetResultInner.properties + = SoftDeletedSqlContainerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSoftDeletedSqlContainerGetResultInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletedSqlContainerGetResultInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlContainersListResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlContainersListResultInner.java new file mode 100644 index 000000000000..8859eec73311 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlContainersListResultInner.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The List operation response, that contains the soft-deleted SQL containers and their properties. + */ +@Immutable +public final class SoftDeletedSqlContainersListResultInner + implements JsonSerializable { + /* + * The SoftDeletedSqlContainerGetResult items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SoftDeletedSqlContainersListResultInner class. + */ + private SoftDeletedSqlContainersListResultInner() { + } + + /** + * Get the value property: The SoftDeletedSqlContainerGetResult items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SoftDeletedSqlContainersListResultInner")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SoftDeletedSqlContainersListResultInner.class); + + /** + * {@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 SoftDeletedSqlContainersListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletedSqlContainersListResultInner 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 SoftDeletedSqlContainersListResultInner. + */ + public static SoftDeletedSqlContainersListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletedSqlContainersListResultInner deserializedSoftDeletedSqlContainersListResultInner + = new SoftDeletedSqlContainersListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SoftDeletedSqlContainerGetResultInner.fromJson(reader1)); + deserializedSoftDeletedSqlContainersListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSoftDeletedSqlContainersListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletedSqlContainersListResultInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlDatabaseGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlDatabaseGetResultInner.java new file mode 100644 index 000000000000..259190cd4ad1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlDatabaseGetResultInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +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.cosmos.models.SoftDeletedSqlDatabaseProperties; +import java.io.IOException; + +/** + * An Azure Cosmos DB soft-deleted SQL database. + */ +@Immutable +public final class SoftDeletedSqlDatabaseGetResultInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private SoftDeletedSqlDatabaseProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SoftDeletedSqlDatabaseGetResultInner class. + */ + private SoftDeletedSqlDatabaseGetResultInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SoftDeletedSqlDatabaseProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftDeletedSqlDatabaseGetResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletedSqlDatabaseGetResultInner 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 SoftDeletedSqlDatabaseGetResultInner. + */ + public static SoftDeletedSqlDatabaseGetResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletedSqlDatabaseGetResultInner deserializedSoftDeletedSqlDatabaseGetResultInner + = new SoftDeletedSqlDatabaseGetResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSoftDeletedSqlDatabaseGetResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSoftDeletedSqlDatabaseGetResultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSoftDeletedSqlDatabaseGetResultInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSoftDeletedSqlDatabaseGetResultInner.properties + = SoftDeletedSqlDatabaseProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSoftDeletedSqlDatabaseGetResultInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletedSqlDatabaseGetResultInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlDatabasesListResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlDatabasesListResultInner.java new file mode 100644 index 000000000000..c78cb194eac5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlDatabasesListResultInner.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The List operation response, that contains the soft-deleted SQL databases and their properties. + */ +@Immutable +public final class SoftDeletedSqlDatabasesListResultInner + implements JsonSerializable { + /* + * The SoftDeletedSqlDatabaseGetResult items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SoftDeletedSqlDatabasesListResultInner class. + */ + private SoftDeletedSqlDatabasesListResultInner() { + } + + /** + * Get the value property: The SoftDeletedSqlDatabaseGetResult items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SoftDeletedSqlDatabasesListResultInner")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SoftDeletedSqlDatabasesListResultInner.class); + + /** + * {@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 SoftDeletedSqlDatabasesListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletedSqlDatabasesListResultInner 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 SoftDeletedSqlDatabasesListResultInner. + */ + public static SoftDeletedSqlDatabasesListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletedSqlDatabasesListResultInner deserializedSoftDeletedSqlDatabasesListResultInner + = new SoftDeletedSqlDatabasesListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SoftDeletedSqlDatabaseGetResultInner.fromJson(reader1)); + deserializedSoftDeletedSqlDatabasesListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSoftDeletedSqlDatabasesListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletedSqlDatabasesListResultInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountProperties.java new file mode 100644 index 000000000000..1af7ab51d1d5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountProperties.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.models.Status; +import java.io.IOException; + +/** + * An Azure Cosmos DB Global Database Account which is part of a Throughputpool. + */ +@Fluent +public final class ThroughputPoolAccountProperties implements JsonSerializable { + /* + * A provisioning state of the ThroughputPool Account. + */ + private Status provisioningState; + + /* + * The resource identifier of global database account in the throughputPool. + */ + private String accountResourceIdentifier; + + /* + * The location of global database account in the throughputPool. + */ + private String accountLocation; + + /* + * The instance id of global database account in the throughputPool. + */ + private String accountInstanceId; + + /** + * Creates an instance of ThroughputPoolAccountProperties class. + */ + public ThroughputPoolAccountProperties() { + } + + /** + * Get the provisioningState property: A provisioning state of the ThroughputPool Account. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.provisioningState; + } + + /** + * Get the accountResourceIdentifier property: The resource identifier of global database account in the + * throughputPool. + * + * @return the accountResourceIdentifier value. + */ + public String accountResourceIdentifier() { + return this.accountResourceIdentifier; + } + + /** + * Set the accountResourceIdentifier property: The resource identifier of global database account in the + * throughputPool. + * + * @param accountResourceIdentifier the accountResourceIdentifier value to set. + * @return the ThroughputPoolAccountProperties object itself. + */ + public ThroughputPoolAccountProperties withAccountResourceIdentifier(String accountResourceIdentifier) { + this.accountResourceIdentifier = accountResourceIdentifier; + return this; + } + + /** + * Get the accountLocation property: The location of global database account in the throughputPool. + * + * @return the accountLocation value. + */ + public String accountLocation() { + return this.accountLocation; + } + + /** + * Set the accountLocation property: The location of global database account in the throughputPool. + * + * @param accountLocation the accountLocation value to set. + * @return the ThroughputPoolAccountProperties object itself. + */ + public ThroughputPoolAccountProperties withAccountLocation(String accountLocation) { + this.accountLocation = accountLocation; + return this; + } + + /** + * Get the accountInstanceId property: The instance id of global database account in the throughputPool. + * + * @return the accountInstanceId value. + */ + public String accountInstanceId() { + return this.accountInstanceId; + } + + /** + * 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("accountResourceIdentifier", this.accountResourceIdentifier); + jsonWriter.writeStringField("accountLocation", this.accountLocation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThroughputPoolAccountProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolAccountProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ThroughputPoolAccountProperties. + */ + public static ThroughputPoolAccountProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolAccountProperties deserializedThroughputPoolAccountProperties + = new ThroughputPoolAccountProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedThroughputPoolAccountProperties.provisioningState + = Status.fromString(reader.getString()); + } else if ("accountResourceIdentifier".equals(fieldName)) { + deserializedThroughputPoolAccountProperties.accountResourceIdentifier = reader.getString(); + } else if ("accountLocation".equals(fieldName)) { + deserializedThroughputPoolAccountProperties.accountLocation = reader.getString(); + } else if ("accountInstanceId".equals(fieldName)) { + deserializedThroughputPoolAccountProperties.accountInstanceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolAccountProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountResourceInner.java new file mode 100644 index 000000000000..24436e9a10e6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountResourceInner.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Status; +import java.io.IOException; + +/** + * An Azure Cosmos DB Throughputpool Account. + */ +@Fluent +public final class ThroughputPoolAccountResourceInner extends ProxyResource { + /* + * An Azure Cosmos DB Global Database Account which is part of a Throughputpool. + */ + private ThroughputPoolAccountProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ThroughputPoolAccountResourceInner class. + */ + public ThroughputPoolAccountResourceInner() { + } + + /** + * Get the innerProperties property: An Azure Cosmos DB Global Database Account which is part of a Throughputpool. + * + * @return the innerProperties value. + */ + private ThroughputPoolAccountProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: A provisioning state of the ThroughputPool Account. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the accountResourceIdentifier property: The resource identifier of global database account in the + * throughputPool. + * + * @return the accountResourceIdentifier value. + */ + public String accountResourceIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().accountResourceIdentifier(); + } + + /** + * Set the accountResourceIdentifier property: The resource identifier of global database account in the + * throughputPool. + * + * @param accountResourceIdentifier the accountResourceIdentifier value to set. + * @return the ThroughputPoolAccountResourceInner object itself. + */ + public ThroughputPoolAccountResourceInner withAccountResourceIdentifier(String accountResourceIdentifier) { + if (this.innerProperties() == null) { + this.innerProperties = new ThroughputPoolAccountProperties(); + } + this.innerProperties().withAccountResourceIdentifier(accountResourceIdentifier); + return this; + } + + /** + * Get the accountLocation property: The location of global database account in the throughputPool. + * + * @return the accountLocation value. + */ + public String accountLocation() { + return this.innerProperties() == null ? null : this.innerProperties().accountLocation(); + } + + /** + * Set the accountLocation property: The location of global database account in the throughputPool. + * + * @param accountLocation the accountLocation value to set. + * @return the ThroughputPoolAccountResourceInner object itself. + */ + public ThroughputPoolAccountResourceInner withAccountLocation(String accountLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new ThroughputPoolAccountProperties(); + } + this.innerProperties().withAccountLocation(accountLocation); + return this; + } + + /** + * Get the accountInstanceId property: The instance id of global database account in the throughputPool. + * + * @return the accountInstanceId value. + */ + public String accountInstanceId() { + return this.innerProperties() == null ? null : this.innerProperties().accountInstanceId(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + 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 ThroughputPoolAccountResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolAccountResourceInner 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 ThroughputPoolAccountResourceInner. + */ + public static ThroughputPoolAccountResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolAccountResourceInner deserializedThroughputPoolAccountResourceInner + = new ThroughputPoolAccountResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedThroughputPoolAccountResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedThroughputPoolAccountResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedThroughputPoolAccountResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedThroughputPoolAccountResourceInner.innerProperties + = ThroughputPoolAccountProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedThroughputPoolAccountResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolAccountResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolProperties.java new file mode 100644 index 000000000000..db2903c4740e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolProperties.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.models.Status; +import java.io.IOException; + +/** + * Properties to update Azure Cosmos DB throughput pool. + */ +@Fluent +public final class ThroughputPoolProperties implements JsonSerializable { + /* + * A provisioning state of the ThroughputPool. + */ + private Status provisioningState; + + /* + * Value for throughput to be shared among CosmosDB resources in the pool. + */ + private Integer maxThroughput; + + /** + * Creates an instance of ThroughputPoolProperties class. + */ + public ThroughputPoolProperties() { + } + + /** + * Get the provisioningState property: A provisioning state of the ThroughputPool. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: A provisioning state of the ThroughputPool. + * + * @param provisioningState the provisioningState value to set. + * @return the ThroughputPoolProperties object itself. + */ + public ThroughputPoolProperties withProvisioningState(Status provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the maxThroughput property: Value for throughput to be shared among CosmosDB resources in the pool. + * + * @return the maxThroughput value. + */ + public Integer maxThroughput() { + return this.maxThroughput; + } + + /** + * Set the maxThroughput property: Value for throughput to be shared among CosmosDB resources in the pool. + * + * @param maxThroughput the maxThroughput value to set. + * @return the ThroughputPoolProperties object itself. + */ + public ThroughputPoolProperties withMaxThroughput(Integer maxThroughput) { + this.maxThroughput = maxThroughput; + 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("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + jsonWriter.writeNumberField("maxThroughput", this.maxThroughput); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThroughputPoolProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ThroughputPoolProperties. + */ + public static ThroughputPoolProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolProperties deserializedThroughputPoolProperties = new ThroughputPoolProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedThroughputPoolProperties.provisioningState = Status.fromString(reader.getString()); + } else if ("maxThroughput".equals(fieldName)) { + deserializedThroughputPoolProperties.maxThroughput = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolResourceInner.java new file mode 100644 index 000000000000..db5d7a6c292d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolResourceInner.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Status; +import java.io.IOException; +import java.util.Map; + +/** + * An Azure Cosmos DB Throughputpool. + */ +@Fluent +public final class ThroughputPoolResourceInner extends Resource { + /* + * Properties to update Azure Cosmos DB throughput pool. + */ + private ThroughputPoolProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ThroughputPoolResourceInner class. + */ + public ThroughputPoolResourceInner() { + } + + /** + * Get the innerProperties property: Properties to update Azure Cosmos DB throughput pool. + * + * @return the innerProperties value. + */ + private ThroughputPoolProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ThroughputPoolResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ThroughputPoolResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: A provisioning state of the ThroughputPool. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: A provisioning state of the ThroughputPool. + * + * @param provisioningState the provisioningState value to set. + * @return the ThroughputPoolResourceInner object itself. + */ + public ThroughputPoolResourceInner withProvisioningState(Status provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new ThroughputPoolProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the maxThroughput property: Value for throughput to be shared among CosmosDB resources in the pool. + * + * @return the maxThroughput value. + */ + public Integer maxThroughput() { + return this.innerProperties() == null ? null : this.innerProperties().maxThroughput(); + } + + /** + * Set the maxThroughput property: Value for throughput to be shared among CosmosDB resources in the pool. + * + * @param maxThroughput the maxThroughput value to set. + * @return the ThroughputPoolResourceInner object itself. + */ + public ThroughputPoolResourceInner withMaxThroughput(Integer maxThroughput) { + if (this.innerProperties() == null) { + this.innerProperties = new ThroughputPoolProperties(); + } + this.innerProperties().withMaxThroughput(maxThroughput); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + 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 ThroughputPoolResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolResourceInner 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 ThroughputPoolResourceInner. + */ + public static ThroughputPoolResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolResourceInner deserializedThroughputPoolResourceInner = new ThroughputPoolResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedThroughputPoolResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedThroughputPoolResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedThroughputPoolResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedThroughputPoolResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedThroughputPoolResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedThroughputPoolResourceInner.innerProperties = ThroughputPoolProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedThroughputPoolResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraClustersClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraClustersClientImpl.java index 84fdfb4a4a2e..b7ef874bd48d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraClustersClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraClustersClientImpl.java @@ -34,10 +34,15 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.CassandraClustersClient; +import com.azure.resourcemanager.cosmos.fluent.models.BackupResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CassandraClusterPublicStatusInner; import com.azure.resourcemanager.cosmos.fluent.models.ClusterResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CommandOutputInner; +import com.azure.resourcemanager.cosmos.fluent.models.CommandPublicResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.ListBackups; import com.azure.resourcemanager.cosmos.implementation.models.ListClusters; +import com.azure.resourcemanager.cosmos.implementation.models.ListCommands; +import com.azure.resourcemanager.cosmos.models.CommandAsyncPostBody; import com.azure.resourcemanager.cosmos.models.CommandPostBody; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; @@ -141,6 +146,51 @@ Mono>> invokeCommand(@HostParam("endpoint") String end @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") CommandPostBody body, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommandAsync") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> invokeCommandAsyncResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CommandAsyncPostBody body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCommand(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands/{commandId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCommandAsyncResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("commandId") String commandId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBackups(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBackup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("backupId") String backupId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate") @ExpectedResponses({ 202 }) @@ -183,6 +233,20 @@ Mono> listByResourceGroupNext( Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCommandNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBackupsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -1447,22 +1511,19 @@ public CommandOutputInner invokeCommand(String resourceGroupName, String cluster } /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of - * Cluster Type Production might cause data loss. + * @param body Specification which command to run where. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return resource representing a command along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deallocateWithResponseAsync(String resourceGroupName, String clusterName, - String forceDeallocate) { + public Mono>> invokeCommandAsyncResourceWithResponseAsync(String resourceGroupName, + String clusterName, CommandAsyncPostBody body) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1478,30 +1539,35 @@ public Mono>> deallocateWithResponseAsync(String resou if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deallocate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, clusterName, forceDeallocate, context)) + .withContext(context -> service.invokeCommandAsyncResource(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + contentType, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of - * Cluster Type Production might cause data loss. + * @param body Specification which command to run where. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return resource representing a command along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deallocateWithResponseAsync(String resourceGroupName, String clusterName, - String forceDeallocate, Context context) { + private Mono>> invokeCommandAsyncResourceWithResponseAsync(String resourceGroupName, + String clusterName, CommandAsyncPostBody body, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1517,230 +1583,183 @@ private Mono>> deallocateWithResponseAsync(String reso if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deallocate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, clusterName, forceDeallocate, context); - } - - /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of - * Cluster Type Production might cause data loss. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String clusterName, - String forceDeallocate) { - Mono>> mono - = deallocateWithResponseAsync(resourceGroupName, clusterName, forceDeallocate); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + return service.invokeCommandAsyncResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context); } /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of resource representing a command. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String clusterName) { - final String forceDeallocate = null; + public PollerFlux, CommandPublicResourceInner> + beginInvokeCommandAsyncResourceAsync(String resourceGroupName, String clusterName, CommandAsyncPostBody body) { Mono>> mono - = deallocateWithResponseAsync(resourceGroupName, clusterName, forceDeallocate); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + = invokeCommandAsyncResourceWithResponseAsync(resourceGroupName, clusterName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CommandPublicResourceInner.class, CommandPublicResourceInner.class, this.client.getContext()); } /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of - * Cluster Type Production might cause data loss. + * @param body Specification which command to run where. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of resource representing a command. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String clusterName, - String forceDeallocate, Context context) { + private PollerFlux, CommandPublicResourceInner> + beginInvokeCommandAsyncResourceAsync(String resourceGroupName, String clusterName, CommandAsyncPostBody body, + Context context) { context = this.client.mergeContext(context); Mono>> mono - = deallocateWithResponseAsync(resourceGroupName, clusterName, forceDeallocate, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + = invokeCommandAsyncResourceWithResponseAsync(resourceGroupName, clusterName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CommandPublicResourceInner.class, CommandPublicResourceInner.class, context); } /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of resource representing a command. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeallocate(String resourceGroupName, String clusterName) { - final String forceDeallocate = null; - return this.beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate).getSyncPoller(); + public SyncPoller, CommandPublicResourceInner> + beginInvokeCommandAsyncResource(String resourceGroupName, String clusterName, CommandAsyncPostBody body) { + return this.beginInvokeCommandAsyncResourceAsync(resourceGroupName, clusterName, body).getSyncPoller(); } /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of - * Cluster Type Production might cause data loss. + * @param body Specification which command to run where. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of resource representing a command. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeallocate(String resourceGroupName, String clusterName, - String forceDeallocate, Context context) { - return this.beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate, context).getSyncPoller(); - } - - /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of - * Cluster Type Production might cause data loss. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deallocateAsync(String resourceGroupName, String clusterName, String forceDeallocate) { - return beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate).last() - .flatMap(this.client::getLroFinalResultOrError); + public SyncPoller, CommandPublicResourceInner> + beginInvokeCommandAsyncResource(String resourceGroupName, String clusterName, CommandAsyncPostBody body, + Context context) { + return this.beginInvokeCommandAsyncResourceAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); } /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return resource representing a command on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deallocateAsync(String resourceGroupName, String clusterName) { - final String forceDeallocate = null; - return beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate).last() + public Mono invokeCommandAsyncResourceAsync(String resourceGroupName, + String clusterName, CommandAsyncPostBody body) { + return beginInvokeCommandAsyncResourceAsync(resourceGroupName, clusterName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of - * Cluster Type Production might cause data loss. + * @param body Specification which command to run where. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return resource representing a command on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deallocateAsync(String resourceGroupName, String clusterName, String forceDeallocate, - Context context) { - return beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate, context).last() + private Mono invokeCommandAsyncResourceAsync(String resourceGroupName, + String clusterName, CommandAsyncPostBody body, Context context) { + return beginInvokeCommandAsyncResourceAsync(resourceGroupName, clusterName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 representing a command. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocate(String resourceGroupName, String clusterName) { - final String forceDeallocate = null; - deallocateAsync(resourceGroupName, clusterName, forceDeallocate).block(); + public CommandPublicResourceInner invokeCommandAsyncResource(String resourceGroupName, String clusterName, + CommandAsyncPostBody body) { + return invokeCommandAsyncResourceAsync(resourceGroupName, clusterName, body).block(); } /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of - * Cluster Type Production might cause data loss. + * @param body Specification which command to run where. * @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 representing a command. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocate(String resourceGroupName, String clusterName, String forceDeallocate, Context context) { - deallocateAsync(resourceGroupName, clusterName, forceDeallocate, context).block(); + public CommandPublicResourceInner invokeCommandAsyncResource(String resourceGroupName, String clusterName, + CommandAsyncPostBody body, Context context) { + return invokeCommandAsyncResourceAsync(resourceGroupName, clusterName, body, context).block(); } /** - * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of - * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to - * deallocate the cluster. + * List all commands currently running on ring info. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return list of commands for cluster along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startWithResponseAsync(String resourceGroupName, String clusterName) { + private Mono> listCommandSinglePageAsync(String resourceGroupName, + String clusterName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1756,16 +1775,17 @@ public Mono>> startWithResponseAsync(String resourceGr if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, clusterName, context)) + .withContext(context -> service.listCommand(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, 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())); } /** - * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of - * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to - * deallocate the cluster. + * List all commands currently running on ring info. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. @@ -1773,11 +1793,11 @@ public Mono>> startWithResponseAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return list of commands for cluster along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync(String resourceGroupName, String clusterName, - Context context) { + private Mono> listCommandSinglePageAsync(String resourceGroupName, + String clusterName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1793,34 +1813,33 @@ private Mono>> startWithResponseAsync(String resourceG if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.start(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, context); + return service + .listCommand(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of - * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to - * deallocate the cluster. + * List all commands currently running on ring info. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return list of commands for cluster as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginStartAsync(String resourceGroupName, String clusterName) { - Mono>> mono = startWithResponseAsync(resourceGroupName, clusterName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listCommandAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listCommandSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listCommandNextSinglePageAsync(nextLink)); } /** - * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of - * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to - * deallocate the cluster. + * List all commands currently running on ring info. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. @@ -1828,38 +1847,32 @@ public PollerFlux, Void> beginStartAsync(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return list of commands for cluster as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync(String resourceGroupName, String clusterName, + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCommandAsync(String resourceGroupName, String clusterName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = startWithResponseAsync(resourceGroupName, clusterName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return new PagedFlux<>(() -> listCommandSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listCommandNextSinglePageAsync(nextLink, context)); } /** - * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of - * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to - * deallocate the cluster. + * List all commands currently running on ring info. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return list of commands for cluster as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart(String resourceGroupName, String clusterName) { - return this.beginStartAsync(resourceGroupName, clusterName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCommand(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listCommandAsync(resourceGroupName, clusterName)); } /** - * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of - * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to - * deallocate the cluster. + * List all commands currently running on ring info. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. @@ -1867,16 +1880,855 @@ public SyncPoller, Void> beginStart(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return list of commands for cluster as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart(String resourceGroupName, String clusterName, + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCommand(String resourceGroupName, String clusterName, Context context) { - return this.beginStartAsync(resourceGroupName, clusterName, context).getSyncPoller(); + return new PagedIterable<>(listCommandAsync(resourceGroupName, clusterName, context)); } /** - * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a specified command that was run asynchronously along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getCommandAsyncResourceWithResponseAsync(String resourceGroupName, + String clusterName, String commandId) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (commandId == null) { + return Mono.error(new IllegalArgumentException("Parameter commandId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getCommandAsyncResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, commandId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @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 details about a specified command that was run asynchronously along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCommandAsyncResourceWithResponseAsync( + String resourceGroupName, String clusterName, String commandId, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (commandId == null) { + return Mono.error(new IllegalArgumentException("Parameter commandId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getCommandAsyncResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, commandId, accept, context); + } + + /** + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a specified command that was run asynchronously on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCommandAsyncResourceAsync(String resourceGroupName, String clusterName, + String commandId) { + return getCommandAsyncResourceWithResponseAsync(resourceGroupName, clusterName, commandId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @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 details about a specified command that was run asynchronously along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCommandAsyncResourceWithResponse(String resourceGroupName, + String clusterName, String commandId, Context context) { + return getCommandAsyncResourceWithResponseAsync(resourceGroupName, clusterName, commandId, context).block(); + } + + /** + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a specified command that was run asynchronously. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommandPublicResourceInner getCommandAsyncResource(String resourceGroupName, String clusterName, + String commandId) { + return getCommandAsyncResourceWithResponse(resourceGroupName, clusterName, commandId, Context.NONE).getValue(); + } + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 restorable backups for a Cassandra cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBackupsSinglePageAsync(String resourceGroupName, + String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBackups(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, 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())); + } + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @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 restorable backups for a Cassandra cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBackupsSinglePageAsync(String resourceGroupName, + String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBackups(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 restorable backups for a Cassandra cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listBackupsAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listBackupsSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listBackupsNextSinglePageAsync(nextLink)); + } + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @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 restorable backups for a Cassandra cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBackupsAsync(String resourceGroupName, String clusterName, + Context context) { + return new PagedFlux<>(() -> listBackupsSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listBackupsNextSinglePageAsync(nextLink, context)); + } + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 restorable backups for a Cassandra cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBackups(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listBackupsAsync(resourceGroupName, clusterName)); + } + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @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 restorable backups for a Cassandra cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBackups(String resourceGroupName, String clusterName, + Context context) { + return new PagedIterable<>(listBackupsAsync(resourceGroupName, clusterName, context)); + } + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an individual backup of this cluster that is available to restore along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getBackupWithResponseAsync(String resourceGroupName, String clusterName, + String backupId) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (backupId == null) { + return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getBackup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, backupId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an individual backup of this cluster that is available to restore along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBackupWithResponseAsync(String resourceGroupName, String clusterName, + String backupId, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (backupId == null) { + return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getBackup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, backupId, accept, context); + } + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an individual backup of this cluster that is available to restore on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getBackupAsync(String resourceGroupName, String clusterName, String backupId) { + return getBackupWithResponseAsync(resourceGroupName, clusterName, backupId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an individual backup of this cluster that is available to restore along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBackupWithResponse(String resourceGroupName, String clusterName, + String backupId, Context context) { + return getBackupWithResponseAsync(resourceGroupName, clusterName, backupId, context).block(); + } + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an individual backup of this cluster that is available to restore. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupResourceInner getBackup(String resourceGroupName, String clusterName, String backupId) { + return getBackupWithResponse(resourceGroupName, clusterName, backupId, Context.NONE).getValue(); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deallocateWithResponseAsync(String resourceGroupName, String clusterName, + String forceDeallocate) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.deallocate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, forceDeallocate, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deallocateWithResponseAsync(String resourceGroupName, String clusterName, + String forceDeallocate, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deallocate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, forceDeallocate, context); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String clusterName, + String forceDeallocate) { + Mono>> mono + = deallocateWithResponseAsync(resourceGroupName, clusterName, forceDeallocate); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String clusterName) { + final String forceDeallocate = null; + Mono>> mono + = deallocateWithResponseAsync(resourceGroupName, clusterName, forceDeallocate); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String clusterName, + String forceDeallocate, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deallocateWithResponseAsync(resourceGroupName, clusterName, forceDeallocate, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeallocate(String resourceGroupName, String clusterName) { + final String forceDeallocate = null; + return this.beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate).getSyncPoller(); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeallocate(String resourceGroupName, String clusterName, + String forceDeallocate, Context context) { + return this.beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate, context).getSyncPoller(); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deallocateAsync(String resourceGroupName, String clusterName, String forceDeallocate) { + return beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deallocateAsync(String resourceGroupName, String clusterName) { + final String forceDeallocate = null; + return beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deallocateAsync(String resourceGroupName, String clusterName, String forceDeallocate, + Context context) { + return beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deallocate(String resourceGroupName, String clusterName) { + final String forceDeallocate = null; + deallocateAsync(resourceGroupName, clusterName, forceDeallocate).block(); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deallocate(String resourceGroupName, String clusterName, String forceDeallocate, Context context) { + deallocateAsync(resourceGroupName, clusterName, forceDeallocate, context).block(); + } + + /** + * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of + * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to + * deallocate the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startWithResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of + * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to + * deallocate the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String clusterName, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.start(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, context); + } + + /** + * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of + * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to + * deallocate the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginStartAsync(String resourceGroupName, String clusterName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, clusterName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of + * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to + * deallocate the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceGroupName, String clusterName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, clusterName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of + * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to + * deallocate the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String clusterName) { + return this.beginStartAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of + * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to + * deallocate the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String clusterName, + Context context) { + return this.beginStartAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of * this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to * deallocate the cluster. * @@ -2176,4 +3028,111 @@ private Mono> listBySubscriptionNextSinglePa .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of commands for cluster along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCommandNextSinglePageAsync(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.listCommandNext(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 commands for cluster along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCommandNextSinglePageAsync(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.listCommandNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of restorable backups for a Cassandra cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBackupsNextSinglePageAsync(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.listBackupsNext(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 restorable backups for a Cassandra cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBackupsNextSinglePageAsync(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.listBackupsNext(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/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraResourcesClientImpl.java index 13d29ac31806..6153a75af047 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraResourcesClientImpl.java @@ -37,13 +37,16 @@ import com.azure.resourcemanager.cosmos.fluent.models.CassandraRoleAssignmentResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CassandraRoleDefinitionResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CassandraTableGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraViewGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; import com.azure.resourcemanager.cosmos.implementation.models.CassandraKeyspaceListResult; import com.azure.resourcemanager.cosmos.implementation.models.CassandraRoleAssignmentListResult; import com.azure.resourcemanager.cosmos.implementation.models.CassandraRoleDefinitionListResult; import com.azure.resourcemanager.cosmos.implementation.models.CassandraTableListResult; +import com.azure.resourcemanager.cosmos.implementation.models.CassandraViewListResult; import com.azure.resourcemanager.cosmos.models.CassandraKeyspaceCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.CassandraTableCreateUpdateParameters; +import com.azure.resourcemanager.cosmos.models.CassandraViewCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -163,6 +166,48 @@ Mono>> migrateCassandraTableToManualThroughput(@HostPa @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCassandraViewThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateCassandraViewThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> migrateCassandraViewToAutoscale(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> migrateCassandraViewToManualThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}") @ExpectedResponses({ 200 }) @@ -240,6 +285,45 @@ Mono> listCassandraTables(@HostParam("endpoin @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("keyspaceName") String keyspaceName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCassandraView(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdateCassandraView(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteCassandraView(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCassandraViews(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId}") @ExpectedResponses({ 200 }) @@ -338,6 +422,14 @@ Mono> listCassandraTablesNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCassandraViewsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -2234,20 +2326,22 @@ public ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput } /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response} on successful completion of {@link Mono}. + * @return the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getCassandraKeyspaceWithResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { + public Mono> getCassandraViewThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String viewName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2266,29 +2360,35 @@ public ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context)) + .withContext(context -> service.getCassandraViewThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, viewName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response} on successful completion of {@link Mono}. + * @return the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getCassandraKeyspaceWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName, Context context) { + private Mono> getCassandraViewThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String viewName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2307,84 +2407,97 @@ private Mono> getCassandraKeyspaceWit if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context); + return service.getCassandraViewThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, accept, context); } /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name on - * successful completion of {@link Mono}. + * @return the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getCassandraKeyspaceAsync(String resourceGroupName, - String accountName, String keyspaceName) { - return getCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName) + public Mono getCassandraViewThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + return getCassandraViewThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response}. + * @return the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCassandraKeyspaceWithResponse(String resourceGroupName, - String accountName, String keyspaceName, Context context) { - return getCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName, context).block(); + public Response getCassandraViewThroughputWithResponse(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { + return getCassandraViewThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName, + context).block(); } /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * @return the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CassandraKeyspaceGetResultsInner getCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName) { - return getCassandraKeyspaceWithResponse(resourceGroupName, accountName, keyspaceName, Context.NONE).getValue(); + public ThroughputSettingsGetResultsInner getCassandraViewThroughput(String resourceGroupName, String accountName, + String keyspaceName, String viewName) { + return getCassandraViewThroughputWithResponse(resourceGroupName, accountName, keyspaceName, viewName, + Context.NONE).getValue(); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB Cassandra keyspace along with {@link Response} on successful completion of + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createUpdateCassandraKeyspaceWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + public Mono>> updateCassandraViewThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2403,39 +2516,43 @@ public Mono>> createUpdateCassandraKeyspaceWithRespons if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (createUpdateCassandraKeyspaceParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null.")); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } + if (updateThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); } else { - createUpdateCassandraKeyspaceParameters.validate(); + updateThroughputParameters.validate(); } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateCassandraKeyspace(this.client.getEndpoint(), + .withContext(context -> service.updateCassandraViewThroughput(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, - keyspaceName, contentType, accept, createUpdateCassandraKeyspaceParameters, context)) + keyspaceName, viewName, contentType, accept, updateThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @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 an Azure Cosmos DB Cassandra keyspace along with {@link Response} on successful completion of + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateCassandraKeyspaceWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { + private Mono>> updateCassandraViewThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2454,208 +2571,221 @@ private Mono>> createUpdateCassandraKeyspaceWithRespon if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (createUpdateCassandraKeyspaceParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null.")); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } + if (updateThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); } else { - createUpdateCassandraKeyspaceParameters.validate(); + updateThroughputParameters.validate(); } final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, contentType, accept, - createUpdateCassandraKeyspaceParameters, context); + return service.updateCassandraViewThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, contentType, + accept, updateThroughputParameters, context); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an Azure Cosmos DB Cassandra keyspace. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, CassandraKeyspaceGetResultsInner> - beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { - Mono>> mono = createUpdateCassandraKeyspaceWithResponseAsync(resourceGroupName, - accountName, keyspaceName, createUpdateCassandraKeyspaceParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CassandraKeyspaceGetResultsInner.class, - CassandraKeyspaceGetResultsInner.class, this.client.getContext()); + public PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateCassandraViewThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + Mono>> mono = updateCassandraViewThroughputWithResponseAsync(resourceGroupName, + accountName, keyspaceName, viewName, updateThroughputParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Cassandra keyspace. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CassandraKeyspaceGetResultsInner> - beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { + private PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateCassandraViewThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = createUpdateCassandraKeyspaceWithResponseAsync(resourceGroupName, - accountName, keyspaceName, createUpdateCassandraKeyspaceParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CassandraKeyspaceGetResultsInner.class, - CassandraKeyspaceGetResultsInner.class, context); + Mono>> mono = updateCassandraViewThroughputWithResponseAsync(resourceGroupName, + accountName, keyspaceName, viewName, updateThroughputParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an Azure Cosmos DB Cassandra keyspace. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CassandraKeyspaceGetResultsInner> - beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + public SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateCassandraViewThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters) { return this - .beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, - createUpdateCassandraKeyspaceParameters) + .beginUpdateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + updateThroughputParameters) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Cassandra keyspace. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CassandraKeyspaceGetResultsInner> - beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { + public SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateCassandraViewThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { return this - .beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, - createUpdateCassandraKeyspaceParameters, context) + .beginUpdateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + updateThroughputParameters, context) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB Cassandra keyspace on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateCassandraKeyspaceAsync(String resourceGroupName, - String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { - return beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, - createUpdateCassandraKeyspaceParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono updateCassandraViewThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @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 an Azure Cosmos DB Cassandra keyspace on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateCassandraKeyspaceAsync(String resourceGroupName, - String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { - return beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, - createUpdateCassandraKeyspaceParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono updateCassandraViewThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return beginUpdateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB Cassandra keyspace. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { - return createUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, - createUpdateCassandraKeyspaceParameters).block(); + public ThroughputSettingsGetResultsInner updateCassandraViewThroughput(String resourceGroupName, String accountName, + String keyspaceName, String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + updateThroughputParameters).block(); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @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 an Azure Cosmos DB Cassandra keyspace. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, + public ThroughputSettingsGetResultsInner updateCassandraViewThroughput(String resourceGroupName, String accountName, + String keyspaceName, String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return createUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, - createUpdateCassandraKeyspaceParameters, context).block(); + return updateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + updateThroughputParameters, context).block(); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteCassandraKeyspaceWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName) { + public Mono>> migrateCassandraViewToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2674,13 +2804,1103 @@ public Mono>> deleteCassandraKeyspaceWithResponseAsync if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } + final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.deleteCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, context)) + .withContext(context -> service.migrateCassandraViewToAutoscale(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, viewName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrateCassandraViewToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.migrateCassandraViewToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, accept, context); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName) { + Mono>> mono + = migrateCassandraViewToAutoscaleWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = migrateCassandraViewToAutoscaleWithResponseAsync(resourceGroupName, + accountName, keyspaceName, viewName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + String viewName) { + return this.beginMigrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName) + .getSyncPoller(); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + String viewName, Context context) { + return this + .beginMigrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName, context) + .getSyncPoller(); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono migrateCassandraViewToAutoscaleAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + return beginMigrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrateCassandraViewToAutoscaleAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { + return beginMigrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner migrateCassandraViewToAutoscale(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + return migrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName).block(); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner migrateCassandraViewToAutoscale(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { + return migrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName, context) + .block(); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> migrateCassandraViewToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String viewName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.migrateCassandraViewToManualThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, viewName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrateCassandraViewToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String viewName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.migrateCassandraViewToManualThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, accept, context); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughputAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName) { + Mono>> mono = migrateCassandraViewToManualThroughputWithResponseAsync( + resourceGroupName, accountName, keyspaceName, viewName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughputAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = migrateCassandraViewToManualThroughputWithResponseAsync( + resourceGroupName, accountName, keyspaceName, viewName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName) { + return this + .beginMigrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName) + .getSyncPoller(); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName, Context context) { + return this + .beginMigrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + context) + .getSyncPoller(); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono migrateCassandraViewToManualThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + return beginMigrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrateCassandraViewToManualThroughputAsync( + String resourceGroupName, String accountName, String keyspaceName, String viewName, Context context) { + return beginMigrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner migrateCassandraViewToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + return migrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName) + .block(); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner migrateCassandraViewToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { + return migrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + context).block(); + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> + getCassandraKeyspaceWithResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCassandraKeyspaceWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context); + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCassandraKeyspaceAsync(String resourceGroupName, + String accountName, String keyspaceName) { + return getCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCassandraKeyspaceWithResponse(String resourceGroupName, + String accountName, String keyspaceName, Context context) { + return getCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName, context).block(); + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraKeyspaceGetResultsInner getCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName) { + return getCassandraKeyspaceWithResponse(resourceGroupName, accountName, keyspaceName, Context.NONE).getValue(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Cassandra keyspace along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateCassandraKeyspaceWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (createUpdateCassandraKeyspaceParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null.")); + } else { + createUpdateCassandraKeyspaceParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateCassandraKeyspace(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, contentType, accept, createUpdateCassandraKeyspaceParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @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 an Azure Cosmos DB Cassandra keyspace along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateCassandraKeyspaceWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (createUpdateCassandraKeyspaceParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null.")); + } else { + createUpdateCassandraKeyspaceParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, contentType, accept, + createUpdateCassandraKeyspaceParameters, context); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB Cassandra keyspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, CassandraKeyspaceGetResultsInner> + beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + Mono>> mono = createUpdateCassandraKeyspaceWithResponseAsync(resourceGroupName, + accountName, keyspaceName, createUpdateCassandraKeyspaceParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CassandraKeyspaceGetResultsInner.class, + CassandraKeyspaceGetResultsInner.class, this.client.getContext()); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Cassandra keyspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CassandraKeyspaceGetResultsInner> + beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateCassandraKeyspaceWithResponseAsync(resourceGroupName, + accountName, keyspaceName, createUpdateCassandraKeyspaceParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CassandraKeyspaceGetResultsInner.class, + CassandraKeyspaceGetResultsInner.class, context); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB Cassandra keyspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CassandraKeyspaceGetResultsInner> + beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return this + .beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, + createUpdateCassandraKeyspaceParameters) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Cassandra keyspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CassandraKeyspaceGetResultsInner> + beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { + return this + .beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, + createUpdateCassandraKeyspaceParameters, context) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Cassandra keyspace on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateCassandraKeyspaceAsync(String resourceGroupName, + String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, + createUpdateCassandraKeyspaceParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @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 an Azure Cosmos DB Cassandra keyspace on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateCassandraKeyspaceAsync(String resourceGroupName, + String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { + return beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, + createUpdateCassandraKeyspaceParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Cassandra keyspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return createUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, + createUpdateCassandraKeyspaceParameters).block(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @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 an Azure Cosmos DB Cassandra keyspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, + Context context) { + return createUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, + createUpdateCassandraKeyspaceParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteCassandraKeyspaceWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> service.deleteCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteCassandraKeyspaceWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, context); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(String resourceGroupName, + String accountName, String keyspaceName) { + Mono>> mono + = deleteCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(String resourceGroupName, + String accountName, String keyspaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName) { + return this.beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName, Context context) { + return this.beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { + return beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, + Context context) { + return beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName) { + deleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).block(); + } + /** * Deletes an existing Azure Cosmos DB Cassandra keyspace. * @@ -2691,11 +3911,660 @@ public Mono>> deleteCassandraKeyspaceWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, + Context context) { + deleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context).block(); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the Cassandra keyspaces and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraKeyspacesSinglePageAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listCassandraKeyspaces(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, 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 Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 List operation response, that contains the Cassandra keyspaces and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraKeyspacesSinglePageAsync(String resourceGroupName, String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCassandraKeyspaces(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the Cassandra keyspaces and their properties as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listCassandraKeyspacesAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listCassandraKeyspacesSinglePageAsync(resourceGroupName, accountName), + nextLink -> listCassandraKeyspacesNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 List operation response, that contains the Cassandra keyspaces and their properties as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCassandraKeyspacesAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listCassandraKeyspacesSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listCassandraKeyspacesNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the Cassandra keyspaces and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCassandraKeyspaces(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listCassandraKeyspacesAsync(resourceGroupName, accountName)); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 List operation response, that contains the Cassandra keyspaces and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCassandraKeyspaces(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listCassandraKeyspacesAsync(resourceGroupName, accountName, context)); + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Cassandra table under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @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 Cassandra table under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, accept, context); + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Cassandra table under an existing Azure Cosmos DB database account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCassandraTableAsync(String resourceGroupName, String accountName, + String keyspaceName, String tableName) { + return getCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @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 Cassandra table under an existing Azure Cosmos DB database account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCassandraTableWithResponse(String resourceGroupName, + String accountName, String keyspaceName, String tableName, Context context) { + return getCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, context) + .block(); + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Cassandra table under an existing Azure Cosmos DB database account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraTableGetResultsInner getCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName) { + return getCassandraTableWithResponse(resourceGroupName, accountName, keyspaceName, tableName, Context.NONE) + .getValue(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Cassandra table along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (createUpdateCassandraTableParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraTableParameters is required and cannot be null.")); + } else { + createUpdateCassandraTableParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateCassandraTable(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, tableName, contentType, accept, createUpdateCassandraTableParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 an Azure Cosmos DB Cassandra table along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (createUpdateCassandraTableParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraTableParameters is required and cannot be null.")); + } else { + createUpdateCassandraTableParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, contentType, + accept, createUpdateCassandraTableParameters, context); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB Cassandra table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, CassandraTableGetResultsInner> + beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + Mono>> mono = createUpdateCassandraTableWithResponseAsync(resourceGroupName, + accountName, keyspaceName, tableName, createUpdateCassandraTableParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CassandraTableGetResultsInner.class, CassandraTableGetResultsInner.class, + this.client.getContext()); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Cassandra table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CassandraTableGetResultsInner> + beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateCassandraTableWithResponseAsync(resourceGroupName, + accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CassandraTableGetResultsInner.class, CassandraTableGetResultsInner.class, + context); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB Cassandra table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CassandraTableGetResultsInner> + beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, + String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return this + .beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, + createUpdateCassandraTableParameters) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Cassandra table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CassandraTableGetResultsInner> + beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, + String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, + Context context) { + return this + .beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, + createUpdateCassandraTableParameters, context) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Cassandra table on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateCassandraTableAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, + createUpdateCassandraTableParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 an Azure Cosmos DB Cassandra table on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateCassandraTableAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, Context context) { + return beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, + createUpdateCassandraTableParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Cassandra table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return createUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, + createUpdateCassandraTableParameters).block(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 an Azure Cosmos DB Cassandra table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, Context context) { + return createUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, + createUpdateCassandraTableParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.deleteCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteCassandraKeyspaceWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, Context context) { + private Mono>> deleteCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2714,37 +4583,42 @@ private Mono>> deleteCassandraKeyspaceWithResponseAsyn if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } context = this.client.mergeContext(context); - return service.deleteCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, context); + return service.deleteCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, context); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Deletes an existing Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(String resourceGroupName, - String accountName, String keyspaceName) { + public PollerFlux, Void> beginDeleteCassandraTableAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName) { Mono>> mono - = deleteCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName); + = deleteCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Deletes an existing Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @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. @@ -2752,38 +4626,41 @@ public PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(Stri * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(String resourceGroupName, - String accountName, String keyspaceName, Context context) { + private PollerFlux, Void> beginDeleteCassandraTableAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, Context context) { context = this.client.mergeContext(context); Mono>> mono - = deleteCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName, context); + = deleteCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Deletes an existing Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName) { - return this.beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).getSyncPoller(); + public SyncPoller, Void> beginDeleteCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName) { + return this.beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName) + .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Deletes an existing Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @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. @@ -2791,35 +4668,38 @@ public SyncPoller, Void> beginDeleteCassandraKeyspace(String re * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName, Context context) { - return this.beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context) + public SyncPoller, Void> beginDeleteCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName, Context context) { + return this.beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context) .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Deletes an existing Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { - return beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).last() + public Mono deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName) { + return beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Deletes an existing Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @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. @@ -2827,58 +4707,62 @@ public Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, - Context context) { - return beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context).last() + private Mono deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName, Context context) { + return beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Deletes an existing Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName) { - deleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).block(); + public void deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, + String tableName) { + deleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).block(); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Deletes an existing Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, - Context context) { - deleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context).block(); + public void deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, + String tableName, Context context) { + deleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context).block(); } /** - * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * Lists the Cassandra table under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List operation response, that contains the Cassandra keyspaces and their properties along with + * @return the List operation response, that contains the Cassandra tables and their properties along with * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listCassandraKeyspacesSinglePageAsync(String resourceGroupName, String accountName) { + private Mono> + listCassandraTablesSinglePageAsync(String resourceGroupName, String accountName, String keyspaceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2894,31 +4778,34 @@ public void deleteCassandraKeyspace(String resourceGroupName, String accountName if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listCassandraKeyspaces(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + .withContext(context -> service.listCassandraTables(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, 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 Cassandra keyspaces under an existing Azure Cosmos DB database account. + * Lists the Cassandra table under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. * @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 List operation response, that contains the Cassandra keyspaces and their properties along with + * @return the List operation response, that contains the Cassandra tables and their properties along with * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listCassandraKeyspacesSinglePageAsync(String resourceGroupName, String accountName, Context context) { + private Mono> listCassandraTablesSinglePageAsync( + String resourceGroupName, String accountName, String keyspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2934,103 +4821,111 @@ public void deleteCassandraKeyspace(String resourceGroupName, String accountName if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listCassandraKeyspaces(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .listCassandraTables(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * Lists the Cassandra table under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List operation response, that contains the Cassandra keyspaces and their properties as paginated + * @return the List operation response, that contains the Cassandra tables and their properties as paginated * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listCassandraKeyspacesAsync(String resourceGroupName, - String accountName) { - return new PagedFlux<>(() -> listCassandraKeyspacesSinglePageAsync(resourceGroupName, accountName), - nextLink -> listCassandraKeyspacesNextSinglePageAsync(nextLink)); + public PagedFlux listCassandraTablesAsync(String resourceGroupName, + String accountName, String keyspaceName) { + return new PagedFlux<>(() -> listCassandraTablesSinglePageAsync(resourceGroupName, accountName, keyspaceName), + nextLink -> listCassandraTablesNextSinglePageAsync(nextLink)); } /** - * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * Lists the Cassandra table under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. * @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 List operation response, that contains the Cassandra keyspaces and their properties as paginated + * @return the List operation response, that contains the Cassandra tables and their properties as paginated * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listCassandraKeyspacesAsync(String resourceGroupName, - String accountName, Context context) { - return new PagedFlux<>(() -> listCassandraKeyspacesSinglePageAsync(resourceGroupName, accountName, context), - nextLink -> listCassandraKeyspacesNextSinglePageAsync(nextLink, context)); + private PagedFlux listCassandraTablesAsync(String resourceGroupName, + String accountName, String keyspaceName, Context context) { + return new PagedFlux<>( + () -> listCassandraTablesSinglePageAsync(resourceGroupName, accountName, keyspaceName, context), + nextLink -> listCassandraTablesNextSinglePageAsync(nextLink, context)); } /** - * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * Lists the Cassandra table under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List operation response, that contains the Cassandra keyspaces and their properties as paginated + * @return the List operation response, that contains the Cassandra tables and their properties as paginated * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCassandraKeyspaces(String resourceGroupName, - String accountName) { - return new PagedIterable<>(listCassandraKeyspacesAsync(resourceGroupName, accountName)); + public PagedIterable listCassandraTables(String resourceGroupName, + String accountName, String keyspaceName) { + return new PagedIterable<>(listCassandraTablesAsync(resourceGroupName, accountName, keyspaceName)); } /** - * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * Lists the Cassandra table under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. * @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 List operation response, that contains the Cassandra keyspaces and their properties as paginated + * @return the List operation response, that contains the Cassandra tables and their properties as paginated * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCassandraKeyspaces(String resourceGroupName, - String accountName, Context context) { - return new PagedIterable<>(listCassandraKeyspacesAsync(resourceGroupName, accountName, context)); + public PagedIterable listCassandraTables(String resourceGroupName, + String accountName, String keyspaceName, Context context) { + return new PagedIterable<>(listCassandraTablesAsync(resourceGroupName, accountName, keyspaceName, context)); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Gets the Cassandra view under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Cassandra table under an existing Azure Cosmos DB database account along with {@link Response} on + * @return the Cassandra view under an existing Azure Cosmos DB database account along with {@link Response} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName) { + public Mono> getCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3049,34 +4944,34 @@ public Mono> getCassandraTableWithRespon if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, accept, + .withContext(context -> service.getCassandraView(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Gets the Cassandra view under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @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 Cassandra table under an existing Azure Cosmos DB database account along with {@link Response} on + * @return the Cassandra view under an existing Azure Cosmos DB database account along with {@link Response} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { + private Mono> getCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3095,91 +4990,91 @@ private Mono> getCassandraTableWithRespo if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, accept, context); + return service.getCassandraView(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, accept, context); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Gets the Cassandra view under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Cassandra table under an existing Azure Cosmos DB database account on successful completion of + * @return the Cassandra view under an existing Azure Cosmos DB database account on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getCassandraTableAsync(String resourceGroupName, String accountName, - String keyspaceName, String tableName) { - return getCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName) + public Mono getCassandraViewAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName) { + return getCassandraViewWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Gets the Cassandra view under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @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 Cassandra table under an existing Azure Cosmos DB database account along with {@link Response}. + * @return the Cassandra view under an existing Azure Cosmos DB database account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCassandraTableWithResponse(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { - return getCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, context) + public Response getCassandraViewWithResponse(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { + return getCassandraViewWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName, context) .block(); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Gets the Cassandra view under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Cassandra table under an existing Azure Cosmos DB database account. + * @return the Cassandra view under an existing Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CassandraTableGetResultsInner getCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName) { - return getCassandraTableWithResponse(resourceGroupName, accountName, keyspaceName, tableName, Context.NONE) + public CassandraViewGetResultsInner getCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName) { + return getCassandraViewWithResponse(resourceGroupName, accountName, keyspaceName, viewName, Context.NONE) .getValue(); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB Cassandra table along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB Cassandra view along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createUpdateCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + public Mono>> createUpdateCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3198,42 +5093,42 @@ public Mono>> createUpdateCassandraTableWithResponseAs if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); } - if (createUpdateCassandraTableParameters == null) { + if (createUpdateCassandraViewParameters == null) { return Mono.error(new IllegalArgumentException( - "Parameter createUpdateCassandraTableParameters is required and cannot be null.")); + "Parameter createUpdateCassandraViewParameters is required and cannot be null.")); } else { - createUpdateCassandraTableParameters.validate(); + createUpdateCassandraViewParameters.validate(); } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateCassandraTable(this.client.getEndpoint(), + .withContext(context -> service.createUpdateCassandraView(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, - keyspaceName, tableName, contentType, accept, createUpdateCassandraTableParameters, context)) + keyspaceName, viewName, contentType, accept, createUpdateCassandraViewParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @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 an Azure Cosmos DB Cassandra table along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB Cassandra view along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, Context context) { + private Mono>> createUpdateCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3252,223 +5147,220 @@ private Mono>> createUpdateCassandraTableWithResponseA if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); } - if (createUpdateCassandraTableParameters == null) { + if (createUpdateCassandraViewParameters == null) { return Mono.error(new IllegalArgumentException( - "Parameter createUpdateCassandraTableParameters is required and cannot be null.")); + "Parameter createUpdateCassandraViewParameters is required and cannot be null.")); } else { - createUpdateCassandraTableParameters.validate(); + createUpdateCassandraViewParameters.validate(); } final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, contentType, - accept, createUpdateCassandraTableParameters, context); + return service.createUpdateCassandraView(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, contentType, + accept, createUpdateCassandraViewParameters, context); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an Azure Cosmos DB Cassandra table. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Cassandra view. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, CassandraTableGetResultsInner> - beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { - Mono>> mono = createUpdateCassandraTableWithResponseAsync(resourceGroupName, - accountName, keyspaceName, tableName, createUpdateCassandraTableParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CassandraTableGetResultsInner.class, CassandraTableGetResultsInner.class, + public PollerFlux, CassandraViewGetResultsInner> + beginCreateUpdateCassandraViewAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters) { + Mono>> mono = createUpdateCassandraViewWithResponseAsync(resourceGroupName, + accountName, keyspaceName, viewName, createUpdateCassandraViewParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CassandraViewGetResultsInner.class, CassandraViewGetResultsInner.class, this.client.getContext()); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Cassandra table. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Cassandra view. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CassandraTableGetResultsInner> - beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, - Context context) { + private PollerFlux, CassandraViewGetResultsInner> + beginCreateUpdateCassandraViewAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = createUpdateCassandraTableWithResponseAsync(resourceGroupName, - accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CassandraTableGetResultsInner.class, CassandraTableGetResultsInner.class, + Mono>> mono = createUpdateCassandraViewWithResponseAsync(resourceGroupName, + accountName, keyspaceName, viewName, createUpdateCassandraViewParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CassandraViewGetResultsInner.class, CassandraViewGetResultsInner.class, context); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an Azure Cosmos DB Cassandra table. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Cassandra view. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CassandraTableGetResultsInner> - beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, - String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + public SyncPoller, CassandraViewGetResultsInner> + beginCreateUpdateCassandraView(String resourceGroupName, String accountName, String keyspaceName, + String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters) { return this - .beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, - createUpdateCassandraTableParameters) + .beginCreateUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, + createUpdateCassandraViewParameters) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Cassandra table. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Cassandra view. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CassandraTableGetResultsInner> - beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, - String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, - Context context) { + public SyncPoller, CassandraViewGetResultsInner> + beginCreateUpdateCassandraView(String resourceGroupName, String accountName, String keyspaceName, + String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, Context context) { return this - .beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, - createUpdateCassandraTableParameters, context) + .beginCreateUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, + createUpdateCassandraViewParameters, context) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB Cassandra table on successful completion of {@link Mono}. + * @return an Azure Cosmos DB Cassandra view on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateCassandraTableAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { - return beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, - createUpdateCassandraTableParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono createUpdateCassandraViewAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters) { + return beginCreateUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, + createUpdateCassandraViewParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @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 an Azure Cosmos DB Cassandra table on successful completion of {@link Mono}. + * @return an Azure Cosmos DB Cassandra view on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateCassandraTableAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, Context context) { - return beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, - createUpdateCassandraTableParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono createUpdateCassandraViewAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, Context context) { + return beginCreateUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, + createUpdateCassandraViewParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB Cassandra table. + * @return an Azure Cosmos DB Cassandra view. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { - return createUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, - createUpdateCassandraTableParameters).block(); + public CassandraViewGetResultsInner createUpdateCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters) { + return createUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, + createUpdateCassandraViewParameters).block(); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @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 an Azure Cosmos DB Cassandra table. + * @return an Azure Cosmos DB Cassandra view. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, Context context) { - return createUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, - createUpdateCassandraTableParameters, context).block(); + public CassandraViewGetResultsInner createUpdateCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, + Context context) { + return createUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, + createUpdateCassandraViewParameters, context).block(); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName) { + public Mono>> deleteCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3487,22 +5379,22 @@ public Mono>> deleteCassandraTableWithResponseAsync(St if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); } return FluxUtil - .withContext(context -> service.deleteCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, context)) + .withContext(context -> service.deleteCassandraView(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @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. @@ -3510,8 +5402,8 @@ public Mono>> deleteCassandraTableWithResponseAsync(St * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { + private Mono>> deleteCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3530,42 +5422,42 @@ private Mono>> deleteCassandraTableWithResponseAsync(S if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); } context = this.client.mergeContext(context); - return service.deleteCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, context); + return service.deleteCassandraView(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, context); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteCassandraTableAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName) { + public PollerFlux, Void> beginDeleteCassandraViewAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { Mono>> mono - = deleteCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName); + = deleteCassandraViewWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @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. @@ -3573,41 +5465,41 @@ public PollerFlux, Void> beginDeleteCassandraTableAsync(String * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteCassandraTableAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { + private PollerFlux, Void> beginDeleteCassandraViewAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { context = this.client.mergeContext(context); Mono>> mono - = deleteCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, context); + = deleteCassandraViewWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName) { - return this.beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName) + public SyncPoller, Void> beginDeleteCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName) { + return this.beginDeleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName) .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @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. @@ -3615,38 +5507,38 @@ public SyncPoller, Void> beginDeleteCassandraTable(String resou * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName, Context context) { - return this.beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context) + public SyncPoller, Void> beginDeleteCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName, Context context) { + return this.beginDeleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, context) .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName) { - return beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).last() + public Mono deleteCassandraViewAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName) { + return beginDeleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @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. @@ -3654,49 +5546,49 @@ public Mono deleteCassandraTableAsync(String resourceGroupName, String acc * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName, Context context) { - return beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context).last() + private Mono deleteCassandraViewAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, Context context) { + return beginDeleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, - String tableName) { - deleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).block(); + public void deleteCassandraView(String resourceGroupName, String accountName, String keyspaceName, + String viewName) { + deleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName).block(); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, - String tableName, Context context) { - deleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context).block(); + public void deleteCassandraView(String resourceGroupName, String accountName, String keyspaceName, String viewName, + Context context) { + deleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, context).block(); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -3704,12 +5596,12 @@ public void deleteCassandraTable(String resourceGroupName, String accountName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List operation response, that contains the Cassandra tables and their properties along with + * @return the List operation response, that contains the Cassandra views and their properties along with * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listCassandraTablesSinglePageAsync(String resourceGroupName, String accountName, String keyspaceName) { + private Mono> + listCassandraViewsSinglePageAsync(String resourceGroupName, String accountName, String keyspaceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3730,15 +5622,15 @@ public void deleteCassandraTable(String resourceGroupName, String accountName, S } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listCassandraTables(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.listCassandraViews(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + .>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 Cassandra table under an existing Azure Cosmos DB database account. + * Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -3747,11 +5639,11 @@ public void deleteCassandraTable(String resourceGroupName, String accountName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List operation response, that contains the Cassandra tables and their properties along with + * @return the List operation response, that contains the Cassandra views and their properties along with * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listCassandraTablesSinglePageAsync( + private Mono> listCassandraViewsSinglePageAsync( String resourceGroupName, String accountName, String keyspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -3774,14 +5666,14 @@ private Mono> listCassandraTablesSi final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listCassandraTables(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context) + .listCassandraViews(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, keyspaceName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -3789,18 +5681,18 @@ private Mono> listCassandraTablesSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List operation response, that contains the Cassandra tables and their properties as paginated - * response with {@link PagedFlux}. + * @return the List operation response, that contains the Cassandra views and their properties as paginated response + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listCassandraTablesAsync(String resourceGroupName, - String accountName, String keyspaceName) { - return new PagedFlux<>(() -> listCassandraTablesSinglePageAsync(resourceGroupName, accountName, keyspaceName), - nextLink -> listCassandraTablesNextSinglePageAsync(nextLink)); + public PagedFlux listCassandraViewsAsync(String resourceGroupName, String accountName, + String keyspaceName) { + return new PagedFlux<>(() -> listCassandraViewsSinglePageAsync(resourceGroupName, accountName, keyspaceName), + nextLink -> listCassandraViewsNextSinglePageAsync(nextLink)); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -3809,19 +5701,19 @@ public PagedFlux listCassandraTablesAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List operation response, that contains the Cassandra tables and their properties as paginated - * response with {@link PagedFlux}. + * @return the List operation response, that contains the Cassandra views and their properties as paginated response + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listCassandraTablesAsync(String resourceGroupName, + private PagedFlux listCassandraViewsAsync(String resourceGroupName, String accountName, String keyspaceName, Context context) { return new PagedFlux<>( - () -> listCassandraTablesSinglePageAsync(resourceGroupName, accountName, keyspaceName, context), - nextLink -> listCassandraTablesNextSinglePageAsync(nextLink, context)); + () -> listCassandraViewsSinglePageAsync(resourceGroupName, accountName, keyspaceName, context), + nextLink -> listCassandraViewsNextSinglePageAsync(nextLink, context)); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -3829,17 +5721,17 @@ private PagedFlux listCassandraTablesAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List operation response, that contains the Cassandra tables and their properties as paginated - * response with {@link PagedIterable}. + * @return the List operation response, that contains the Cassandra views and their properties as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCassandraTables(String resourceGroupName, - String accountName, String keyspaceName) { - return new PagedIterable<>(listCassandraTablesAsync(resourceGroupName, accountName, keyspaceName)); + public PagedIterable listCassandraViews(String resourceGroupName, String accountName, + String keyspaceName) { + return new PagedIterable<>(listCassandraViewsAsync(resourceGroupName, accountName, keyspaceName)); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -3848,13 +5740,13 @@ public PagedIterable listCassandraTables(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List operation response, that contains the Cassandra tables and their properties as paginated - * response with {@link PagedIterable}. + * @return the List operation response, that contains the Cassandra views and their properties as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCassandraTables(String resourceGroupName, - String accountName, String keyspaceName, Context context) { - return new PagedIterable<>(listCassandraTablesAsync(resourceGroupName, accountName, keyspaceName, context)); + public PagedIterable listCassandraViews(String resourceGroupName, String accountName, + String keyspaceName, Context context) { + return new PagedIterable<>(listCassandraViewsAsync(resourceGroupName, accountName, keyspaceName, context)); } /** @@ -5596,6 +7488,62 @@ private Mono> listCassandraTablesNe 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 List operation response, that contains the Cassandra views and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCassandraViewsNextSinglePageAsync(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.listCassandraViewsNext(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 List operation response, that contains the Cassandra views and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCassandraViewsNextSinglePageAsync(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.listCassandraViewsNext(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. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ChaosFaultsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ChaosFaultsClientImpl.java new file mode 100644 index 000000000000..52e408982a0f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ChaosFaultsClientImpl.java @@ -0,0 +1,689 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.ChaosFaultsClient; +import com.azure.resourcemanager.cosmos.fluent.models.ChaosFaultResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.ChaosFaultListResponse; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ChaosFaultsClient. + */ +public final class ChaosFaultsClientImpl implements ChaosFaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ChaosFaultsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of ChaosFaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ChaosFaultsClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(ChaosFaultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientChaosFaults to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientChaosFaults") + public interface ChaosFaultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("chaosFault") String chaosFault, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enableDisable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("chaosFault") String chaosFault, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ChaosFaultResourceInner chaosFaultRequest, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault for a CosmosdB account for a particular Chaos Fault along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String chaosFault) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (chaosFault == null) { + return Mono.error(new IllegalArgumentException("Parameter chaosFault is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, chaosFault, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @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 chaos Fault for a CosmosdB account for a particular Chaos Fault along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String chaosFault, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (chaosFault == null) { + return Mono.error(new IllegalArgumentException("Parameter chaosFault is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, chaosFault, accept, context); + } + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault for a CosmosdB account for a particular Chaos Fault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String accountName, String chaosFault) { + return getWithResponseAsync(resourceGroupName, accountName, chaosFault) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @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 chaos Fault for a CosmosdB account for a particular Chaos Fault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String chaosFault, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, chaosFault, context).block(); + } + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault for a CosmosdB account for a particular Chaos Fault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ChaosFaultResourceInner get(String resourceGroupName, String accountName, String chaosFault) { + return getWithResponse(resourceGroupName, accountName, chaosFault, Context.NONE).getValue(); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 request object to enable/disable the chaos fault along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> enableDisableWithResponseAsync(String resourceGroupName, String accountName, + String chaosFault, ChaosFaultResourceInner chaosFaultRequest) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (chaosFault == null) { + return Mono.error(new IllegalArgumentException("Parameter chaosFault is required and cannot be null.")); + } + if (chaosFaultRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter chaosFaultRequest is required and cannot be null.")); + } else { + chaosFaultRequest.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.enableDisable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, chaosFault, contentType, accept, + chaosFaultRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a request object to enable/disable the chaos fault along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableDisableWithResponseAsync(String resourceGroupName, + String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (chaosFault == null) { + return Mono.error(new IllegalArgumentException("Parameter chaosFault is required and cannot be null.")); + } + if (chaosFaultRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter chaosFaultRequest is required and cannot be null.")); + } else { + chaosFaultRequest.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.enableDisable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, chaosFault, contentType, accept, + chaosFaultRequest, context); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ChaosFaultResourceInner> beginEnableDisableAsync( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest) { + Mono>> mono + = enableDisableWithResponseAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ChaosFaultResourceInner.class, ChaosFaultResourceInner.class, + this.client.getContext()); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ChaosFaultResourceInner> beginEnableDisableAsync( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = enableDisableWithResponseAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ChaosFaultResourceInner.class, ChaosFaultResourceInner.class, context); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ChaosFaultResourceInner> beginEnableDisable( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest) { + return this.beginEnableDisableAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest) + .getSyncPoller(); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ChaosFaultResourceInner> beginEnableDisable( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest, + Context context) { + return this.beginEnableDisableAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest, context) + .getSyncPoller(); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 request object to enable/disable the chaos fault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono enableDisableAsync(String resourceGroupName, String accountName, + String chaosFault, ChaosFaultResourceInner chaosFaultRequest) { + return beginEnableDisableAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a request object to enable/disable the chaos fault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableDisableAsync(String resourceGroupName, String accountName, + String chaosFault, ChaosFaultResourceInner chaosFaultRequest, Context context) { + return beginEnableDisableAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ChaosFaultResourceInner enableDisable(String resourceGroupName, String accountName, String chaosFault, + ChaosFaultResourceInner chaosFaultRequest) { + return enableDisableAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest).block(); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ChaosFaultResourceInner enableDisable(String resourceGroupName, String accountName, String chaosFault, + ChaosFaultResourceInner chaosFaultRequest, Context context) { + return enableDisableAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest, context).block(); + } + + /** + * List Chaos Faults for CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault List Response along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, 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())); + } + + /** + * List Chaos Faults for CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 chaos Fault List Response along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName 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(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Chaos Faults for CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault List Response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Chaos Faults for CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 chaos Fault List Response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List Chaos Faults for CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault List Response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * List Chaos Faults for CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 chaos Fault List Response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, 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 chaos Fault List Response 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 chaos Fault List Response 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/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CopyJobsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CopyJobsClientImpl.java new file mode 100644 index 000000000000..35f7e347f3d3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CopyJobsClientImpl.java @@ -0,0 +1,1132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cosmos.fluent.CopyJobsClient; +import com.azure.resourcemanager.cosmos.fluent.models.CopyJobGetResultsInner; +import com.azure.resourcemanager.cosmos.implementation.models.CopyJobFeedResults; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CopyJobsClient. + */ +public final class CopyJobsClientImpl implements CopyJobsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CopyJobsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of CopyJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CopyJobsClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(CopyJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientCopyJobs to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientCopyJobs") + public interface CopyJobsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CopyJobGetResultsInner jobCreateParameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabaseAccount(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/pause") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> pause(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/resume") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> resume(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/complete") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> complete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabaseAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String jobName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String jobName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String accountName, String jobName) { + return getWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CopyJobGetResultsInner get(String resourceGroupName, String accountName, String jobName) { + return getWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String jobName, CopyJobGetResultsInner jobCreateParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobCreateParameters is required and cannot be null.")); + } else { + jobCreateParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, contentType, accept, + jobCreateParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String jobName, CopyJobGetResultsInner jobCreateParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobCreateParameters is required and cannot be null.")); + } else { + jobCreateParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, contentType, accept, jobCreateParameters, context); + } + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync(String resourceGroupName, String accountName, String jobName, + CopyJobGetResultsInner jobCreateParameters) { + return createWithResponseAsync(resourceGroupName, accountName, jobName, jobCreateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String accountName, + String jobName, CopyJobGetResultsInner jobCreateParameters, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, jobName, jobCreateParameters, context).block(); + } + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CopyJobGetResultsInner create(String resourceGroupName, String accountName, String jobName, + CopyJobGetResultsInner jobCreateParameters) { + return createWithResponse(resourceGroupName, accountName, jobName, jobCreateParameters, Context.NONE) + .getValue(); + } + + /** + * Get a list of Copy jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Copy jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountSinglePageAsync(String resourceGroupName, + String accountName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, 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 a list of Copy jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Copy jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountSinglePageAsync(String resourceGroupName, + String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get a list of Copy jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Copy jobs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink)); + } + + /** + * Get a list of Copy jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Copy jobs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a list of Copy jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Copy jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName)); + } + + /** + * Get a list of Copy jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Copy jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName, context)); + } + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> pauseWithResponseAsync(String resourceGroupName, String accountName, + String jobName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.pause(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> pauseWithResponseAsync(String resourceGroupName, String accountName, + String jobName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.pause(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono pauseAsync(String resourceGroupName, String accountName, String jobName) { + return pauseWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response pauseWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return pauseWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CopyJobGetResultsInner pause(String resourceGroupName, String accountName, String jobName) { + return pauseWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> resumeWithResponseAsync(String resourceGroupName, String accountName, + String jobName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.resume(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resumeWithResponseAsync(String resourceGroupName, String accountName, + String jobName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.resume(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono resumeAsync(String resourceGroupName, String accountName, String jobName) { + return resumeWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response resumeWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return resumeWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CopyJobGetResultsInner resume(String resourceGroupName, String accountName, String jobName) { + return resumeWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelWithResponseAsync(String resourceGroupName, String accountName, + String jobName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync(String resourceGroupName, String accountName, + String jobName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelAsync(String resourceGroupName, String accountName, String jobName) { + return cancelWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return cancelWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CopyJobGetResultsInner cancel(String resourceGroupName, String accountName, String jobName) { + return cancelWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> completeWithResponseAsync(String resourceGroupName, + String accountName, String jobName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.complete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> completeWithResponseAsync(String resourceGroupName, + String accountName, String jobName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.complete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono completeAsync(String resourceGroupName, String accountName, String jobName) { + return completeWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response completeWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return completeWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CopyJobGetResultsInner complete(String resourceGroupName, String accountName, String jobName) { + return completeWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Copy jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountNextSinglePageAsync(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.listByDatabaseAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Copy jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountNextSinglePageAsync(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.listByDatabaseAccountNext(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/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientImpl.java index 6b365dea7b94..105150b04231 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientImpl.java @@ -11,21 +11,28 @@ import com.azure.resourcemanager.cosmos.fluent.CassandraClustersClient; import com.azure.resourcemanager.cosmos.fluent.CassandraDataCentersClient; import com.azure.resourcemanager.cosmos.fluent.CassandraResourcesClient; +import com.azure.resourcemanager.cosmos.fluent.ChaosFaultsClient; import com.azure.resourcemanager.cosmos.fluent.CollectionPartitionRegionsClient; import com.azure.resourcemanager.cosmos.fluent.CollectionPartitionsClient; import com.azure.resourcemanager.cosmos.fluent.CollectionRegionsClient; import com.azure.resourcemanager.cosmos.fluent.CollectionsClient; +import com.azure.resourcemanager.cosmos.fluent.CopyJobsClient; import com.azure.resourcemanager.cosmos.fluent.CosmosDBManagementClient; +import com.azure.resourcemanager.cosmos.fluent.DataTransferJobsClient; import com.azure.resourcemanager.cosmos.fluent.DatabaseAccountRegionsClient; import com.azure.resourcemanager.cosmos.fluent.DatabaseAccountsClient; import com.azure.resourcemanager.cosmos.fluent.DatabasesClient; +import com.azure.resourcemanager.cosmos.fluent.FleetAnalyticsClient; import com.azure.resourcemanager.cosmos.fluent.FleetsClient; import com.azure.resourcemanager.cosmos.fluent.FleetspaceAccountsClient; import com.azure.resourcemanager.cosmos.fluent.FleetspacesClient; +import com.azure.resourcemanager.cosmos.fluent.GarnetClustersClient; +import com.azure.resourcemanager.cosmos.fluent.GraphResourcesClient; import com.azure.resourcemanager.cosmos.fluent.GremlinResourcesClient; import com.azure.resourcemanager.cosmos.fluent.LocationsClient; import com.azure.resourcemanager.cosmos.fluent.MongoDBResourcesClient; import com.azure.resourcemanager.cosmos.fluent.MongoMIResourcesClient; +import com.azure.resourcemanager.cosmos.fluent.NetworkSecurityPerimeterConfigurationsClient; import com.azure.resourcemanager.cosmos.fluent.NotebookWorkspacesClient; import com.azure.resourcemanager.cosmos.fluent.OperationsClient; import com.azure.resourcemanager.cosmos.fluent.PartitionKeyRangeIdRegionsClient; @@ -48,8 +55,15 @@ import com.azure.resourcemanager.cosmos.fluent.RestorableTableResourcesClient; import com.azure.resourcemanager.cosmos.fluent.RestorableTablesClient; import com.azure.resourcemanager.cosmos.fluent.ServicesClient; +import com.azure.resourcemanager.cosmos.fluent.SoftDeletedDatabaseAccountsClient; +import com.azure.resourcemanager.cosmos.fluent.SoftDeletedSqlContainersClient; +import com.azure.resourcemanager.cosmos.fluent.SoftDeletedSqlDatabasesClient; import com.azure.resourcemanager.cosmos.fluent.SqlResourcesClient; import com.azure.resourcemanager.cosmos.fluent.TableResourcesClient; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolAccountsClient; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolAccountsOperationsClient; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolsClient; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolsOperationsClient; import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import java.time.Duration; @@ -170,6 +184,34 @@ public DatabaseAccountsClient getDatabaseAccounts() { return this.databaseAccounts; } + /** + * The CopyJobsClient object to access its operations. + */ + private final CopyJobsClient copyJobs; + + /** + * Gets the CopyJobsClient object to access its operations. + * + * @return the CopyJobsClient object. + */ + public CopyJobsClient getCopyJobs() { + return this.copyJobs; + } + + /** + * The GraphResourcesClient object to access its operations. + */ + private final GraphResourcesClient graphResources; + + /** + * Gets the GraphResourcesClient object to access its operations. + * + * @return the GraphResourcesClient object. + */ + public GraphResourcesClient getGraphResources() { + return this.graphResources; + } + /** * The SqlResourcesClient object to access its operations. */ @@ -240,6 +282,48 @@ public GremlinResourcesClient getGremlinResources() { return this.gremlinResources; } + /** + * The DataTransferJobsClient object to access its operations. + */ + private final DataTransferJobsClient dataTransferJobs; + + /** + * Gets the DataTransferJobsClient object to access its operations. + * + * @return the DataTransferJobsClient object. + */ + public DataTransferJobsClient getDataTransferJobs() { + return this.dataTransferJobs; + } + + /** + * The GarnetClustersClient object to access its operations. + */ + private final GarnetClustersClient garnetClusters; + + /** + * Gets the GarnetClustersClient object to access its operations. + * + * @return the GarnetClustersClient object. + */ + public GarnetClustersClient getGarnetClusters() { + return this.garnetClusters; + } + + /** + * The NetworkSecurityPerimeterConfigurationsClient object to access its operations. + */ + private final NetworkSecurityPerimeterConfigurationsClient networkSecurityPerimeterConfigurations; + + /** + * Gets the NetworkSecurityPerimeterConfigurationsClient object to access its operations. + * + * @return the NetworkSecurityPerimeterConfigurationsClient object. + */ + public NetworkSecurityPerimeterConfigurationsClient getNetworkSecurityPerimeterConfigurations() { + return this.networkSecurityPerimeterConfigurations; + } + /** * The NotebookWorkspacesClient object to access its operations. */ @@ -282,6 +366,62 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { return this.privateLinkResources; } + /** + * The SoftDeletedDatabaseAccountsClient object to access its operations. + */ + private final SoftDeletedDatabaseAccountsClient softDeletedDatabaseAccounts; + + /** + * Gets the SoftDeletedDatabaseAccountsClient object to access its operations. + * + * @return the SoftDeletedDatabaseAccountsClient object. + */ + public SoftDeletedDatabaseAccountsClient getSoftDeletedDatabaseAccounts() { + return this.softDeletedDatabaseAccounts; + } + + /** + * The SoftDeletedSqlDatabasesClient object to access its operations. + */ + private final SoftDeletedSqlDatabasesClient softDeletedSqlDatabases; + + /** + * Gets the SoftDeletedSqlDatabasesClient object to access its operations. + * + * @return the SoftDeletedSqlDatabasesClient object. + */ + public SoftDeletedSqlDatabasesClient getSoftDeletedSqlDatabases() { + return this.softDeletedSqlDatabases; + } + + /** + * The SoftDeletedSqlContainersClient object to access its operations. + */ + private final SoftDeletedSqlContainersClient softDeletedSqlContainers; + + /** + * Gets the SoftDeletedSqlContainersClient object to access its operations. + * + * @return the SoftDeletedSqlContainersClient object. + */ + public SoftDeletedSqlContainersClient getSoftDeletedSqlContainers() { + return this.softDeletedSqlContainers; + } + + /** + * The ChaosFaultsClient object to access its operations. + */ + private final ChaosFaultsClient chaosFaults; + + /** + * Gets the ChaosFaultsClient object to access its operations. + * + * @return the ChaosFaultsClient object. + */ + public ChaosFaultsClient getChaosFaults() { + return this.chaosFaults; + } + /** * The DatabasesClient object to access its operations. */ @@ -660,6 +800,62 @@ public ServicesClient getServices() { return this.services; } + /** + * The ThroughputPoolsClient object to access its operations. + */ + private final ThroughputPoolsClient throughputPools; + + /** + * Gets the ThroughputPoolsClient object to access its operations. + * + * @return the ThroughputPoolsClient object. + */ + public ThroughputPoolsClient getThroughputPools() { + return this.throughputPools; + } + + /** + * The ThroughputPoolsOperationsClient object to access its operations. + */ + private final ThroughputPoolsOperationsClient throughputPoolsOperations; + + /** + * Gets the ThroughputPoolsOperationsClient object to access its operations. + * + * @return the ThroughputPoolsOperationsClient object. + */ + public ThroughputPoolsOperationsClient getThroughputPoolsOperations() { + return this.throughputPoolsOperations; + } + + /** + * The ThroughputPoolAccountsClient object to access its operations. + */ + private final ThroughputPoolAccountsClient throughputPoolAccounts; + + /** + * Gets the ThroughputPoolAccountsClient object to access its operations. + * + * @return the ThroughputPoolAccountsClient object. + */ + public ThroughputPoolAccountsClient getThroughputPoolAccounts() { + return this.throughputPoolAccounts; + } + + /** + * The ThroughputPoolAccountsOperationsClient object to access its operations. + */ + private final ThroughputPoolAccountsOperationsClient throughputPoolAccountsOperations; + + /** + * Gets the ThroughputPoolAccountsOperationsClient object to access its operations. + * + * @return the ThroughputPoolAccountsOperationsClient object. + */ + public ThroughputPoolAccountsOperationsClient getThroughputPoolAccountsOperations() { + return this.throughputPoolAccountsOperations; + } + /** * The MongoMIResourcesClient object to access its operations. */ @@ -688,6 +884,20 @@ public FleetsClient getFleets() { return this.fleets; } + /** + * The FleetAnalyticsClient object to access its operations. + */ + private final FleetAnalyticsClient fleetAnalytics; + + /** + * Gets the FleetAnalyticsClient object to access its operations. + * + * @return the FleetAnalyticsClient object. + */ + public FleetAnalyticsClient getFleetAnalytics() { + return this.fleetAnalytics; + } + /** * The FleetspacesClient object to access its operations. */ @@ -734,17 +944,26 @@ public FleetspaceAccountsClient getFleetspaceAccounts() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2026-03-15"; + this.apiVersion = "2026-04-01-preview"; this.operations = new OperationsClientImpl(this); this.databaseAccounts = new DatabaseAccountsClientImpl(this); + this.copyJobs = new CopyJobsClientImpl(this); + this.graphResources = new GraphResourcesClientImpl(this); this.sqlResources = new SqlResourcesClientImpl(this); this.mongoDBResources = new MongoDBResourcesClientImpl(this); this.tableResources = new TableResourcesClientImpl(this); this.cassandraResources = new CassandraResourcesClientImpl(this); this.gremlinResources = new GremlinResourcesClientImpl(this); + this.dataTransferJobs = new DataTransferJobsClientImpl(this); + this.garnetClusters = new GarnetClustersClientImpl(this); + this.networkSecurityPerimeterConfigurations = new NetworkSecurityPerimeterConfigurationsClientImpl(this); this.notebookWorkspaces = new NotebookWorkspacesClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.softDeletedDatabaseAccounts = new SoftDeletedDatabaseAccountsClientImpl(this); + this.softDeletedSqlDatabases = new SoftDeletedSqlDatabasesClientImpl(this); + this.softDeletedSqlContainers = new SoftDeletedSqlContainersClientImpl(this); + this.chaosFaults = new ChaosFaultsClientImpl(this); this.databases = new DatabasesClientImpl(this); this.collections = new CollectionsClientImpl(this); this.collectionRegions = new CollectionRegionsClientImpl(this); @@ -772,8 +991,13 @@ public FleetspaceAccountsClient getFleetspaceAccounts() { this.restorableTables = new RestorableTablesClientImpl(this); this.restorableTableResources = new RestorableTableResourcesClientImpl(this); this.services = new ServicesClientImpl(this); + this.throughputPools = new ThroughputPoolsClientImpl(this); + this.throughputPoolsOperations = new ThroughputPoolsOperationsClientImpl(this); + this.throughputPoolAccounts = new ThroughputPoolAccountsClientImpl(this); + this.throughputPoolAccountsOperations = new ThroughputPoolAccountsOperationsClientImpl(this); this.mongoMIResources = new MongoMIResourcesClientImpl(this); this.fleets = new FleetsClientImpl(this); + this.fleetAnalytics = new FleetAnalyticsClientImpl(this); this.fleetspaces = new FleetspacesClientImpl(this); this.fleetspaceAccounts = new FleetspaceAccountsClientImpl(this); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DataTransferJobsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DataTransferJobsClientImpl.java new file mode 100644 index 000000000000..280c78fe6a2e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DataTransferJobsClientImpl.java @@ -0,0 +1,1141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cosmos.fluent.DataTransferJobsClient; +import com.azure.resourcemanager.cosmos.fluent.models.DataTransferJobGetResultsInner; +import com.azure.resourcemanager.cosmos.implementation.models.DataTransferJobFeedResults; +import com.azure.resourcemanager.cosmos.models.CreateJobRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DataTransferJobsClient. + */ +public final class DataTransferJobsClientImpl implements DataTransferJobsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DataTransferJobsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of DataTransferJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataTransferJobsClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(DataTransferJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientDataTransferJobs to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientDataTransferJobs") + public interface DataTransferJobsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CreateJobRequest jobCreateParameters, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabaseAccount(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> pause(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> resume(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/complete") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> complete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabaseAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String jobName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String jobName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String accountName, String jobName) { + return getWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTransferJobGetResultsInner get(String resourceGroupName, String accountName, String jobName) { + return getWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync(String resourceGroupName, + String accountName, String jobName, CreateJobRequest jobCreateParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobCreateParameters is required and cannot be null.")); + } else { + jobCreateParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, contentType, accept, + jobCreateParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, + String accountName, String jobName, CreateJobRequest jobCreateParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobCreateParameters is required and cannot be null.")); + } else { + jobCreateParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, contentType, accept, jobCreateParameters, context); + } + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync(String resourceGroupName, String accountName, + String jobName, CreateJobRequest jobCreateParameters) { + return createWithResponseAsync(resourceGroupName, accountName, jobName, jobCreateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String accountName, + String jobName, CreateJobRequest jobCreateParameters, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, jobName, jobCreateParameters, context).block(); + } + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTransferJobGetResultsInner create(String resourceGroupName, String accountName, String jobName, + CreateJobRequest jobCreateParameters) { + return createWithResponse(resourceGroupName, accountName, jobName, jobCreateParameters, Context.NONE) + .getValue(); + } + + /** + * Get a list of Data Transfer jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Data Transfer jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDatabaseAccountSinglePageAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, 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 a list of Data Transfer jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Data Transfer jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDatabaseAccountSinglePageAsync(String resourceGroupName, String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get a list of Data Transfer jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Data Transfer jobs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByDatabaseAccountAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink)); + } + + /** + * Get a list of Data Transfer jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Data Transfer jobs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDatabaseAccountAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a list of Data Transfer jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Data Transfer jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName)); + } + + /** + * Get a list of Data Transfer jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Data Transfer jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName, context)); + } + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> pauseWithResponseAsync(String resourceGroupName, + String accountName, String jobName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.pause(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> pauseWithResponseAsync(String resourceGroupName, + String accountName, String jobName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.pause(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono pauseAsync(String resourceGroupName, String accountName, + String jobName) { + return pauseWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response pauseWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return pauseWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTransferJobGetResultsInner pause(String resourceGroupName, String accountName, String jobName) { + return pauseWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> resumeWithResponseAsync(String resourceGroupName, + String accountName, String jobName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.resume(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resumeWithResponseAsync(String resourceGroupName, + String accountName, String jobName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.resume(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono resumeAsync(String resourceGroupName, String accountName, + String jobName) { + return resumeWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response resumeWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return resumeWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTransferJobGetResultsInner resume(String resourceGroupName, String accountName, String jobName) { + return resumeWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelWithResponseAsync(String resourceGroupName, + String accountName, String jobName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync(String resourceGroupName, + String accountName, String jobName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelAsync(String resourceGroupName, String accountName, + String jobName) { + return cancelWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return cancelWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTransferJobGetResultsInner cancel(String resourceGroupName, String accountName, String jobName) { + return cancelWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> completeWithResponseAsync(String resourceGroupName, + String accountName, String jobName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.complete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> completeWithResponseAsync(String resourceGroupName, + String accountName, String jobName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.complete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono completeAsync(String resourceGroupName, String accountName, + String jobName) { + return completeWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response completeWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return completeWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTransferJobGetResultsInner complete(String resourceGroupName, String accountName, String jobName) { + return completeWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Data Transfer jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDatabaseAccountNextSinglePageAsync(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.listByDatabaseAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Data Transfer jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDatabaseAccountNextSinglePageAsync(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.listByDatabaseAccountNext(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/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetAnalyticsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetAnalyticsClientImpl.java new file mode 100644 index 000000000000..546892c15b60 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetAnalyticsClientImpl.java @@ -0,0 +1,820 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.FleetAnalyticsClient; +import com.azure.resourcemanager.cosmos.fluent.models.FleetAnalyticsResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.FleetAnalyticsListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FleetAnalyticsClient. + */ +public final class FleetAnalyticsClientImpl implements FleetAnalyticsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FleetAnalyticsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of FleetAnalyticsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FleetAnalyticsClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(FleetAnalyticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientFleetAnalytics to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientFleetAnalytics") + public interface FleetAnalyticsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @PathParam("fleetAnalyticsName") String fleetAnalyticsName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @PathParam("fleetAnalyticsName") String fleetAnalyticsName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FleetAnalyticsResourceInner body, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @PathParam("fleetAnalyticsName") String fleetAnalyticsName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB FleetAnalytics along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName) { + 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetAnalyticsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fleetAnalyticsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetAnalyticsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @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 an Azure Cosmos DB FleetAnalytics along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName, 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetAnalyticsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fleetAnalyticsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetAnalyticsName, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB FleetAnalytics on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName) { + return getWithResponseAsync(resourceGroupName, fleetName, fleetAnalyticsName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @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 an Azure Cosmos DB FleetAnalytics along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String fleetName, + String fleetAnalyticsName, Context context) { + return getWithResponseAsync(resourceGroupName, fleetName, fleetAnalyticsName, context).block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB FleetAnalytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetAnalyticsResourceInner get(String resourceGroupName, String fleetName, String fleetAnalyticsName) { + return getWithResponse(resourceGroupName, fleetName, fleetAnalyticsName, Context.NONE).getValue(); + } + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB FleetAnalytics along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync(String resourceGroupName, + String fleetName, String fleetAnalyticsName, FleetAnalyticsResourceInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetAnalyticsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fleetAnalyticsName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetAnalyticsName, contentType, accept, + body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @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 an Azure Cosmos DB FleetAnalytics along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, + String fleetName, String fleetAnalyticsName, FleetAnalyticsResourceInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetAnalyticsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fleetAnalyticsName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetAnalyticsName, contentType, accept, body, context); + } + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB FleetAnalytics on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName, FleetAnalyticsResourceInner body) { + return createWithResponseAsync(resourceGroupName, fleetName, fleetAnalyticsName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @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 an Azure Cosmos DB FleetAnalytics along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String fleetName, + String fleetAnalyticsName, FleetAnalyticsResourceInner body, Context context) { + return createWithResponseAsync(resourceGroupName, fleetName, fleetAnalyticsName, body, context).block(); + } + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB FleetAnalytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetAnalyticsResourceInner create(String resourceGroupName, String fleetName, String fleetAnalyticsName, + FleetAnalyticsResourceInner body) { + return createWithResponse(resourceGroupName, fleetName, fleetAnalyticsName, body, Context.NONE).getValue(); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName) { + 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetAnalyticsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fleetAnalyticsName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetAnalyticsName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName, 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetAnalyticsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fleetAnalyticsName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetAnalyticsName, context); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, fleetName, fleetAnalyticsName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, fleetName, fleetAnalyticsName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName, + String fleetAnalyticsName) { + return this.beginDeleteAsync(resourceGroupName, fleetName, fleetAnalyticsName).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName, + String fleetAnalyticsName, Context context) { + return this.beginDeleteAsync(resourceGroupName, fleetName, fleetAnalyticsName, context).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String fleetName, String fleetAnalyticsName) { + return beginDeleteAsync(resourceGroupName, fleetName, fleetAnalyticsName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String fleetName, String fleetAnalyticsName, + Context context) { + return beginDeleteAsync(resourceGroupName, fleetName, fleetAnalyticsName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String fleetName, String fleetAnalyticsName) { + deleteAsync(resourceGroupName, fleetName, fleetAnalyticsName).block(); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String fleetName, String fleetAnalyticsName, Context context) { + deleteAsync(resourceGroupName, fleetName, fleetAnalyticsName, context).block(); + } + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetAnalyticsResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String fleetName) { + 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, 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 all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under 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 the response of a FleetAnalyticsResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String fleetName, 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName 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(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetAnalyticsResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String fleetName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, fleetName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under 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 the response of a FleetAnalyticsResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String fleetName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, fleetName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetAnalyticsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String fleetName) { + return new PagedIterable<>(listAsync(resourceGroupName, fleetName)); + } + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under 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 the response of a FleetAnalyticsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String fleetName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, fleetName, 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 response of a FleetAnalyticsResource list operation 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 response of a FleetAnalyticsResource list operation 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/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GarnetClustersClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GarnetClustersClientImpl.java new file mode 100644 index 000000000000..14d779484eaf --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GarnetClustersClientImpl.java @@ -0,0 +1,1277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.GarnetClustersClient; +import com.azure.resourcemanager.cosmos.fluent.models.GarnetClusterResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.ListGarnetClusters; +import com.azure.resourcemanager.cosmos.models.GarnetClusterResourcePatch; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GarnetClustersClient. + */ +public final class GarnetClustersClientImpl implements InnerSupportsGet, + InnerSupportsListing, InnerSupportsDelete, GarnetClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final GarnetClustersService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of GarnetClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GarnetClustersClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(GarnetClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientGarnetClusters to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientGarnetClusters") + public interface GarnetClustersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/garnetClusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/garnetClusters/{clusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GarnetClusterResourceInner body, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/garnetClusters/{clusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GarnetClusterResourcePatch body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/garnetClusters/{clusterName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/garnetClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/garnetClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @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> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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 properties of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); + } + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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 properties of a Garnet cache cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GarnetClusterResourceInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GarnetClusterResourceInner> + beginCreateUpdateAsync(String resourceGroupName, String clusterName, GarnetClusterResourceInner body) { + Mono>> mono = createUpdateWithResponseAsync(resourceGroupName, clusterName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GarnetClusterResourceInner.class, GarnetClusterResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GarnetClusterResourceInner> beginCreateUpdateAsync( + String resourceGroupName, String clusterName, GarnetClusterResourceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createUpdateWithResponseAsync(resourceGroupName, clusterName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GarnetClusterResourceInner.class, GarnetClusterResourceInner.class, context); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GarnetClusterResourceInner> + beginCreateUpdate(String resourceGroupName, String clusterName, GarnetClusterResourceInner body) { + return this.beginCreateUpdateAsync(resourceGroupName, clusterName, body).getSyncPoller(); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GarnetClusterResourceInner> beginCreateUpdate( + String resourceGroupName, String clusterName, GarnetClusterResourceInner body, Context context) { + return this.beginCreateUpdateAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateAsync(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body) { + return beginCreateUpdateAsync(resourceGroupName, clusterName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateAsync(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body, Context context) { + return beginCreateUpdateAsync(resourceGroupName, clusterName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GarnetClusterResourceInner createUpdate(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body) { + return createUpdateAsync(resourceGroupName, clusterName, body).block(); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GarnetClusterResourceInner createUpdate(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body, Context context) { + return createUpdateAsync(resourceGroupName, clusterName, body, context).block(); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, contentType, accept, body, context); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GarnetClusterResourceInner> + beginUpdateAsync(String resourceGroupName, String clusterName, GarnetClusterResourcePatch body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GarnetClusterResourceInner.class, GarnetClusterResourceInner.class, + this.client.getContext()); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GarnetClusterResourceInner> beginUpdateAsync( + String resourceGroupName, String clusterName, GarnetClusterResourcePatch body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GarnetClusterResourceInner.class, GarnetClusterResourceInner.class, context); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GarnetClusterResourceInner> + beginUpdate(String resourceGroupName, String clusterName, GarnetClusterResourcePatch body) { + return this.beginUpdateAsync(resourceGroupName, clusterName, body).getSyncPoller(); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GarnetClusterResourceInner> + beginUpdate(String resourceGroupName, String clusterName, GarnetClusterResourcePatch body, Context context) { + return this.beginUpdateAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body) { + return beginUpdateAsync(resourceGroupName, clusterName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GarnetClusterResourceInner update(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body) { + return updateAsync(resourceGroupName, clusterName, body).block(); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GarnetClusterResourceInner update(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body, Context context) { + return updateAsync(resourceGroupName, clusterName, body, context).block(); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, context); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { + return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, 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())); + } + + /** + * List all Garnet clusters in this 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. + * @throws 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 Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all Garnet clusters in this 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. + * @throws 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 Garnet clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List all Garnet clusters in this 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. + * @throws 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 Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List all Garnet clusters in this 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 Garnet clusters along with {@link PagedResponse} on successful 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.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())); + } + + /** + * List all Garnet clusters in this 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 list of Garnet clusters along with {@link PagedResponse} on successful 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all Garnet clusters in this 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 Garnet clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all Garnet clusters in this 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 list of Garnet clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Garnet clusters in this 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 Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List all Garnet clusters in this 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 list of Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(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 Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GraphResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GraphResourcesClientImpl.java new file mode 100644 index 000000000000..be38d69a269d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GraphResourcesClientImpl.java @@ -0,0 +1,942 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.GraphResourcesClient; +import com.azure.resourcemanager.cosmos.fluent.models.GraphResourceGetResultsInner; +import com.azure.resourcemanager.cosmos.implementation.models.GraphResourcesListResult; +import com.azure.resourcemanager.cosmos.models.GraphResourceCreateUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GraphResourcesClient. + */ +public final class GraphResourcesClientImpl implements GraphResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final GraphResourcesService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of GraphResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GraphResourcesClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(GraphResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientGraphResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientGraphResources") + public interface GraphResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getGraph(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("graphName") String graphName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdateGraph(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("graphName") String graphName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") GraphResourceCreateUpdateParameters createUpdateGraphParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteGraphResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("graphName") String graphName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGraphs(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGraphsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Graph resource under an existing Azure Cosmos DB database account with the provided name along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGraphWithResponseAsync(String resourceGroupName, + String accountName, String graphName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getGraph(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, graphName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @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 Graph resource under an existing Azure Cosmos DB database account with the provided name along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getGraphWithResponseAsync(String resourceGroupName, + String accountName, String graphName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getGraph(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, graphName, accept, context); + } + + /** + * Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Graph resource under an existing Azure Cosmos DB database account with the provided name on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getGraphAsync(String resourceGroupName, String accountName, + String graphName) { + return getGraphWithResponseAsync(resourceGroupName, accountName, graphName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @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 Graph resource under an existing Azure Cosmos DB database account with the provided name along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGraphWithResponse(String resourceGroupName, String accountName, + String graphName, Context context) { + return getGraphWithResponseAsync(resourceGroupName, accountName, graphName, context).block(); + } + + /** + * Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Graph resource under an existing Azure Cosmos DB database account with the provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GraphResourceGetResultsInner getGraph(String resourceGroupName, String accountName, String graphName) { + return getGraphWithResponse(resourceGroupName, accountName, graphName, Context.NONE).getValue(); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Graph resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateGraphWithResponseAsync(String resourceGroupName, + String accountName, String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + if (createUpdateGraphParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter createUpdateGraphParameters is required and cannot be null.")); + } else { + createUpdateGraphParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateGraph(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, graphName, contentType, accept, + createUpdateGraphParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 an Azure Cosmos DB Graph resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateGraphWithResponseAsync(String resourceGroupName, + String accountName, String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters, + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + if (createUpdateGraphParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter createUpdateGraphParameters is required and cannot be null.")); + } else { + createUpdateGraphParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateGraph(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, graphName, contentType, accept, + createUpdateGraphParameters, context); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GraphResourceGetResultsInner> + beginCreateUpdateGraphAsync(String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters) { + Mono>> mono = createUpdateGraphWithResponseAsync(resourceGroupName, accountName, + graphName, createUpdateGraphParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GraphResourceGetResultsInner.class, GraphResourceGetResultsInner.class, + this.client.getContext()); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GraphResourceGetResultsInner> + beginCreateUpdateGraphAsync(String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateGraphWithResponseAsync(resourceGroupName, accountName, + graphName, createUpdateGraphParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GraphResourceGetResultsInner.class, GraphResourceGetResultsInner.class, + context); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GraphResourceGetResultsInner> beginCreateUpdateGraph( + String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters) { + return this.beginCreateUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GraphResourceGetResultsInner> beginCreateUpdateGraph( + String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters, Context context) { + return this + .beginCreateUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters, + context) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Graph resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateGraphAsync(String resourceGroupName, String accountName, + String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters) { + return beginCreateUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 an Azure Cosmos DB Graph resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateGraphAsync(String resourceGroupName, String accountName, + String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters, Context context) { + return beginCreateUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Graph resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GraphResourceGetResultsInner createUpdateGraph(String resourceGroupName, String accountName, + String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters) { + return createUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters).block(); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 an Azure Cosmos DB Graph resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GraphResourceGetResultsInner createUpdateGraph(String resourceGroupName, String accountName, + String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters, Context context) { + return createUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters, context) + .block(); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteGraphResourceWithResponseAsync(String resourceGroupName, + String accountName, String graphName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.deleteGraphResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, graphName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteGraphResourceWithResponseAsync(String resourceGroupName, + String accountName, String graphName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteGraphResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, graphName, context); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteGraphResourceAsync(String resourceGroupName, + String accountName, String graphName) { + Mono>> mono + = deleteGraphResourceWithResponseAsync(resourceGroupName, accountName, graphName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteGraphResourceAsync(String resourceGroupName, + String accountName, String graphName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteGraphResourceWithResponseAsync(resourceGroupName, accountName, graphName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteGraphResource(String resourceGroupName, String accountName, + String graphName) { + return this.beginDeleteGraphResourceAsync(resourceGroupName, accountName, graphName).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteGraphResource(String resourceGroupName, String accountName, + String graphName, Context context) { + return this.beginDeleteGraphResourceAsync(resourceGroupName, accountName, graphName, context).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteGraphResourceAsync(String resourceGroupName, String accountName, String graphName) { + return beginDeleteGraphResourceAsync(resourceGroupName, accountName, graphName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteGraphResourceAsync(String resourceGroupName, String accountName, String graphName, + Context context) { + return beginDeleteGraphResourceAsync(resourceGroupName, accountName, graphName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteGraphResource(String resourceGroupName, String accountName, String graphName) { + deleteGraphResourceAsync(resourceGroupName, accountName, graphName).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteGraphResource(String resourceGroupName, String accountName, String graphName, Context context) { + deleteGraphResourceAsync(resourceGroupName, accountName, graphName, context).block(); + } + + /** + * Lists the graphs under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the Graph resource and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGraphsSinglePageAsync(String resourceGroupName, + String accountName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listGraphs(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, 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 graphs under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 List operation response, that contains the Graph resource and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGraphsSinglePageAsync(String resourceGroupName, + String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listGraphs(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the graphs under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the Graph resource and their properties as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGraphsAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listGraphsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listGraphsNextSinglePageAsync(nextLink)); + } + + /** + * Lists the graphs under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 List operation response, that contains the Graph resource and their properties as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGraphsAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listGraphsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listGraphsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the graphs under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the Graph resource and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGraphs(String resourceGroupName, String accountName) { + return new PagedIterable<>(listGraphsAsync(resourceGroupName, accountName)); + } + + /** + * Lists the graphs under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 List operation response, that contains the Graph resource and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGraphs(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listGraphsAsync(resourceGroupName, accountName, 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 List operation response, that contains the Graph resource and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGraphsNextSinglePageAsync(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.listGraphsNext(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 List operation response, that contains the Graph resource and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGraphsNextSinglePageAsync(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.listGraphsNext(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/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoDBResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoDBResourcesClientImpl.java index b58abd016152..03ac47b13654 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoDBResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoDBResourcesClientImpl.java @@ -38,16 +38,21 @@ import com.azure.resourcemanager.cosmos.fluent.models.MongoDBDatabaseGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.MongoRoleDefinitionGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.MongoUserDefinitionGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionStorageInfoCollectionInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionThroughputInfoResultInner; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; import com.azure.resourcemanager.cosmos.implementation.models.MongoDBCollectionListResult; import com.azure.resourcemanager.cosmos.implementation.models.MongoDBDatabaseListResult; import com.azure.resourcemanager.cosmos.implementation.models.MongoRoleDefinitionListResult; import com.azure.resourcemanager.cosmos.implementation.models.MongoUserDefinitionListResult; import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation; +import com.azure.resourcemanager.cosmos.models.MergeParameters; import com.azure.resourcemanager.cosmos.models.MongoDBCollectionCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.MongoDBDatabaseCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.MongoRoleDefinitionCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.MongoUserDefinitionCreateUpdateParameters; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -125,6 +130,28 @@ Mono>> migrateMongoDBDatabaseToManualThroughput( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> mongoDBDatabaseRetrieveThroughputDistribution( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RetrieveThroughputParameters retrieveThroughputParameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> mongoDBDatabaseRedistributeThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedistributeThroughputParameters redistributeThroughputParameters, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default") @ExpectedResponses({ 200 }) @@ -147,6 +174,28 @@ Mono>> updateMongoDBCollectionThroughput(@HostParam("e @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> mongoDBContainerRetrieveThroughputDistribution( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RetrieveThroughputParameters retrieveThroughputParameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> mongoDBContainerRedistributeThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedistributeThroughputParameters redistributeThroughputParameters, + Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale") @ExpectedResponses({ 200, 202 }) @@ -206,6 +255,16 @@ Mono> listMongoDBDatabases(@HostParam("endpo @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> mongoDBDatabasePartitionMerge(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MergeParameters mergeParameters, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}") @ExpectedResponses({ 200 }) @@ -246,6 +305,16 @@ Mono> listMongoDBCollections(@HostParam("e @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listMongoDBCollectionPartitionMerge(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MergeParameters mergeParameters, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -1273,22 +1342,23 @@ public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughpu } /** - * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMongoDBCollectionThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName) { + public Mono>> mongoDBDatabaseRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1307,35 +1377,40 @@ public Mono> getMongoDBCollectionThr if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (collectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + if (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getMongoDBCollectionThroughput(this.client.getEndpoint(), + .withContext(context -> service.mongoDBDatabaseRetrieveThroughputDistribution(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseName, collectionName, accept, context)) + databaseName, contentType, accept, retrieveThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. * @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 RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMongoDBCollectionThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) { + private Mono>> mongoDBDatabaseRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1354,99 +1429,227 @@ private Mono> getMongoDBCollectionTh if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (collectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + if (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getMongoDBCollectionThroughput(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, accept, - context); + return service.mongoDBDatabaseRetrieveThroughputDistribution(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, + contentType, accept, retrieveThroughputParameters, context); } /** - * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters) { + Mono>> mono = mongoDBDatabaseRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, retrieveThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = mongoDBDatabaseRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, retrieveThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters) { + return this + .beginMongoDBDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters) + .getSyncPoller(); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return this + .beginMongoDBDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMongoDBCollectionThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName) { - return getMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, - collectionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono mongoDBDatabaseRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return beginMongoDBDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. * @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 RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMongoDBCollectionThroughputWithResponse( - String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) { - return getMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, - collectionName, context).block(); + private Mono mongoDBDatabaseRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return beginMongoDBDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner getMongoDBCollectionThroughput(String resourceGroupName, - String accountName, String databaseName, String collectionName) { - return getMongoDBCollectionThroughputWithResponse(resourceGroupName, accountName, databaseName, collectionName, - Context.NONE).getValue(); + public PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return mongoDBDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters).block(); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateMongoDBCollectionThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { + public PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return mongoDBDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters, context).block(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> mongoDBDatabaseRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1465,44 +1668,40 @@ public Mono>> updateMongoDBCollectionThroughputWithRes if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (collectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); - } - if (updateThroughputParameters == null) { - return Mono.error( - new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); + if (redistributeThroughputParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter redistributeThroughputParameters is required and cannot be null.")); } else { - updateThroughputParameters.validate(); + redistributeThroughputParameters.validate(); } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateMongoDBCollectionThroughput(this.client.getEndpoint(), + .withContext(context -> service.mongoDBDatabaseRedistributeThroughput(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseName, collectionName, contentType, accept, updateThroughputParameters, context)) + databaseName, contentType, accept, redistributeThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. * @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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateMongoDBCollectionThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + private Mono>> mongoDBDatabaseRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1521,212 +1720,1283 @@ private Mono>> updateMongoDBCollectionThroughputWithRe if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (collectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); - } - if (updateThroughputParameters == null) { - return Mono.error( - new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); + if (redistributeThroughputParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter redistributeThroughputParameters is required and cannot be null.")); } else { - updateThroughputParameters.validate(); + redistributeThroughputParameters.validate(); } final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateMongoDBCollectionThroughput(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, contentType, - accept, updateThroughputParameters, context); + return service.mongoDBDatabaseRedistributeThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + redistributeThroughputParameters, context); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - Mono>> mono = updateMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, collectionName, updateThroughputParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughputAsync(String resourceGroupName, String accountName, + String databaseName, RedistributeThroughputParameters redistributeThroughputParameters) { + Mono>> mono = mongoDBDatabaseRedistributeThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, redistributeThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughputAsync(String resourceGroupName, String accountName, + String databaseName, RedistributeThroughputParameters redistributeThroughputParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = updateMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, collectionName, updateThroughputParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + Mono>> mono = mongoDBDatabaseRedistributeThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, redistributeThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, - String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters) { return this - .beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, - updateThroughputParameters) + .beginMongoDBDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters) .getSyncPoller(); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, - String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { return this - .beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + .beginMongoDBDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono mongoDBDatabaseRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return beginMongoDBDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono mongoDBDatabaseRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return beginMongoDBDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters) { + return mongoDBDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters).block(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters, + Context context) { + return mongoDBDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters, context).block(); + } + + /** + * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMongoDBCollectionThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getMongoDBCollectionThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @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 RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getMongoDBCollectionThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getMongoDBCollectionThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, accept, + context); + } + + /** + * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMongoDBCollectionThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, + collectionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @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 RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMongoDBCollectionThroughputWithResponse( + String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) { + return getMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, + collectionName, context).block(); + } + + /** + * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner getMongoDBCollectionThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionThroughputWithResponse(resourceGroupName, accountName, databaseName, collectionName, + Context.NONE).getValue(); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateMongoDBCollectionThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (updateThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); + } else { + updateThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateMongoDBCollectionThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, contentType, accept, updateThroughputParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateMongoDBCollectionThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (updateThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); + } else { + updateThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.updateMongoDBCollectionThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, contentType, + accept, updateThroughputParameters, context); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + Mono>> mono = updateMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, collectionName, updateThroughputParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, collectionName, updateThroughputParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return this + .beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + updateThroughputParameters) + .getSyncPoller(); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return this + .beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters, context) .getSyncPoller(); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateMongoDBCollectionThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateMongoDBCollectionThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner updateMongoDBCollectionThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + updateThroughputParameters).block(); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner updateMongoDBCollectionThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return updateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + updateThroughputParameters, context).block(); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> mongoDBContainerRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.mongoDBContainerRetrieveThroughputDistribution(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, contentType, accept, retrieveThroughputParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> mongoDBContainerRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.mongoDBContainerRetrieveThroughputDistribution(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, + collectionName, contentType, accept, retrieveThroughputParameters, context); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters) { + Mono>> mono = mongoDBContainerRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = mongoDBContainerRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters) { + return this + .beginMongoDBContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + collectionName, retrieveThroughputParameters) + .getSyncPoller(); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context) { + return this + .beginMongoDBContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + collectionName, retrieveThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono mongoDBContainerRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return beginMongoDBContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + collectionName, retrieveThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono mongoDBContainerRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return beginMongoDBContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + collectionName, retrieveThroughputParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionThroughputInfoResultInner mongoDBContainerRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return mongoDBContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + collectionName, retrieveThroughputParameters).block(); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionThroughputInfoResultInner mongoDBContainerRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return mongoDBContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + collectionName, retrieveThroughputParameters, context).block(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> mongoDBContainerRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (redistributeThroughputParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter redistributeThroughputParameters is required and cannot be null.")); + } else { + redistributeThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.mongoDBContainerRedistributeThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, contentType, accept, redistributeThroughputParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> mongoDBContainerRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (redistributeThroughputParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter redistributeThroughputParameters is required and cannot be null.")); + } else { + redistributeThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.mongoDBContainerRedistributeThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, contentType, + accept, redistributeThroughputParameters, context); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters) { + Mono>> mono = mongoDBContainerRedistributeThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = mongoDBContainerRedistributeThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, RedistributeThroughputParameters redistributeThroughputParameters) { + return this + .beginMongoDBContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName, redistributeThroughputParameters) + .getSyncPoller(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return this + .beginMongoDBContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName, redistributeThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateMongoDBCollectionThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, - updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono mongoDBContainerRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return beginMongoDBContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName, redistributeThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. * @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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateMongoDBCollectionThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, - updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono mongoDBContainerRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return beginMongoDBContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName, redistributeThroughputParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB resource throughput. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateMongoDBCollectionThroughput(String resourceGroupName, + public PhysicalPartitionThroughputInfoResultInner mongoDBContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, - updateThroughputParameters).block(); + RedistributeThroughputParameters redistributeThroughputParameters) { + return mongoDBContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + redistributeThroughputParameters).block(); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. * @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 an Azure Cosmos DB resource throughput. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateMongoDBCollectionThroughput(String resourceGroupName, + public PhysicalPartitionThroughputInfoResultInner mongoDBContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return updateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, - updateThroughputParameters, context).block(); + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return mongoDBContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + redistributeThroughputParameters, context).block(); } /** @@ -2958,75 +4228,357 @@ public void deleteMongoDBDatabase(String resourceGroupName, String accountName, } /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the MongoDB databases and their properties as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMongoDBDatabasesAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listMongoDBDatabasesSinglePageAsync(resourceGroupName, accountName), + nextLink -> listMongoDBDatabasesNextSinglePageAsync(nextLink)); + } + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 List operation response, that contains the MongoDB databases and their properties as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMongoDBDatabasesAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listMongoDBDatabasesSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listMongoDBDatabasesNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the MongoDB databases and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoDBDatabases(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listMongoDBDatabasesAsync(resourceGroupName, accountName)); + } + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 List operation response, that contains the MongoDB databases and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoDBDatabases(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listMongoDBDatabasesAsync(resourceGroupName, accountName, context)); + } + + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> mongoDBDatabasePartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); + } else { + mergeParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.mongoDBDatabasePartitionMerge(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, mergeParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> mongoDBDatabasePartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); + } else { + mergeParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.mongoDBDatabasePartitionMerge(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + mergeParameters, context); + } + + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters) { + Mono>> mono = mongoDBDatabasePartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, mergeParameters); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, this.client.getContext()); + } + + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = mongoDBDatabasePartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, mergeParameters, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, context); + } + + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters) { + return this + .beginMongoDBDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters) + .getSyncPoller(); + } + + /** + * Merges the partitions of a MongoDB database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters, Context context) { + return this + .beginMongoDBDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters, + context) + .getSyncPoller(); + } + + /** + * Merges the partitions of a MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 List operation response, that contains the MongoDB databases and their properties as paginated - * response with {@link PagedFlux}. + * @return list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMongoDBDatabasesAsync(String resourceGroupName, - String accountName) { - return new PagedFlux<>(() -> listMongoDBDatabasesSinglePageAsync(resourceGroupName, accountName), - nextLink -> listMongoDBDatabasesNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono mongoDBDatabasePartitionMergeAsync( + String resourceGroupName, String accountName, String databaseName, MergeParameters mergeParameters) { + return beginMongoDBDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Merges the partitions of a MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List operation response, that contains the MongoDB databases and their properties as paginated - * response with {@link PagedFlux}. + * @return list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMongoDBDatabasesAsync(String resourceGroupName, - String accountName, Context context) { - return new PagedFlux<>(() -> listMongoDBDatabasesSinglePageAsync(resourceGroupName, accountName, context), - nextLink -> listMongoDBDatabasesNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono mongoDBDatabasePartitionMergeAsync( + String resourceGroupName, String accountName, String databaseName, MergeParameters mergeParameters, + Context context) { + return beginMongoDBDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Merges the partitions of a MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 List operation response, that contains the MongoDB databases and their properties as paginated - * response with {@link PagedIterable}. + * @return list of physical partitions and their properties returned by a merge operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMongoDBDatabases(String resourceGroupName, - String accountName) { - return new PagedIterable<>(listMongoDBDatabasesAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionStorageInfoCollectionInner mongoDBDatabasePartitionMerge(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters) { + return mongoDBDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters) + .block(); } /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Merges the partitions of a MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List operation response, that contains the MongoDB databases and their properties as paginated - * response with {@link PagedIterable}. + * @return list of physical partitions and their properties returned by a merge operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMongoDBDatabases(String resourceGroupName, - String accountName, Context context) { - return new PagedIterable<>(listMongoDBDatabasesAsync(resourceGroupName, accountName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionStorageInfoCollectionInner mongoDBDatabasePartitionMerge(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters, Context context) { + return mongoDBDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters, + context).block(); } /** @@ -3879,6 +5431,308 @@ public PagedIterable listMongoDBCollections(St return new PagedIterable<>(listMongoDBCollectionsAsync(resourceGroupName, accountName, databaseName, context)); } + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> listMongoDBCollectionPartitionMergeWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + MergeParameters mergeParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); + } else { + mergeParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMongoDBCollectionPartitionMerge(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, contentType, accept, mergeParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listMongoDBCollectionPartitionMergeWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + MergeParameters mergeParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); + } else { + mergeParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMongoDBCollectionPartitionMerge(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, contentType, + accept, mergeParameters, context); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters) { + Mono>> mono = listMongoDBCollectionPartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, collectionName, mergeParameters); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, this.client.getContext()); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = listMongoDBCollectionPartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, collectionName, mergeParameters, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, context); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters) { + return this + .beginListMongoDBCollectionPartitionMergeAsync(resourceGroupName, accountName, databaseName, collectionName, + mergeParameters) + .getSyncPoller(); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters, Context context) { + return this + .beginListMongoDBCollectionPartitionMergeAsync(resourceGroupName, accountName, databaseName, collectionName, + mergeParameters, context) + .getSyncPoller(); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listMongoDBCollectionPartitionMergeAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + MergeParameters mergeParameters) { + return beginListMongoDBCollectionPartitionMergeAsync(resourceGroupName, accountName, databaseName, + collectionName, mergeParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listMongoDBCollectionPartitionMergeAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + MergeParameters mergeParameters, Context context) { + return beginListMongoDBCollectionPartitionMergeAsync(resourceGroupName, accountName, databaseName, + collectionName, mergeParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionStorageInfoCollectionInner listMongoDBCollectionPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String collectionName, MergeParameters mergeParameters) { + return listMongoDBCollectionPartitionMergeAsync(resourceGroupName, accountName, databaseName, collectionName, + mergeParameters).block(); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionStorageInfoCollectionInner listMongoDBCollectionPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String collectionName, MergeParameters mergeParameters, + Context context) { + return listMongoDBCollectionPartitionMergeAsync(resourceGroupName, accountName, databaseName, collectionName, + mergeParameters, context).block(); + } + /** * Retrieves continuous backup information for a Mongodb collection. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java new file mode 100644 index 000000000000..31d1ab85c23a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java @@ -0,0 +1,685 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.NetworkSecurityPerimeterConfigurationsClient; +import com.azure.resourcemanager.cosmos.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import com.azure.resourcemanager.cosmos.implementation.models.NetworkSecurityPerimeterConfigurationListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * NetworkSecurityPerimeterConfigurationsClient. + */ +public final class NetworkSecurityPerimeterConfigurationsClientImpl + implements NetworkSecurityPerimeterConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final NetworkSecurityPerimeterConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of NetworkSecurityPerimeterConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkSecurityPerimeterConfigurationsClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(NetworkSecurityPerimeterConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientNetworkSecurityPerimeterConfigurations to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientNetworkSecurityPerimeterConfigurations") + public interface NetworkSecurityPerimeterConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reconcile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return effective Network Security Perimeter Configuration for association along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String networkSecurityPerimeterConfigurationName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, + networkSecurityPerimeterConfigurationName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 effective Network Security Perimeter Configuration for association along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String networkSecurityPerimeterConfigurationName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, accept, context); + } + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return effective Network Security Perimeter Configuration for association on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + return getWithResponseAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 effective Network Security Perimeter Configuration for association along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String accountName, String networkSecurityPerimeterConfigurationName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context) + .block(); + } + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return effective Network Security Perimeter Configuration for association. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + return getWithResponse(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, Context.NONE) + .getValue(); + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 effective Network Security Perimeter Configuration for cosmos db account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSinglePageAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, 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 list of effective Network Security Perimeter Configuration for cosmos db account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 effective Network Security Perimeter Configuration for cosmos db account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSinglePageAsync(String resourceGroupName, String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName 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(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @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 effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> reconcileWithResponseAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.reconcile(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, + networkSecurityPerimeterConfigurationName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reconcileWithResponseAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.reconcile(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, + context); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginReconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + Mono>> mono + = reconcileWithResponseAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = reconcileWithResponseAsync(resourceGroupName, accountName, + networkSecurityPerimeterConfigurationName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + return this.beginReconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName) + .getSyncPoller(); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + return this + .beginReconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context) + .getSyncPoller(); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono reconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + return beginReconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + return beginReconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + reconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName).block(); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + reconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective Network Security Perimeter Configuration for cosmos db account 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 effective Network Security Perimeter Configuration for cosmos db account 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/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedDatabaseAccountsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedDatabaseAccountsClientImpl.java new file mode 100644 index 000000000000..cbfe551f44ec --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedDatabaseAccountsClientImpl.java @@ -0,0 +1,1036 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.SoftDeletedDatabaseAccountsClient; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedDatabaseAccountGetResultInner; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedDatabaseAccountsListResultInner; +import com.azure.resourcemanager.cosmos.models.SoftDeleteActionKind; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SoftDeletedDatabaseAccountsClient. + */ +public final class SoftDeletedDatabaseAccountsClientImpl implements SoftDeletedDatabaseAccountsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SoftDeletedDatabaseAccountsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of SoftDeletedDatabaseAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SoftDeletedDatabaseAccountsClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(SoftDeletedDatabaseAccountsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientSoftDeletedDatabaseAccounts to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientSoftDeletedDatabaseAccounts") + public interface SoftDeletedDatabaseAccountsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts/{accountName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocation( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupAndLocation( + @HostParam("endpoint") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts/{accountName}?softDeleteActionKind=RestoreSoftDeletedResource") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restore(@HostParam("endpoint") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("accountName") String accountName, @QueryParam("api-version") String apiVersion, + @QueryParam("softDeleteActionKind") SoftDeleteActionKind softDeleteActionKind, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts/{accountName}?softDeleteActionKind=PermanentDeleteResource") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purge(@HostParam("endpoint") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("accountName") String accountName, @QueryParam("api-version") String apiVersion, + @QueryParam("softDeleteActionKind") SoftDeleteActionKind softDeleteActionKind, Context context); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB database account by location and accountName. This + * call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Azure Cosmos DB soft-deleted database account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String location, String accountName) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, accountName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB database account by location and accountName. This + * call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Azure Cosmos DB soft-deleted database account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String location, String accountName, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, location, accountName, accept, context); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB database account by location and accountName. This + * call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Azure Cosmos DB soft-deleted database account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String location, + String accountName) { + return getWithResponseAsync(resourceGroupName, location, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB database account by location and accountName. This + * call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Azure Cosmos DB soft-deleted database account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String location, + String accountName, Context context) { + return getWithResponseAsync(resourceGroupName, location, accountName, context).block(); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB database account by location and accountName. This + * call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Azure Cosmos DB soft-deleted database account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SoftDeletedDatabaseAccountGetResultInner get(String resourceGroupName, String location, String accountName) { + return getWithResponse(resourceGroupName, location, accountName, Context.NONE).getValue(); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the subscription and in a region. + * This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the soft-deleted database accounts and their properties along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listByLocationWithResponseAsync(String location) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByLocation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the subscription and in a region. + * This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param location The name of the Azure region. + * @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 List operation response, that contains the soft-deleted database accounts and their properties along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationWithResponseAsync(String location, + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByLocation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the subscription and in a region. + * This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the soft-deleted database accounts and their properties on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listByLocationAsync(String location) { + return listByLocationWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the subscription and in a region. + * This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param location The name of the Azure region. + * @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 List operation response, that contains the soft-deleted database accounts and their properties along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByLocationWithResponse(String location, + Context context) { + return listByLocationWithResponseAsync(location, context).block(); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the subscription and in a region. + * This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the soft-deleted database accounts and their properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SoftDeletedDatabaseAccountsListResultInner listByLocation(String location) { + return listByLocationWithResponse(location, Context.NONE).getValue(); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the given resource group and in a + * region. This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the soft-deleted database accounts and their properties along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> + listByResourceGroupAndLocationWithResponseAsync(String resourceGroupName, String location) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listByResourceGroupAndLocation(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, location, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the given resource group and in a + * region. This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @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 List operation response, that contains the soft-deleted database accounts and their properties along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupAndLocationWithResponseAsync(String resourceGroupName, String location, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupAndLocation(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, location, this.client.getApiVersion(), accept, context); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the given resource group and in a + * region. This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the soft-deleted database accounts and their properties on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono + listByResourceGroupAndLocationAsync(String resourceGroupName, String location) { + return listByResourceGroupAndLocationWithResponseAsync(resourceGroupName, location) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the given resource group and in a + * region. This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @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 List operation response, that contains the soft-deleted database accounts and their properties along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + listByResourceGroupAndLocationWithResponse(String resourceGroupName, String location, Context context) { + return listByResourceGroupAndLocationWithResponseAsync(resourceGroupName, location, context).block(); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB database accounts available under the given resource group and in a + * region. This call requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the soft-deleted database accounts and their properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SoftDeletedDatabaseAccountsListResultInner listByResourceGroupAndLocation(String resourceGroupName, + String location) { + return listByResourceGroupAndLocationWithResponse(resourceGroupName, location, Context.NONE).getValue(); + } + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restoreWithResponseAsync(String resourceGroupName, String location, + String accountName, SoftDeleteActionKind softDeleteActionKind) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.restore(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, location, accountName, this.client.getApiVersion(), softDeleteActionKind, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreWithResponseAsync(String resourceGroupName, String location, + String accountName, SoftDeleteActionKind softDeleteActionKind, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.restore(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, location, + accountName, this.client.getApiVersion(), softDeleteActionKind, context); + } + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, + String accountName, SoftDeleteActionKind softDeleteActionKind) { + Mono>> mono + = restoreWithResponseAsync(resourceGroupName, location, accountName, softDeleteActionKind); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, + String accountName) { + final SoftDeleteActionKind softDeleteActionKind = null; + Mono>> mono + = restoreWithResponseAsync(resourceGroupName, location, accountName, softDeleteActionKind); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, + String accountName, SoftDeleteActionKind softDeleteActionKind, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = restoreWithResponseAsync(resourceGroupName, location, accountName, softDeleteActionKind, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestore(String resourceGroupName, String location, + String accountName) { + final SoftDeleteActionKind softDeleteActionKind = null; + return this.beginRestoreAsync(resourceGroupName, location, accountName, softDeleteActionKind).getSyncPoller(); + } + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestore(String resourceGroupName, String location, + String accountName, SoftDeleteActionKind softDeleteActionKind, Context context) { + return this.beginRestoreAsync(resourceGroupName, location, accountName, softDeleteActionKind, context) + .getSyncPoller(); + } + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restoreAsync(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind) { + return beginRestoreAsync(resourceGroupName, location, accountName, softDeleteActionKind).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restoreAsync(String resourceGroupName, String location, String accountName) { + final SoftDeleteActionKind softDeleteActionKind = null; + return beginRestoreAsync(resourceGroupName, location, accountName, softDeleteActionKind).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreAsync(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind, Context context) { + return beginRestoreAsync(resourceGroupName, location, accountName, softDeleteActionKind, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restore(String resourceGroupName, String location, String accountName) { + final SoftDeleteActionKind softDeleteActionKind = null; + restoreAsync(resourceGroupName, location, accountName, softDeleteActionKind).block(); + } + + /** + * Restores a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restore(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind, Context context) { + restoreAsync(resourceGroupName, location, accountName, softDeleteActionKind, context).block(); + } + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> purgeWithResponseAsync(String resourceGroupName, String location, + String accountName, SoftDeleteActionKind softDeleteActionKind) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.purge(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, location, accountName, this.client.getApiVersion(), softDeleteActionKind, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeWithResponseAsync(String resourceGroupName, String location, + String accountName, SoftDeleteActionKind softDeleteActionKind, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.purge(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, location, + accountName, this.client.getApiVersion(), softDeleteActionKind, context); + } + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, + String accountName, SoftDeleteActionKind softDeleteActionKind) { + Mono>> mono + = purgeWithResponseAsync(resourceGroupName, location, accountName, softDeleteActionKind); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, + String accountName) { + final SoftDeleteActionKind softDeleteActionKind = null; + Mono>> mono + = purgeWithResponseAsync(resourceGroupName, location, accountName, softDeleteActionKind); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, + String accountName, SoftDeleteActionKind softDeleteActionKind, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = purgeWithResponseAsync(resourceGroupName, location, accountName, softDeleteActionKind, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurge(String resourceGroupName, String location, + String accountName) { + final SoftDeleteActionKind softDeleteActionKind = null; + return this.beginPurgeAsync(resourceGroupName, location, accountName, softDeleteActionKind).getSyncPoller(); + } + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurge(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind, Context context) { + return this.beginPurgeAsync(resourceGroupName, location, accountName, softDeleteActionKind, context) + .getSyncPoller(); + } + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono purgeAsync(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind) { + return beginPurgeAsync(resourceGroupName, location, accountName, softDeleteActionKind).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono purgeAsync(String resourceGroupName, String location, String accountName) { + final SoftDeleteActionKind softDeleteActionKind = null; + return beginPurgeAsync(resourceGroupName, location, accountName, softDeleteActionKind).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeAsync(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind, Context context) { + return beginPurgeAsync(resourceGroupName, location, accountName, softDeleteActionKind, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purge(String resourceGroupName, String location, String accountName) { + final SoftDeleteActionKind softDeleteActionKind = null; + purgeAsync(resourceGroupName, location, accountName, softDeleteActionKind).block(); + } + + /** + * Permanently deletes (purges) a soft-deleted Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purge(String resourceGroupName, String location, String accountName, + SoftDeleteActionKind softDeleteActionKind, Context context) { + purgeAsync(resourceGroupName, location, accountName, softDeleteActionKind, context).block(); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedSqlContainersClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedSqlContainersClientImpl.java new file mode 100644 index 000000000000..f7205c4bef01 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedSqlContainersClientImpl.java @@ -0,0 +1,1073 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.SoftDeletedSqlContainersClient; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedSqlContainerGetResultInner; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedSqlContainersListResultInner; +import com.azure.resourcemanager.cosmos.models.SoftDeleteActionKind; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SoftDeletedSqlContainersClient. + */ +public final class SoftDeletedSqlContainersClientImpl implements SoftDeletedSqlContainersClient { + /** + * The proxy service used to perform REST calls. + */ + private final SoftDeletedSqlContainersService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of SoftDeletedSqlContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SoftDeletedSqlContainersClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(SoftDeletedSqlContainersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientSoftDeletedSqlContainers to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientSoftDeletedSqlContainers") + public interface SoftDeletedSqlContainersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts/{accountName}/softDeletedSqlDatabases/{databaseName}/softDeletedSqlContainers/{containerName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, + @PathParam("containerName") String containerName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts/{accountName}/softDeletedSqlDatabases/{databaseName}/softDeletedSqlContainers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts/{accountName}/softDeletedSqlDatabases/{databaseName}/softDeletedSqlContainers/{containerName}?softDeleteActionKind=RestoreSoftDeletedResource") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restore(@HostParam("endpoint") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, + @PathParam("containerName") String containerName, @QueryParam("api-version") String apiVersion, + @QueryParam("softDeleteActionKind") SoftDeleteActionKind softDeleteActionKind, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts/{accountName}/softDeletedSqlDatabases/{databaseName}/softDeletedSqlContainers/{containerName}?softDeleteActionKind=PermanentDeleteResource") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purge(@HostParam("endpoint") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, + @PathParam("containerName") String containerName, @QueryParam("api-version") String apiVersion, + @QueryParam("softDeleteActionKind") SoftDeleteActionKind softDeleteActionKind, Context context); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL container. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB soft-deleted SQL container along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String location, String accountName, String databaseName, String containerName) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, accountName, databaseName, containerName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL container. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @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 an Azure Cosmos DB soft-deleted SQL container along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String location, String accountName, String databaseName, String containerName, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, location, accountName, databaseName, containerName, accept, context); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL container. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB soft-deleted SQL container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName) { + return getWithResponseAsync(resourceGroupName, location, accountName, databaseName, containerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL container. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @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 an Azure Cosmos DB soft-deleted SQL container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, Context context) { + return getWithResponseAsync(resourceGroupName, location, accountName, databaseName, containerName, context) + .block(); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL container. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB soft-deleted SQL container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SoftDeletedSqlContainerGetResultInner get(String resourceGroupName, String location, String accountName, + String databaseName, String containerName) { + return getWithResponse(resourceGroupName, location, accountName, databaseName, containerName, Context.NONE) + .getValue(); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL containers under a soft-deleted SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the soft-deleted SQL containers and their properties along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listWithResponseAsync(String resourceGroupName, + String location, String accountName, String databaseName) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, accountName, databaseName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL containers under a soft-deleted SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @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 List operation response, that contains the soft-deleted SQL containers and their properties along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String location, String accountName, String databaseName, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName 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(), this.client.getSubscriptionId(), + resourceGroupName, location, accountName, databaseName, accept, context); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL containers under a soft-deleted SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the soft-deleted SQL containers and their properties on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAsync(String resourceGroupName, String location, + String accountName, String databaseName) { + return listWithResponseAsync(resourceGroupName, location, accountName, databaseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL containers under a soft-deleted SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @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 List operation response, that contains the soft-deleted SQL containers and their properties along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String location, + String accountName, String databaseName, Context context) { + return listWithResponseAsync(resourceGroupName, location, accountName, databaseName, context).block(); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL containers under a soft-deleted SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/softDeletedSqlContainers/read' + * permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the soft-deleted SQL containers and their properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SoftDeletedSqlContainersListResultInner list(String resourceGroupName, String location, String accountName, + String databaseName) { + return listWithResponse(resourceGroupName, location, accountName, databaseName, Context.NONE).getValue(); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restoreWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.restore(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, location, accountName, databaseName, containerName, this.client.getApiVersion(), + softDeleteActionKind, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind, + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.restore(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, location, + accountName, databaseName, containerName, this.client.getApiVersion(), softDeleteActionKind, context); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind) { + Mono>> mono = restoreWithResponseAsync(resourceGroupName, location, accountName, + databaseName, containerName, softDeleteActionKind); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName) { + final SoftDeleteActionKind softDeleteActionKind = null; + Mono>> mono = restoreWithResponseAsync(resourceGroupName, location, accountName, + databaseName, containerName, softDeleteActionKind); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = restoreWithResponseAsync(resourceGroupName, location, accountName, + databaseName, containerName, softDeleteActionKind, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestore(String resourceGroupName, String location, + String accountName, String databaseName, String containerName) { + final SoftDeleteActionKind softDeleteActionKind = null; + return this + .beginRestoreAsync(resourceGroupName, location, accountName, databaseName, containerName, + softDeleteActionKind) + .getSyncPoller(); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestore(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind, + Context context) { + return this + .beginRestoreAsync(resourceGroupName, location, accountName, databaseName, containerName, + softDeleteActionKind, context) + .getSyncPoller(); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restoreAsync(String resourceGroupName, String location, String accountName, String databaseName, + String containerName, SoftDeleteActionKind softDeleteActionKind) { + return beginRestoreAsync(resourceGroupName, location, accountName, databaseName, containerName, + softDeleteActionKind).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restoreAsync(String resourceGroupName, String location, String accountName, String databaseName, + String containerName) { + final SoftDeleteActionKind softDeleteActionKind = null; + return beginRestoreAsync(resourceGroupName, location, accountName, databaseName, containerName, + softDeleteActionKind).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreAsync(String resourceGroupName, String location, String accountName, String databaseName, + String containerName, SoftDeleteActionKind softDeleteActionKind, Context context) { + return beginRestoreAsync(resourceGroupName, location, accountName, databaseName, containerName, + softDeleteActionKind, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restore(String resourceGroupName, String location, String accountName, String databaseName, + String containerName) { + final SoftDeleteActionKind softDeleteActionKind = null; + restoreAsync(resourceGroupName, location, accountName, databaseName, containerName, softDeleteActionKind) + .block(); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL container to active state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restore(String resourceGroupName, String location, String accountName, String databaseName, + String containerName, SoftDeleteActionKind softDeleteActionKind, Context context) { + restoreAsync(resourceGroupName, location, accountName, databaseName, containerName, softDeleteActionKind, + context).block(); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> purgeWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.purge(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, location, accountName, databaseName, containerName, this.client.getApiVersion(), + softDeleteActionKind, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind, + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.purge(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, location, + accountName, databaseName, containerName, this.client.getApiVersion(), softDeleteActionKind, context); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind) { + Mono>> mono = purgeWithResponseAsync(resourceGroupName, location, accountName, + databaseName, containerName, softDeleteActionKind); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName) { + final SoftDeleteActionKind softDeleteActionKind = null; + Mono>> mono = purgeWithResponseAsync(resourceGroupName, location, accountName, + databaseName, containerName, softDeleteActionKind); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, + String accountName, String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = purgeWithResponseAsync(resourceGroupName, location, accountName, + databaseName, containerName, softDeleteActionKind, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurge(String resourceGroupName, String location, String accountName, + String databaseName, String containerName) { + final SoftDeleteActionKind softDeleteActionKind = null; + return this + .beginPurgeAsync(resourceGroupName, location, accountName, databaseName, containerName, + softDeleteActionKind) + .getSyncPoller(); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurge(String resourceGroupName, String location, String accountName, + String databaseName, String containerName, SoftDeleteActionKind softDeleteActionKind, Context context) { + return this + .beginPurgeAsync(resourceGroupName, location, accountName, databaseName, containerName, + softDeleteActionKind, context) + .getSyncPoller(); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono purgeAsync(String resourceGroupName, String location, String accountName, String databaseName, + String containerName, SoftDeleteActionKind softDeleteActionKind) { + return beginPurgeAsync(resourceGroupName, location, accountName, databaseName, containerName, + softDeleteActionKind).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono purgeAsync(String resourceGroupName, String location, String accountName, String databaseName, + String containerName) { + final SoftDeleteActionKind softDeleteActionKind = null; + return beginPurgeAsync(resourceGroupName, location, accountName, databaseName, containerName, + softDeleteActionKind).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeAsync(String resourceGroupName, String location, String accountName, String databaseName, + String containerName, SoftDeleteActionKind softDeleteActionKind, Context context) { + return beginPurgeAsync(resourceGroupName, location, accountName, databaseName, containerName, + softDeleteActionKind, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purge(String resourceGroupName, String location, String accountName, String databaseName, + String containerName) { + final SoftDeleteActionKind softDeleteActionKind = null; + purgeAsync(resourceGroupName, location, accountName, databaseName, containerName, softDeleteActionKind).block(); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param containerName Cosmos DB SQL container name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purge(String resourceGroupName, String location, String accountName, String databaseName, + String containerName, SoftDeleteActionKind softDeleteActionKind, Context context) { + purgeAsync(resourceGroupName, location, accountName, databaseName, containerName, softDeleteActionKind, context) + .block(); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedSqlDatabasesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedSqlDatabasesClientImpl.java new file mode 100644 index 000000000000..863386d4e5cc --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedSqlDatabasesClientImpl.java @@ -0,0 +1,984 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.SoftDeletedSqlDatabasesClient; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedSqlDatabaseGetResultInner; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedSqlDatabasesListResultInner; +import com.azure.resourcemanager.cosmos.models.SoftDeleteActionKind; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SoftDeletedSqlDatabasesClient. + */ +public final class SoftDeletedSqlDatabasesClientImpl implements SoftDeletedSqlDatabasesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SoftDeletedSqlDatabasesService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of SoftDeletedSqlDatabasesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SoftDeletedSqlDatabasesClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(SoftDeletedSqlDatabasesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientSoftDeletedSqlDatabases to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientSoftDeletedSqlDatabases") + public interface SoftDeletedSqlDatabasesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts/{accountName}/softDeletedSqlDatabases/{databaseName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts/{accountName}/softDeletedSqlDatabases") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts/{accountName}/softDeletedSqlDatabases/{databaseName}?softDeleteActionKind=RestoreSoftDeletedResource") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restore(@HostParam("endpoint") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @QueryParam("softDeleteActionKind") SoftDeleteActionKind softDeleteActionKind, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/locations/{location}/softDeletedDatabaseAccounts/{accountName}/softDeletedSqlDatabases/{databaseName}?softDeleteActionKind=PermanentDeleteResource") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purge(@HostParam("endpoint") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @QueryParam("softDeleteActionKind") SoftDeleteActionKind softDeleteActionKind, Context context); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB soft-deleted SQL database along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String location, String accountName, String databaseName) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, accountName, databaseName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @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 an Azure Cosmos DB soft-deleted SQL database along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String location, String accountName, String databaseName, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, location, accountName, databaseName, accept, context); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB soft-deleted SQL database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String location, + String accountName, String databaseName) { + return getWithResponseAsync(resourceGroupName, location, accountName, databaseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @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 an Azure Cosmos DB soft-deleted SQL database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String location, + String accountName, String databaseName, Context context) { + return getWithResponseAsync(resourceGroupName, location, accountName, databaseName, context).block(); + } + + /** + * Retrieves the properties of a soft-deleted Azure Cosmos DB SQL database. This call requires + * 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB soft-deleted SQL database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SoftDeletedSqlDatabaseGetResultInner get(String resourceGroupName, String location, String accountName, + String databaseName) { + return getWithResponse(resourceGroupName, location, accountName, databaseName, Context.NONE).getValue(); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL databases under a soft-deleted database account. This call + * requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the soft-deleted SQL databases and their properties along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listWithResponseAsync(String resourceGroupName, + String location, String accountName) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, location, accountName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL databases under a soft-deleted database account. This call + * requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @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 List operation response, that contains the soft-deleted SQL databases and their properties along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String location, String accountName, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName 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(), this.client.getSubscriptionId(), + resourceGroupName, location, accountName, accept, context); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL databases under a soft-deleted database account. This call + * requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the soft-deleted SQL databases and their properties on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAsync(String resourceGroupName, String location, + String accountName) { + return listWithResponseAsync(resourceGroupName, location, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL databases under a soft-deleted database account. This call + * requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @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 List operation response, that contains the soft-deleted SQL databases and their properties along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String location, + String accountName, Context context) { + return listWithResponseAsync(resourceGroupName, location, accountName, context).block(); + } + + /** + * Lists all the soft-deleted Azure Cosmos DB SQL databases under a soft-deleted database account. This call + * requires 'Microsoft.DocumentDB/locations/softDeletedDatabaseAccounts/softDeletedSqlDatabases/read' permission. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List operation response, that contains the soft-deleted SQL databases and their properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SoftDeletedSqlDatabasesListResultInner list(String resourceGroupName, String location, String accountName) { + return listWithResponse(resourceGroupName, location, accountName, Context.NONE).getValue(); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restoreWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName, SoftDeleteActionKind softDeleteActionKind) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.restore(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, location, accountName, databaseName, this.client.getApiVersion(), + softDeleteActionKind, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName, SoftDeleteActionKind softDeleteActionKind, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.restore(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, location, + accountName, databaseName, this.client.getApiVersion(), softDeleteActionKind, context); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, + String accountName, String databaseName, SoftDeleteActionKind softDeleteActionKind) { + Mono>> mono + = restoreWithResponseAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, + String accountName, String databaseName) { + final SoftDeleteActionKind softDeleteActionKind = null; + Mono>> mono + = restoreWithResponseAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestoreAsync(String resourceGroupName, String location, + String accountName, String databaseName, SoftDeleteActionKind softDeleteActionKind, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = restoreWithResponseAsync(resourceGroupName, location, accountName, + databaseName, softDeleteActionKind, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestore(String resourceGroupName, String location, + String accountName, String databaseName) { + final SoftDeleteActionKind softDeleteActionKind = null; + return this.beginRestoreAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind) + .getSyncPoller(); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestore(String resourceGroupName, String location, + String accountName, String databaseName, SoftDeleteActionKind softDeleteActionKind, Context context) { + return this + .beginRestoreAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind, context) + .getSyncPoller(); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restoreAsync(String resourceGroupName, String location, String accountName, String databaseName, + SoftDeleteActionKind softDeleteActionKind) { + return beginRestoreAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restoreAsync(String resourceGroupName, String location, String accountName, String databaseName) { + final SoftDeleteActionKind softDeleteActionKind = null; + return beginRestoreAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreAsync(String resourceGroupName, String location, String accountName, String databaseName, + SoftDeleteActionKind softDeleteActionKind, Context context) { + return beginRestoreAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restore(String resourceGroupName, String location, String accountName, String databaseName) { + final SoftDeleteActionKind softDeleteActionKind = null; + restoreAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind).block(); + } + + /** + * Restores a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restore(String resourceGroupName, String location, String accountName, String databaseName, + SoftDeleteActionKind softDeleteActionKind, Context context) { + restoreAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind, context).block(); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> purgeWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName, SoftDeleteActionKind softDeleteActionKind) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> service.purge(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + location, accountName, databaseName, this.client.getApiVersion(), softDeleteActionKind, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeWithResponseAsync(String resourceGroupName, String location, + String accountName, String databaseName, SoftDeleteActionKind softDeleteActionKind, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.purge(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, location, + accountName, databaseName, this.client.getApiVersion(), softDeleteActionKind, context); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, + String accountName, String databaseName, SoftDeleteActionKind softDeleteActionKind) { + Mono>> mono + = purgeWithResponseAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, + String accountName, String databaseName) { + final SoftDeleteActionKind softDeleteActionKind = null; + Mono>> mono + = purgeWithResponseAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeAsync(String resourceGroupName, String location, + String accountName, String databaseName, SoftDeleteActionKind softDeleteActionKind, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = purgeWithResponseAsync(resourceGroupName, location, accountName, + databaseName, softDeleteActionKind, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurge(String resourceGroupName, String location, String accountName, + String databaseName) { + final SoftDeleteActionKind softDeleteActionKind = null; + return this.beginPurgeAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind) + .getSyncPoller(); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurge(String resourceGroupName, String location, String accountName, + String databaseName, SoftDeleteActionKind softDeleteActionKind, Context context) { + return this + .beginPurgeAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind, context) + .getSyncPoller(); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono purgeAsync(String resourceGroupName, String location, String accountName, String databaseName, + SoftDeleteActionKind softDeleteActionKind) { + return beginPurgeAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono purgeAsync(String resourceGroupName, String location, String accountName, String databaseName) { + final SoftDeleteActionKind softDeleteActionKind = null; + return beginPurgeAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeAsync(String resourceGroupName, String location, String accountName, String databaseName, + SoftDeleteActionKind softDeleteActionKind, Context context) { + return beginPurgeAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purge(String resourceGroupName, String location, String accountName, String databaseName) { + final SoftDeleteActionKind softDeleteActionKind = null; + purgeAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind).block(); + } + + /** + * Permanently deletes a soft-deleted Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB SQL database name. + * @param softDeleteActionKind The kind of soft delete action to perform. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purge(String resourceGroupName, String location, String accountName, String databaseName, + SoftDeleteActionKind softDeleteActionKind, Context context) { + purgeAsync(resourceGroupName, location, accountName, databaseName, softDeleteActionKind, context).block(); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java index 2e96df717801..824a05872ebe 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java @@ -35,6 +35,8 @@ import com.azure.resourcemanager.cosmos.fluent.SqlResourcesClient; import com.azure.resourcemanager.cosmos.fluent.models.BackupInformationInner; import com.azure.resourcemanager.cosmos.fluent.models.ClientEncryptionKeyGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionStorageInfoCollectionInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionThroughputInfoResultInner; import com.azure.resourcemanager.cosmos.fluent.models.SqlContainerGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.SqlDatabaseGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.SqlRoleAssignmentGetResultsInner; @@ -53,6 +55,9 @@ import com.azure.resourcemanager.cosmos.implementation.models.SqlUserDefinedFunctionListResult; import com.azure.resourcemanager.cosmos.models.ClientEncryptionKeyCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation; +import com.azure.resourcemanager.cosmos.models.MergeParameters; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; import com.azure.resourcemanager.cosmos.models.SqlContainerCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.SqlDatabaseCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.SqlRoleAssignmentCreateUpdateParameters; @@ -135,6 +140,16 @@ Mono> listSqlDatabases(@HostParam("endpoint") St @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> sqlDatabasePartitionMerge(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MergeParameters mergeParameters, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default") @ExpectedResponses({ 200 }) @@ -174,6 +189,28 @@ Mono>> migrateSqlDatabaseToManualThroughput(@HostParam @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> sqlDatabaseRetrieveThroughputDistribution( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RetrieveThroughputParameters retrieveThroughputParameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> sqlDatabaseRedistributeThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedistributeThroughputParameters redistributeThroughputParameters, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default") @ExpectedResponses({ 200 }) @@ -216,6 +253,28 @@ Mono>> migrateSqlContainerToManualThroughput(@HostPara @PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName, @HeaderParam("Accept") String accept, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> sqlContainerRetrieveThroughputDistribution( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RetrieveThroughputParameters retrieveThroughputParameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> sqlContainerRedistributeThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedistributeThroughputParameters redistributeThroughputParameters, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}") @ExpectedResponses({ 200 }) @@ -289,6 +348,16 @@ Mono> listSqlContainers(@HostParam("endpoint") @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listSqlContainerPartitionMerge(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MergeParameters mergeParameters, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) @@ -1341,6 +1410,283 @@ public PagedIterable listSqlDatabases(String resourc return new PagedIterable<>(listSqlDatabasesAsync(resourceGroupName, accountName, context)); } + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> sqlDatabasePartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); + } else { + mergeParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.sqlDatabasePartitionMerge(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, mergeParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> sqlDatabasePartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); + } else { + mergeParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.sqlDatabasePartitionMerge(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + mergeParameters, context); + } + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters) { + Mono>> mono + = sqlDatabasePartitionMergeWithResponseAsync(resourceGroupName, accountName, databaseName, mergeParameters); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, this.client.getContext()); + } + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = sqlDatabasePartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, mergeParameters, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, context); + } + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters) { + return this.beginSqlDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters) + .getSyncPoller(); + } + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters, Context context) { + return this + .beginSqlDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters, context) + .getSyncPoller(); + } + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono sqlDatabasePartitionMergeAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters) { + return beginSqlDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sqlDatabasePartitionMergeAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters, Context context) { + return beginSqlDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionStorageInfoCollectionInner sqlDatabasePartitionMerge(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters) { + return sqlDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters).block(); + } + + /** + * Merges the partitions of a SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionStorageInfoCollectionInner sqlDatabasePartitionMerge(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters, Context context) { + return sqlDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters, context) + .block(); + } + /** * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided * name. @@ -2231,21 +2577,23 @@ public ThroughputSettingsGetResultsInner migrateSqlDatabaseToManualThroughput(St } /** - * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account along with - * {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSqlContainerThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String containerName) { + public Mono>> sqlDatabaseRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2264,34 +2612,1052 @@ public Mono> getSqlContainerThroughp if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + if (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getSqlContainerThroughput(this.client.getEndpoint(), + .withContext(context -> service.sqlDatabaseRetrieveThroughputDistribution(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseName, containerName, accept, context)) + databaseName, contentType, accept, retrieveThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. - * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. * @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 RUs per second of the SQL container under an existing Azure Cosmos DB database account along with - * {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSqlContainerThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String containerName, Context context) { + private Mono>> sqlDatabaseRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.sqlDatabaseRetrieveThroughputDistribution(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + retrieveThroughputParameters, context); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters) { + Mono>> mono = sqlDatabaseRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, retrieveThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = sqlDatabaseRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, retrieveThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters) { + return this + .beginSqlDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters) + .getSyncPoller(); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return this + .beginSqlDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono sqlDatabaseRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return beginSqlDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sqlDatabaseRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return beginSqlDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionThroughputInfoResultInner sqlDatabaseRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return sqlDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters).block(); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionThroughputInfoResultInner sqlDatabaseRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return sqlDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters, context).block(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> sqlDatabaseRedistributeThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (redistributeThroughputParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter redistributeThroughputParameters is required and cannot be null.")); + } else { + redistributeThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.sqlDatabaseRedistributeThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, redistributeThroughputParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> sqlDatabaseRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (redistributeThroughputParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter redistributeThroughputParameters is required and cannot be null.")); + } else { + redistributeThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.sqlDatabaseRedistributeThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + redistributeThroughputParameters, context); + } + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughputAsync(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters) { + Mono>> mono = sqlDatabaseRedistributeThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, redistributeThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); + } + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughputAsync(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = sqlDatabaseRedistributeThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, redistributeThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); + } + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return this + .beginSqlDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters) + .getSyncPoller(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return this + .beginSqlDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono sqlDatabaseRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return beginSqlDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sqlDatabaseRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return beginSqlDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionThroughputInfoResultInner sqlDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters) { + return sqlDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters).block(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB SQL database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. + * @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 an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionThroughputInfoResultInner sqlDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters, + Context context) { + return sqlDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters, context).block(); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSqlContainerThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getSqlContainerThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @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 RUs per second of the SQL container under an existing Azure Cosmos DB database account along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSqlContainerThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getSqlContainerThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, accept, + context); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSqlContainerThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String containerName) { + return getSqlContainerThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, containerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @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 RUs per second of the SQL container under an existing Azure Cosmos DB database account along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSqlContainerThroughputWithResponse(String resourceGroupName, + String accountName, String databaseName, String containerName, Context context) { + return getSqlContainerThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, containerName, + context).block(); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner getSqlContainerThroughput(String resourceGroupName, String accountName, + String databaseName, String containerName) { + return getSqlContainerThroughputWithResponse(resourceGroupName, accountName, databaseName, containerName, + Context.NONE).getValue(); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateSqlContainerThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (updateThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); + } else { + updateThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateSqlContainerThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, contentType, accept, updateThroughputParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateSqlContainerThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, + ThroughputSettingsUpdateParameters updateThroughputParameters, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (updateThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); + } else { + updateThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.updateSqlContainerThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, contentType, + accept, updateThroughputParameters, context); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + Mono>> mono = updateSqlContainerThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, updateThroughputParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateSqlContainerThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, updateThroughputParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return this + .beginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + updateThroughputParameters) + .getSyncPoller(); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return this + .beginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + updateThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateSqlContainerThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateSqlContainerThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return beginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner updateSqlContainerThroughput(String resourceGroupName, String accountName, + String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + updateThroughputParameters).block(); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. + * @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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner updateSqlContainerThroughput(String resourceGroupName, String accountName, + String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context) { + return updateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + updateThroughputParameters, context).block(); + } + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> migrateSqlContainerToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.migrateSqlContainerToAutoscale(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> migrateSqlContainerToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2315,13 +3681,13 @@ private Mono> getSqlContainerThrough } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getSqlContainerThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + return service.migrateSqlContainerToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, accept, context); } /** - * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -2330,18 +3696,110 @@ private Mono> getSqlContainerThrough * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account on successful - * completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, + String containerName) { + Mono>> mono = migrateSqlContainerToAutoscaleWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); + } + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = migrateSqlContainerToAutoscaleWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); + } + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateSqlContainerToAutoscale(String resourceGroupName, String accountName, String databaseName, + String containerName) { + return this + .beginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName) + .getSyncPoller(); + } + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateSqlContainerToAutoscale(String resourceGroupName, String accountName, String databaseName, + String containerName, Context context) { + return this + .beginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName, + context) + .getSyncPoller(); + } + + /** + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSqlContainerThroughputAsync(String resourceGroupName, + public Mono migrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { - return getSqlContainerThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, containerName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return beginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -2351,18 +3809,17 @@ public Mono getSqlContainerThroughputAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account along with - * {@link Response}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSqlContainerThroughputWithResponse(String resourceGroupName, + private Mono migrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, String containerName, Context context) { - return getSqlContainerThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, containerName, - context).block(); + return beginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -2371,33 +3828,50 @@ public Response getSqlContainerThroughputWith * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner getSqlContainerThroughput(String resourceGroupName, String accountName, - String databaseName, String containerName) { - return getSqlContainerThroughputWithResponse(resourceGroupName, accountName, databaseName, containerName, - Context.NONE).getValue(); + public ThroughputSettingsGetResultsInner migrateSqlContainerToAutoscale(String resourceGroupName, + String accountName, String databaseName, String containerName) { + return migrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName).block(); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @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 an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner migrateSqlContainerToAutoscale(String resourceGroupName, + String accountName, String databaseName, String containerName, Context context) { + return migrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName, context) + .block(); + } + + /** + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateSqlContainerThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> migrateSqlContainerToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2419,29 +3893,21 @@ public Mono>> updateSqlContainerThroughputWithResponse if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } - if (updateThroughputParameters == null) { - return Mono.error( - new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); - } else { - updateThroughputParameters.validate(); - } - final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateSqlContainerThroughput(this.client.getEndpoint(), + .withContext(context -> service.migrateSqlContainerToManualThroughput(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseName, containerName, contentType, accept, updateThroughputParameters, context)) + databaseName, containerName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @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. @@ -2450,9 +3916,8 @@ public Mono>> updateSqlContainerThroughputWithResponse * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateSqlContainerThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + private Mono>> migrateSqlContainerToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2474,28 +3939,20 @@ private Mono>> updateSqlContainerThroughputWithRespons if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } - if (updateThroughputParameters == null) { - return Mono.error( - new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); - } else { - updateThroughputParameters.validate(); - } - final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateSqlContainerThroughput(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, contentType, - accept, updateThroughputParameters, context); + return service.migrateSqlContainerToManualThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, accept, + context); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2503,23 +3960,22 @@ private Mono>> updateSqlContainerThroughputWithRespons */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, - String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - Mono>> mono = updateSqlContainerThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, containerName, updateThroughputParameters); + beginMigrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String containerName) { + Mono>> mono = migrateSqlContainerToManualThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, containerName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @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. @@ -2528,24 +3984,23 @@ private Mono>> updateSqlContainerThroughputWithRespons */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, - String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + beginMigrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String containerName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = updateSqlContainerThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, containerName, updateThroughputParameters, context); + Mono>> mono = migrateSqlContainerToManualThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, containerName, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, context); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2553,22 +4008,21 @@ private Mono>> updateSqlContainerThroughputWithRespons */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, - String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + beginMigrateSqlContainerToManualThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName) { return this - .beginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, - updateThroughputParameters) + .beginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, + containerName) .getSyncPoller(); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @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. @@ -2577,43 +4031,40 @@ private Mono>> updateSqlContainerThroughputWithRespons */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, - String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + beginMigrateSqlContainerToManualThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, Context context) { return this - .beginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, - updateThroughputParameters, context) + .beginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, + containerName, context) .getSyncPoller(); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSqlContainerThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, - updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono migrateSqlContainerToManualThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String containerName) { + return beginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, + containerName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @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. @@ -2621,41 +4072,38 @@ public Mono updateSqlContainerThroughputAsync * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateSqlContainerThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return beginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, - updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono migrateSqlContainerToManualThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, Context context) { + return beginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, + containerName, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateSqlContainerThroughput(String resourceGroupName, String accountName, - String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, - updateThroughputParameters).block(); + public ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(String resourceGroupName, + String accountName, String databaseName, String containerName) { + return migrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, containerName) + .block(); } /** - * Update RUs per second of an Azure Cosmos DB SQL container. + * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current SQL container. * @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. @@ -2663,29 +4111,31 @@ public ThroughputSettingsGetResultsInner updateSqlContainerThroughput(String res * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateSqlContainerThroughput(String resourceGroupName, String accountName, - String databaseName, String containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, - Context context) { - return updateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, - updateThroughputParameters, context).block(); + public ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(String resourceGroupName, + String accountName, String databaseName, String containerName, Context context) { + return migrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + context).block(); } /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateSqlContainerToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String containerName) { + public Mono>> sqlContainerRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2707,31 +4157,41 @@ public Mono>> migrateSqlContainerToAutoscaleWithRespon if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } + if (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateSqlContainerToAutoscale(this.client.getEndpoint(), + .withContext(context -> service.sqlContainerRetrieveThroughputDistribution(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseName, containerName, accept, context)) + databaseName, containerName, contentType, accept, retrieveThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateSqlContainerToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, Context context) { + private Mono>> sqlContainerRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2753,199 +4213,238 @@ private Mono>> migrateSqlContainerToAutoscaleWithRespo if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } + if (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateSqlContainerToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, accept, - context); + return service.sqlContainerRetrieveThroughputDistribution(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, + containerName, contentType, accept, retrieveThroughputParameters, context); } /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, - String containerName) { - Mono>> mono = migrateSqlContainerToAutoscaleWithResponseAsync(resourceGroupName, - accountName, databaseName, containerName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters) { + Mono>> mono = sqlContainerRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); } /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, - String containerName, Context context) { + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context) { context = this.client.mergeContext(context); - Mono>> mono = migrateSqlContainerToAutoscaleWithResponseAsync(resourceGroupName, - accountName, databaseName, containerName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + Mono>> mono = sqlContainerRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); } /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToAutoscale(String resourceGroupName, String accountName, String databaseName, - String containerName) { + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters) { return this - .beginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName) + .beginSqlContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + containerName, retrieveThroughputParameters) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToAutoscale(String resourceGroupName, String accountName, String databaseName, - String containerName, Context context) { + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context) { return this - .beginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName, - context) + .beginSqlContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + containerName, retrieveThroughputParameters, context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono migrateSqlContainerToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName, String containerName) { - return beginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName) - .last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono sqlContainerRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return beginSqlContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + containerName, retrieveThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateSqlContainerToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, Context context) { - return beginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName, - context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono sqlContainerRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return beginSqlContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + containerName, retrieveThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB resource throughput. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateSqlContainerToAutoscale(String resourceGroupName, - String accountName, String databaseName, String containerName) { - return migrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName).block(); + public PhysicalPartitionThroughputInfoResultInner sqlContainerRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return sqlContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + containerName, retrieveThroughputParameters).block(); } /** - * Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + * Retrieve throughput distribution for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @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 an Azure Cosmos DB resource throughput. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateSqlContainerToAutoscale(String resourceGroupName, - String accountName, String databaseName, String containerName, Context context) { - return migrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName, context) - .block(); + public PhysicalPartitionThroughputInfoResultInner sqlContainerRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return sqlContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + containerName, retrieveThroughputParameters, context).block(); } /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateSqlContainerToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String containerName) { + public Mono>> sqlContainerRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2967,31 +4466,41 @@ public Mono>> migrateSqlContainerToManualThroughputWit if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } + if (redistributeThroughputParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter redistributeThroughputParameters is required and cannot be null.")); + } else { + redistributeThroughputParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateSqlContainerToManualThroughput(this.client.getEndpoint(), + .withContext(context -> service.sqlContainerRedistributeThroughput(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseName, containerName, accept, context)) + databaseName, containerName, contentType, accept, redistributeThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @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 an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateSqlContainerToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String containerName, Context context) { + private Mono>> sqlContainerRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3013,182 +4522,215 @@ private Mono>> migrateSqlContainerToManualThroughputWi if (containerName == null) { return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } + if (redistributeThroughputParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter redistributeThroughputParameters is required and cannot be null.")); + } else { + redistributeThroughputParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateSqlContainerToManualThroughput(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, accept, - context); + return service.sqlContainerRedistributeThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, contentType, + accept, redistributeThroughputParameters, context); } /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName, String containerName) { - Mono>> mono = migrateSqlContainerToManualThroughputWithResponseAsync( - resourceGroupName, accountName, databaseName, containerName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters) { + Mono>> mono = sqlContainerRedistributeThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, redistributeThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); } /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName, String containerName, Context context) { + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = migrateSqlContainerToManualThroughputWithResponseAsync( - resourceGroupName, accountName, databaseName, containerName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + Mono>> mono = sqlContainerRedistributeThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, redistributeThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); } /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an Azure Cosmos DB resource throughput. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToManualThroughput(String resourceGroupName, String accountName, String databaseName, - String containerName) { + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters) { return this - .beginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, - containerName) + .beginSqlContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + redistributeThroughputParameters) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateSqlContainerToManualThroughput(String resourceGroupName, String accountName, String databaseName, - String containerName, Context context) { + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters, Context context) { return this - .beginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, - containerName, context) + .beginSqlContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + redistributeThroughputParameters, context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono migrateSqlContainerToManualThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String containerName) { - return beginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, - containerName).last().flatMap(this.client::getLroFinalResultOrError); + public Mono sqlContainerRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return beginSqlContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + redistributeThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @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 an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateSqlContainerToManualThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, Context context) { - return beginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, - containerName, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono sqlContainerRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return beginSqlContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + redistributeThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure Cosmos DB resource throughput. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(String resourceGroupName, - String accountName, String databaseName, String containerName) { - return migrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, containerName) - .block(); + public PhysicalPartitionThroughputInfoResultInner sqlContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return sqlContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + redistributeThroughputParameters).block(); } /** - * Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. + * Redistribute throughput for an Azure Cosmos DB SQL container. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @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 an Azure Cosmos DB resource throughput. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(String resourceGroupName, - String accountName, String databaseName, String containerName, Context context) { - return migrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, containerName, - context).block(); + public PhysicalPartitionThroughputInfoResultInner sqlContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return sqlContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + redistributeThroughputParameters, context).block(); } /** @@ -4657,6 +6199,307 @@ public PagedIterable listSqlContainers(String resou return new PagedIterable<>(listSqlContainersAsync(resourceGroupName, accountName, databaseName, context)); } + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> listSqlContainerPartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters) { + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); + } else { + mergeParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSqlContainerPartitionMerge(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, contentType, accept, mergeParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listSqlContainerPartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters, + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); + } else { + mergeParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listSqlContainerPartitionMerge(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, contentType, + accept, mergeParameters, context); + } + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters) { + Mono>> mono = listSqlContainerPartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, mergeParameters); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, this.client.getContext()); + } + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = listSqlContainerPartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, mergeParameters, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, context); + } + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters) { + return this + .beginListSqlContainerPartitionMergeAsync(resourceGroupName, accountName, databaseName, containerName, + mergeParameters) + .getSyncPoller(); + } + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters, Context context) { + return this + .beginListSqlContainerPartitionMergeAsync(resourceGroupName, accountName, databaseName, containerName, + mergeParameters, context) + .getSyncPoller(); + } + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listSqlContainerPartitionMergeAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + MergeParameters mergeParameters) { + return beginListSqlContainerPartitionMergeAsync(resourceGroupName, accountName, databaseName, containerName, + mergeParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSqlContainerPartitionMergeAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + MergeParameters mergeParameters, Context context) { + return beginListSqlContainerPartitionMergeAsync(resourceGroupName, accountName, databaseName, containerName, + mergeParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge 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 physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionStorageInfoCollectionInner listSqlContainerPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters) { + return listSqlContainerPartitionMergeAsync(resourceGroupName, accountName, databaseName, containerName, + mergeParameters).block(); + } + + /** + * Merges the partitions of a SQL Container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionStorageInfoCollectionInner listSqlContainerPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters, + Context context) { + return listSqlContainerPartitionMergeAsync(resourceGroupName, accountName, databaseName, containerName, + mergeParameters, context).block(); + } + /** * Retrieves continuous backup information for a container resource. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsClientImpl.java new file mode 100644 index 000000000000..294c370a4ae2 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsClientImpl.java @@ -0,0 +1,740 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolAccountsClient; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolAccountResourceInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolAccountsClient. + */ +public final class ThroughputPoolAccountsClientImpl implements ThroughputPoolAccountsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ThroughputPoolAccountsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of ThroughputPoolAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThroughputPoolAccountsClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(ThroughputPoolAccountsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientThroughputPoolAccounts to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientThroughputPoolAccounts") + public interface ThroughputPoolAccountsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, + @PathParam("throughputPoolAccountName") String throughputPoolAccountName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, + @PathParam("throughputPoolAccountName") String throughputPoolAccountName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThroughputPoolAccountResourceInner body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, + @PathParam("throughputPoolAccountName") String throughputPoolAccountName, Context context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 an Azure Cosmos DB Throughputpool Account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String throughputPoolName, String throughputPoolAccountName) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (throughputPoolAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter throughputPoolAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, throughputPoolAccountName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 an Azure Cosmos DB Throughputpool Account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String throughputPoolName, String throughputPoolAccountName, 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (throughputPoolAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter throughputPoolAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, throughputPoolName, throughputPoolAccountName, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 an Azure Cosmos DB Throughputpool Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName) { + return getWithResponseAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 an Azure Cosmos DB Throughputpool Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String throughputPoolName, String throughputPoolAccountName, Context context) { + return getWithResponseAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, context).block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolAccountResourceInner get(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName) { + return getWithResponse(resourceGroupName, throughputPoolName, throughputPoolAccountName, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool Account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createWithResponseAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (throughputPoolAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter throughputPoolAccountName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, throughputPoolAccountName, + contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 an Azure Cosmos DB Throughputpool Account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, + String throughputPoolName, String throughputPoolAccountName, ThroughputPoolAccountResourceInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (throughputPoolAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter throughputPoolAccountName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, throughputPoolName, throughputPoolAccountName, contentType, accept, body, context); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputPoolAccountResourceInner> + beginCreateAsync(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolAccountResourceInner.class, + ThroughputPoolAccountResourceInner.class, this.client.getContext()); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputPoolAccountResourceInner> + beginCreateAsync(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolAccountResourceInner.class, + ThroughputPoolAccountResourceInner.class, context); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputPoolAccountResourceInner> beginCreate( + String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body) { + return this.beginCreateAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputPoolAccountResourceInner> beginCreate( + String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body, context) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body) { + return beginCreateAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 an Azure Cosmos DB Throughputpool Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body, Context context) { + return beginCreateAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolAccountResourceInner create(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body) { + return createAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body).block(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 an Azure Cosmos DB Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolAccountResourceInner create(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body, Context context) { + return createAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body, context).block(); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (throughputPoolAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter throughputPoolAccountName is required and cannot be null.")); + } + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, throughputPoolAccountName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String throughputPoolName, String throughputPoolAccountName, 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (throughputPoolAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter throughputPoolAccountName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, throughputPoolName, throughputPoolAccountName, context); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName) { + return this.beginDeleteAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName).getSyncPoller(); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, Context context) { + return this.beginDeleteAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, context) + .getSyncPoller(); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName) { + return beginDeleteAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, Context context) { + return beginDeleteAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName) { + deleteAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName).block(); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + Context context) { + deleteAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, context).block(); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsOperationsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsOperationsClientImpl.java new file mode 100644 index 000000000000..ac2e1b88a774 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsOperationsClientImpl.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolAccountsOperationsClient; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolAccountResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.ThroughputPoolAccountsListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolAccountsOperationsClient. + */ +public final class ThroughputPoolAccountsOperationsClientImpl implements ThroughputPoolAccountsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ThroughputPoolAccountsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of ThroughputPoolAccountsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThroughputPoolAccountsOperationsClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(ThroughputPoolAccountsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientThroughputPoolAccountsOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientThroughputPoolAccountsOperations") + public interface ThroughputPoolAccountsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String throughputPoolName) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, 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 all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @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 response of a ThroughputPoolAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String throughputPoolName, 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName 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(), this.client.getSubscriptionId(), + resourceGroupName, throughputPoolName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, + String throughputPoolName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, throughputPoolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @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 response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String throughputPoolName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, throughputPoolName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String throughputPoolName) { + return new PagedIterable<>(listAsync(resourceGroupName, throughputPoolName)); + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @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 response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String throughputPoolName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, throughputPoolName, 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 response of a ThroughputPoolAccountResource list operation 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 response of a ThroughputPoolAccountResource list operation 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/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsClientImpl.java new file mode 100644 index 000000000000..8e8495a33f93 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsClientImpl.java @@ -0,0 +1,948 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolsClient; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolResourceInner; +import com.azure.resourcemanager.cosmos.models.ThroughputPoolUpdate; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolsClient. + */ +public final class ThroughputPoolsClientImpl + implements InnerSupportsGet, InnerSupportsDelete, ThroughputPoolsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ThroughputPoolsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of ThroughputPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThroughputPoolsClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(ThroughputPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientThroughputPools to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientThroughputPools") + public interface ThroughputPoolsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ThroughputPoolResourceInner body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThroughputPoolUpdate body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, Context context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String throughputPoolName) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @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 an Azure Cosmos DB Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String throughputPoolName, 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, + String throughputPoolName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, throughputPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @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 an Azure Cosmos DB Throughputpool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String throughputPoolName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, throughputPoolName, context).block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolResourceInner getByResourceGroup(String resourceGroupName, String throughputPoolName) { + return getByResourceGroupWithResponse(resourceGroupName, throughputPoolName, Context.NONE).getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String throughputPoolName, ThroughputPoolResourceInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, contentType, accept, body, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 an Azure Cosmos DB Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String throughputPoolName, ThroughputPoolResourceInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, contentType, accept, body, context); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputPoolResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, throughputPoolName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolResourceInner.class, ThroughputPoolResourceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputPoolResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, throughputPoolName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolResourceInner.class, ThroughputPoolResourceInner.class, + context); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputPoolResourceInner> + beginCreateOrUpdate(String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, throughputPoolName, body).getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputPoolResourceInner> beginCreateOrUpdate( + String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, throughputPoolName, body, context).getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, throughputPoolName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 an Azure Cosmos DB Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, throughputPoolName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolResourceInner createOrUpdate(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body) { + return createOrUpdateAsync(resourceGroupName, throughputPoolName, body).block(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolResourceInner createOrUpdate(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, throughputPoolName, body, context).block(); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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 an Azure Cosmos DB Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolUpdate body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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 an Azure Cosmos DB Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String throughputPoolName, ThroughputPoolUpdate body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, throughputPoolName, accept, body, context); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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 PollerFlux} for polling of an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputPoolResourceInner> + beginUpdateAsync(String resourceGroupName, String throughputPoolName, ThroughputPoolUpdate body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, throughputPoolName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolResourceInner.class, ThroughputPoolResourceInner.class, + this.client.getContext()); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputPoolResourceInner> + beginUpdateAsync(String resourceGroupName, String throughputPoolName) { + final ThroughputPoolUpdate body = null; + Mono>> mono = updateWithResponseAsync(resourceGroupName, throughputPoolName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolResourceInner.class, ThroughputPoolResourceInner.class, + this.client.getContext()); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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 the {@link PollerFlux} for polling of an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputPoolResourceInner> beginUpdateAsync( + String resourceGroupName, String throughputPoolName, ThroughputPoolUpdate body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, throughputPoolName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolResourceInner.class, ThroughputPoolResourceInner.class, + context); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputPoolResourceInner> + beginUpdate(String resourceGroupName, String throughputPoolName) { + final ThroughputPoolUpdate body = null; + return this.beginUpdateAsync(resourceGroupName, throughputPoolName, body).getSyncPoller(); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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 the {@link SyncPoller} for polling of an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputPoolResourceInner> + beginUpdate(String resourceGroupName, String throughputPoolName, ThroughputPoolUpdate body, Context context) { + return this.beginUpdateAsync(resourceGroupName, throughputPoolName, body, context).getSyncPoller(); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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 an Azure Cosmos DB Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolUpdate body) { + return beginUpdateAsync(resourceGroupName, throughputPoolName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String throughputPoolName) { + final ThroughputPoolUpdate body = null; + return beginUpdateAsync(resourceGroupName, throughputPoolName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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 an Azure Cosmos DB Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolUpdate body, Context context) { + return beginUpdateAsync(resourceGroupName, throughputPoolName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolResourceInner update(String resourceGroupName, String throughputPoolName) { + final ThroughputPoolUpdate body = null; + return updateAsync(resourceGroupName, throughputPoolName, body).block(); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput 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 an Azure Cosmos DB Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolResourceInner update(String resourceGroupName, String throughputPoolName, + ThroughputPoolUpdate body, Context context) { + return updateAsync(resourceGroupName, throughputPoolName, body, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, + String throughputPoolName) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String throughputPoolName, 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, throughputPoolName, context); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String throughputPoolName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, throughputPoolName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String throughputPoolName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, throughputPoolName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String throughputPoolName) { + return this.beginDeleteAsync(resourceGroupName, throughputPoolName).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String throughputPoolName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, throughputPoolName, context).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String throughputPoolName) { + return beginDeleteAsync(resourceGroupName, throughputPoolName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String throughputPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, throughputPoolName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String throughputPoolName) { + deleteAsync(resourceGroupName, throughputPoolName).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String throughputPoolName, Context context) { + deleteAsync(resourceGroupName, throughputPoolName, context).block(); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsOperationsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsOperationsClientImpl.java new file mode 100644 index 000000000000..81f078930576 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsOperationsClientImpl.java @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolsOperationsClient; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.ThroughputPoolsListResult; +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 ThroughputPoolsOperationsClient. + */ +public final class ThroughputPoolsOperationsClientImpl + implements InnerSupportsListing, ThroughputPoolsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ThroughputPoolsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of ThroughputPoolsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThroughputPoolsOperationsClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(ThroughputPoolsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientThroughputPoolsOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientThroughputPoolsOperations") + public interface ThroughputPoolsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @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> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, 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())); + } + + /** + * List all the ThroughputPools in a given 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the ThroughputPools in a given 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List all the ThroughputPools in a given 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under 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 the response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.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())); + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the 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 the response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under 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 the response of a ThroughputPoolResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the 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 the response of a ThroughputPoolResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under 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 the response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the 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 the response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(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 response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ThroughputPoolResource list operation 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 response of a ThroughputPoolResource list operation 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/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraViewListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraViewListResult.java new file mode 100644 index 000000000000..5fd76faf730b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraViewListResult.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.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.cosmos.fluent.models.CassandraViewGetResultsInner; +import java.io.IOException; +import java.util.List; + +/** + * The List operation response, that contains the Cassandra views and their properties. + */ +@Immutable +public final class CassandraViewListResult implements JsonSerializable { + /* + * List of Cassandra views and their properties. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of CassandraViewListResult class. + */ + private CassandraViewListResult() { + } + + /** + * Get the value property: List of Cassandra views and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CassandraViewListResult. + */ + public static CassandraViewListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewListResult deserializedCassandraViewListResult = new CassandraViewListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CassandraViewGetResultsInner.fromJson(reader1)); + deserializedCassandraViewListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCassandraViewListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ChaosFaultListResponse.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ChaosFaultListResponse.java new file mode 100644 index 000000000000..e67adc0bd857 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ChaosFaultListResponse.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +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.cosmos.fluent.models.ChaosFaultResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * Chaos Fault List Response. + */ +@Immutable +public final class ChaosFaultListResponse implements JsonSerializable { + /* + * The chaosFaultResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ChaosFaultListResponse class. + */ + private ChaosFaultListResponse() { + } + + /** + * Get the value property: The chaosFaultResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ChaosFaultListResponse")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ChaosFaultListResponse.class); + + /** + * {@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 ChaosFaultListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChaosFaultListResponse 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 ChaosFaultListResponse. + */ + public static ChaosFaultListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChaosFaultListResponse deserializedChaosFaultListResponse = new ChaosFaultListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ChaosFaultResourceInner.fromJson(reader1)); + deserializedChaosFaultListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedChaosFaultListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedChaosFaultListResponse; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CopyJobFeedResults.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CopyJobFeedResults.java new file mode 100644 index 000000000000..aa461ac91554 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CopyJobFeedResults.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +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.cosmos.fluent.models.CopyJobGetResultsInner; +import java.io.IOException; +import java.util.List; + +/** + * The List operation response, that contains the Copy Jobs and their properties. + */ +@Immutable +public final class CopyJobFeedResults implements JsonSerializable { + /* + * The CopyJobGetResults items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CopyJobFeedResults class. + */ + private CopyJobFeedResults() { + } + + /** + * Get the value property: The CopyJobGetResults items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model CopyJobFeedResults")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CopyJobFeedResults.class); + + /** + * {@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 CopyJobFeedResults from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CopyJobFeedResults 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 CopyJobFeedResults. + */ + public static CopyJobFeedResults fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CopyJobFeedResults deserializedCopyJobFeedResults = new CopyJobFeedResults(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CopyJobGetResultsInner.fromJson(reader1)); + deserializedCopyJobFeedResults.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCopyJobFeedResults.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCopyJobFeedResults; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DataTransferJobFeedResults.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DataTransferJobFeedResults.java new file mode 100644 index 000000000000..5784da634f1f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DataTransferJobFeedResults.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +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.cosmos.fluent.models.DataTransferJobGetResultsInner; +import java.io.IOException; +import java.util.List; + +/** + * The List operation response, that contains the Data Transfer jobs and their properties. + */ +@Immutable +public final class DataTransferJobFeedResults implements JsonSerializable { + /* + * The DataTransferJobGetResults items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DataTransferJobFeedResults class. + */ + private DataTransferJobFeedResults() { + } + + /** + * Get the value property: The DataTransferJobGetResults items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DataTransferJobFeedResults")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataTransferJobFeedResults.class); + + /** + * {@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 DataTransferJobFeedResults from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTransferJobFeedResults 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 DataTransferJobFeedResults. + */ + public static DataTransferJobFeedResults fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTransferJobFeedResults deserializedDataTransferJobFeedResults = new DataTransferJobFeedResults(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DataTransferJobGetResultsInner.fromJson(reader1)); + deserializedDataTransferJobFeedResults.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDataTransferJobFeedResults.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTransferJobFeedResults; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetAnalyticsListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetAnalyticsListResult.java new file mode 100644 index 000000000000..d0393d87596d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetAnalyticsListResult.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +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.cosmos.fluent.models.FleetAnalyticsResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a FleetAnalyticsResource list operation. + */ +@Immutable +public final class FleetAnalyticsListResult implements JsonSerializable { + /* + * The FleetAnalyticsResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of FleetAnalyticsListResult class. + */ + private FleetAnalyticsListResult() { + } + + /** + * Get the value property: The FleetAnalyticsResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model FleetAnalyticsListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FleetAnalyticsListResult.class); + + /** + * {@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 FleetAnalyticsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FleetAnalyticsListResult 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 FleetAnalyticsListResult. + */ + public static FleetAnalyticsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FleetAnalyticsListResult deserializedFleetAnalyticsListResult = new FleetAnalyticsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FleetAnalyticsResourceInner.fromJson(reader1)); + deserializedFleetAnalyticsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFleetAnalyticsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFleetAnalyticsListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GraphResourcesListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GraphResourcesListResult.java new file mode 100644 index 000000000000..ab33782f2004 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GraphResourcesListResult.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.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.cosmos.fluent.models.GraphResourceGetResultsInner; +import java.io.IOException; +import java.util.List; + +/** + * The List operation response, that contains the Graph resource and their properties. + */ +@Immutable +public final class GraphResourcesListResult implements JsonSerializable { + /* + * List of Graph resource and their properties. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of GraphResourcesListResult class. + */ + private GraphResourcesListResult() { + } + + /** + * Get the value property: List of Graph resource and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourcesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourcesListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphResourcesListResult. + */ + public static GraphResourcesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourcesListResult deserializedGraphResourcesListResult = new GraphResourcesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> GraphResourceGetResultsInner.fromJson(reader1)); + deserializedGraphResourcesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGraphResourcesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourcesListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListBackups.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListBackups.java new file mode 100644 index 000000000000..fee3bce83a92 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListBackups.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.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.cosmos.fluent.models.BackupResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * List of restorable backups for a Cassandra cluster. + */ +@Immutable +public final class ListBackups implements JsonSerializable { + /* + * Container for array of backups. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of ListBackups class. + */ + private ListBackups() { + } + + /** + * Get the value property: Container for array of backups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListBackups from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListBackups if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ListBackups. + */ + public static ListBackups fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListBackups deserializedListBackups = new ListBackups(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BackupResourceInner.fromJson(reader1)); + deserializedListBackups.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListBackups.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListBackups; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListCommands.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListCommands.java new file mode 100644 index 000000000000..cb569f52258e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListCommands.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.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.cosmos.fluent.models.CommandPublicResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * List of commands for cluster. + */ +@Immutable +public final class ListCommands implements JsonSerializable { + /* + * Container for array of commands. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of ListCommands class. + */ + private ListCommands() { + } + + /** + * Get the value property: Container for array of commands. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListCommands from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListCommands if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ListCommands. + */ + public static ListCommands fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListCommands deserializedListCommands = new ListCommands(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CommandPublicResourceInner.fromJson(reader1)); + deserializedListCommands.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListCommands.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListCommands; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListGarnetClusters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListGarnetClusters.java new file mode 100644 index 000000000000..7e74f8753580 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListGarnetClusters.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.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.cosmos.fluent.models.GarnetClusterResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * List of Garnet clusters. + */ +@Immutable +public final class ListGarnetClusters implements JsonSerializable { + /* + * Container for the array of clusters. + */ + private List value; + + /* + * The link used to get the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of ListGarnetClusters class. + */ + private ListGarnetClusters() { + } + + /** + * Get the value property: Container for the array of clusters. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link used to get the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListGarnetClusters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListGarnetClusters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ListGarnetClusters. + */ + public static ListGarnetClusters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListGarnetClusters deserializedListGarnetClusters = new ListGarnetClusters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> GarnetClusterResourceInner.fromJson(reader1)); + deserializedListGarnetClusters.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListGarnetClusters.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListGarnetClusters; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NetworkSecurityPerimeterConfigurationListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NetworkSecurityPerimeterConfigurationListResult.java new file mode 100644 index 000000000000..7cb45c302535 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NetworkSecurityPerimeterConfigurationListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +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.cosmos.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a NetworkSecurityPerimeterConfiguration list operation. + */ +@Immutable +public final class NetworkSecurityPerimeterConfigurationListResult + implements JsonSerializable { + /* + * The NetworkSecurityPerimeterConfiguration items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationListResult class. + */ + private NetworkSecurityPerimeterConfigurationListResult() { + } + + /** + * Get the value property: The NetworkSecurityPerimeterConfiguration items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model NetworkSecurityPerimeterConfigurationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkSecurityPerimeterConfigurationListResult.class); + + /** + * {@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 NetworkSecurityPerimeterConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationListResult 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 NetworkSecurityPerimeterConfigurationListResult. + */ + public static NetworkSecurityPerimeterConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationListResult deserializedNetworkSecurityPerimeterConfigurationListResult + = new NetworkSecurityPerimeterConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkSecurityPerimeterConfigurationInner.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolAccountsListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolAccountsListResult.java new file mode 100644 index 000000000000..84952d2cca32 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolAccountsListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +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.cosmos.fluent.models.ThroughputPoolAccountResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ThroughputPoolAccountResource list operation. + */ +@Immutable +public final class ThroughputPoolAccountsListResult implements JsonSerializable { + /* + * The ThroughputPoolAccountResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ThroughputPoolAccountsListResult class. + */ + private ThroughputPoolAccountsListResult() { + } + + /** + * Get the value property: The ThroughputPoolAccountResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ThroughputPoolAccountsListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ThroughputPoolAccountsListResult.class); + + /** + * {@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 ThroughputPoolAccountsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolAccountsListResult 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 ThroughputPoolAccountsListResult. + */ + public static ThroughputPoolAccountsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolAccountsListResult deserializedThroughputPoolAccountsListResult + = new ThroughputPoolAccountsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ThroughputPoolAccountResourceInner.fromJson(reader1)); + deserializedThroughputPoolAccountsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedThroughputPoolAccountsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolAccountsListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolsListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolsListResult.java new file mode 100644 index 000000000000..043496e9b893 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolsListResult.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +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.cosmos.fluent.models.ThroughputPoolResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ThroughputPoolResource list operation. + */ +@Immutable +public final class ThroughputPoolsListResult implements JsonSerializable { + /* + * The ThroughputPoolResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ThroughputPoolsListResult class. + */ + private ThroughputPoolsListResult() { + } + + /** + * Get the value property: The ThroughputPoolResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model ThroughputPoolsListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ThroughputPoolsListResult.class); + + /** + * {@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 ThroughputPoolsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolsListResult 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 ThroughputPoolsListResult. + */ + public static ThroughputPoolsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolsListResult deserializedThroughputPoolsListResult = new ThroughputPoolsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ThroughputPoolResourceInner.fromJson(reader1)); + deserializedThroughputPoolsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedThroughputPoolsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolsListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRule.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRule.java new file mode 100644 index 000000000000..535dba840b3b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRule.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Access rule in a network security perimeter configuration profile. + */ +@Immutable +public final class AccessRule implements JsonSerializable { + /* + * Name of the access rule + */ + private String name; + + /* + * Properties of the access rule + */ + private AccessRuleProperties properties; + + /** + * Creates an instance of AccessRule class. + */ + private AccessRule() { + } + + /** + * Get the name property: Name of the access rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the properties property: Properties of the access rule. + * + * @return the properties value. + */ + public AccessRuleProperties properties() { + return this.properties; + } + + /** + * 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.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRule if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the AccessRule. + */ + public static AccessRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRule deserializedAccessRule = new AccessRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAccessRule.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAccessRule.properties = AccessRuleProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRule; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleDirection.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleDirection.java new file mode 100644 index 000000000000..15592950f906 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleDirection.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Direction of Access Rule. + */ +public final class AccessRuleDirection extends ExpandableStringEnum { + /** + * Applies to inbound network traffic to the secured resources. + */ + public static final AccessRuleDirection INBOUND = fromString("Inbound"); + + /** + * Applies to outbound network traffic from the secured resources. + */ + public static final AccessRuleDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates a new instance of AccessRuleDirection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessRuleDirection() { + } + + /** + * Creates or finds a AccessRuleDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessRuleDirection. + */ + public static AccessRuleDirection fromString(String name) { + return fromString(name, AccessRuleDirection.class); + } + + /** + * Gets known AccessRuleDirection values. + * + * @return known AccessRuleDirection values. + */ + public static Collection values() { + return values(AccessRuleDirection.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleProperties.java new file mode 100644 index 000000000000..97f6e4279a39 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleProperties.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of Access Rule. + */ +@Immutable +public final class AccessRuleProperties implements JsonSerializable { + /* + * Direction of the access rule + */ + private AccessRuleDirection direction; + + /* + * Address prefixes in the CIDR format for inbound rules + */ + private List addressPrefixes; + + /* + * Subscriptions for inbound rules + */ + private List subscriptions; + + /* + * Network security perimeters for inbound rules + */ + private List networkSecurityPerimeters; + + /* + * Fully qualified domain names (FQDN) for outbound rules + */ + private List fullyQualifiedDomainNames; + + /* + * Email addresses for outbound rules + */ + private List emailAddresses; + + /* + * Phone numbers for outbound rules + */ + private List phoneNumbers; + + /** + * Creates an instance of AccessRuleProperties class. + */ + private AccessRuleProperties() { + } + + /** + * Get the direction property: Direction of the access rule. + * + * @return the direction value. + */ + public AccessRuleDirection direction() { + return this.direction; + } + + /** + * Get the addressPrefixes property: Address prefixes in the CIDR format for inbound rules. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Get the subscriptions property: Subscriptions for inbound rules. + * + * @return the subscriptions value. + */ + public List subscriptions() { + return this.subscriptions; + } + + /** + * Get the networkSecurityPerimeters property: Network security perimeters for inbound rules. + * + * @return the networkSecurityPerimeters value. + */ + public List networkSecurityPerimeters() { + return this.networkSecurityPerimeters; + } + + /** + * Get the fullyQualifiedDomainNames property: Fully qualified domain names (FQDN) for outbound rules. + * + * @return the fullyQualifiedDomainNames value. + */ + public List fullyQualifiedDomainNames() { + return this.fullyQualifiedDomainNames; + } + + /** + * Get the emailAddresses property: Email addresses for outbound rules. + * + * @return the emailAddresses value. + */ + public List emailAddresses() { + return this.emailAddresses; + } + + /** + * Get the phoneNumbers property: Phone numbers for outbound rules. + * + * @return the phoneNumbers value. + */ + public List phoneNumbers() { + return this.phoneNumbers; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subscriptions() != null) { + subscriptions().forEach(e -> e.validate()); + } + if (networkSecurityPerimeters() != null) { + 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)); + jsonWriter.writeArrayField("networkSecurityPerimeters", this.networkSecurityPerimeters, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("fullyQualifiedDomainNames", this.fullyQualifiedDomainNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("emailAddresses", this.emailAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("phoneNumbers", this.phoneNumbers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRuleProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessRuleProperties. + */ + public static AccessRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRuleProperties deserializedAccessRuleProperties = new AccessRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("direction".equals(fieldName)) { + deserializedAccessRuleProperties.direction = AccessRuleDirection.fromString(reader.getString()); + } else if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.addressPrefixes = addressPrefixes; + } else if ("subscriptions".equals(fieldName)) { + List subscriptions + = reader.readArray(reader1 -> AccessRulePropertiesSubscription.fromJson(reader1)); + deserializedAccessRuleProperties.subscriptions = subscriptions; + } else if ("networkSecurityPerimeters".equals(fieldName)) { + List networkSecurityPerimeters + = reader.readArray(reader1 -> NetworkSecurityPerimeter.fromJson(reader1)); + deserializedAccessRuleProperties.networkSecurityPerimeters = networkSecurityPerimeters; + } else if ("fullyQualifiedDomainNames".equals(fieldName)) { + List fullyQualifiedDomainNames = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.fullyQualifiedDomainNames = fullyQualifiedDomainNames; + } else if ("emailAddresses".equals(fieldName)) { + List emailAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.emailAddresses = emailAddresses; + } else if ("phoneNumbers".equals(fieldName)) { + List phoneNumbers = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.phoneNumbers = phoneNumbers; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRuleProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRulePropertiesSubscription.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRulePropertiesSubscription.java new file mode 100644 index 000000000000..5ffd7cc565c6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRulePropertiesSubscription.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The AccessRulePropertiesSubscription model. + */ +@Immutable +public final class AccessRulePropertiesSubscription implements JsonSerializable { + /* + * The fully qualified Azure resource ID of the subscription e.g. + * ('/subscriptions/00000000-0000-0000-0000-000000000000') + */ + private String id; + + /** + * Creates an instance of AccessRulePropertiesSubscription class. + */ + private AccessRulePropertiesSubscription() { + } + + /** + * Get the id property: The fully qualified Azure resource ID of the subscription e.g. + * ('/subscriptions/00000000-0000-0000-0000-000000000000'). + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRulePropertiesSubscription from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRulePropertiesSubscription if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessRulePropertiesSubscription. + */ + public static AccessRulePropertiesSubscription fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRulePropertiesSubscription deserializedAccessRulePropertiesSubscription + = new AccessRulePropertiesSubscription(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAccessRulePropertiesSubscription.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRulePropertiesSubscription; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccountKeyMetadata.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccountKeyMetadata.java index 38a52b7234f9..fb08c58d7f4d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccountKeyMetadata.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccountKeyMetadata.java @@ -24,6 +24,13 @@ public final class AccountKeyMetadata implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("approximateLastUsageTime".equals(fieldName)) { + deserializedAccountKeyMetadata.approximateLastUsageTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AllocationState.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AllocationState.java new file mode 100644 index 000000000000..f049e431bcdd --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AllocationState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Allocation state of the cluster and data center resources. + */ +public final class AllocationState extends ExpandableStringEnum { + /** + * Active implies the virtual machines of the cluster are allocated. + */ + public static final AllocationState ACTIVE = fromString("Active"); + + /** + * Deallocated implies virtual machines and resources are deallocated. + */ + public static final AllocationState DEALLOCATED = fromString("Deallocated"); + + /** + * Creates a new instance of AllocationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AllocationState() { + } + + /** + * Creates or finds a AllocationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AllocationState. + */ + public static AllocationState fromString(String name) { + return fromString(name, AllocationState.class); + } + + /** + * Gets known AllocationState values. + * + * @return known AllocationState values. + */ + public static Collection values() { + return values(AllocationState.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobContainer.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobContainer.java new file mode 100644 index 000000000000..d3e3c667140a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobContainer.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * An Azure Blob container. + */ +@Fluent +public final class AzureBlobContainer implements JsonSerializable { + /* + * Azure Blob container. + */ + private String containerName; + + /** + * Creates an instance of AzureBlobContainer class. + */ + public AzureBlobContainer() { + } + + /** + * Get the containerName property: Azure Blob container. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Azure Blob container. + * + * @param containerName the containerName value to set. + * @return the AzureBlobContainer object itself. + */ + public AzureBlobContainer withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containerName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containerName in model AzureBlobContainer")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBlobContainer.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerName", this.containerName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureBlobContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureBlobContainer 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 AzureBlobContainer. + */ + public static AzureBlobContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureBlobContainer deserializedAzureBlobContainer = new AzureBlobContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerName".equals(fieldName)) { + deserializedAzureBlobContainer.containerName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureBlobContainer; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobDataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobDataTransferDataSourceSink.java new file mode 100644 index 000000000000..7f3f43209307 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobDataTransferDataSourceSink.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An Azure Blob Storage data source/sink. + */ +@Fluent +public final class AzureBlobDataTransferDataSourceSink extends DataTransferDataSourceSink { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.AZURE_BLOB_STORAGE; + + /* + * The containerName property. + */ + private String containerName; + + /* + * The endpointUrl property. + */ + private String endpointUrl; + + /** + * Creates an instance of AzureBlobDataTransferDataSourceSink class. + */ + public AzureBlobDataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + @Override + public DataTransferComponent component() { + return this.component; + } + + /** + * Get the containerName property: The containerName property. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The containerName property. + * + * @param containerName the containerName value to set. + * @return the AzureBlobDataTransferDataSourceSink object itself. + */ + public AzureBlobDataTransferDataSourceSink withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the endpointUrl property: The endpointUrl property. + * + * @return the endpointUrl value. + */ + public String endpointUrl() { + return this.endpointUrl; + } + + /** + * Set the endpointUrl property: The endpointUrl property. + * + * @param endpointUrl the endpointUrl value to set. + * @return the AzureBlobDataTransferDataSourceSink object itself. + */ + public AzureBlobDataTransferDataSourceSink withEndpointUrl(String endpointUrl) { + this.endpointUrl = endpointUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (containerName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containerName in model AzureBlobDataTransferDataSourceSink")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBlobDataTransferDataSourceSink.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeStringField("component", this.component == null ? null : this.component.toString()); + jsonWriter.writeStringField("endpointUrl", this.endpointUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureBlobDataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureBlobDataTransferDataSourceSink 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 AzureBlobDataTransferDataSourceSink. + */ + public static AzureBlobDataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureBlobDataTransferDataSourceSink deserializedAzureBlobDataTransferDataSourceSink + = new AzureBlobDataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerName".equals(fieldName)) { + deserializedAzureBlobDataTransferDataSourceSink.containerName = reader.getString(); + } else if ("component".equals(fieldName)) { + deserializedAzureBlobDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else if ("endpointUrl".equals(fieldName)) { + deserializedAzureBlobDataTransferDataSourceSink.endpointUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureBlobDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobSourceSinkDetails.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobSourceSinkDetails.java new file mode 100644 index 000000000000..9df9584ff996 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobSourceSinkDetails.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * An Azure Blob Storage data source/sink. + */ +@Fluent +public final class AzureBlobSourceSinkDetails implements JsonSerializable { + /* + * Azure Blob container endpoint. + */ + private String endpointUrl; + + /** + * Creates an instance of AzureBlobSourceSinkDetails class. + */ + public AzureBlobSourceSinkDetails() { + } + + /** + * Get the endpointUrl property: Azure Blob container endpoint. + * + * @return the endpointUrl value. + */ + public String endpointUrl() { + return this.endpointUrl; + } + + /** + * Set the endpointUrl property: Azure Blob container endpoint. + * + * @param endpointUrl the endpointUrl value to set. + * @return the AzureBlobSourceSinkDetails object itself. + */ + public AzureBlobSourceSinkDetails withEndpointUrl(String endpointUrl) { + this.endpointUrl = endpointUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpointUrl() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property endpointUrl in model AzureBlobSourceSinkDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBlobSourceSinkDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endpointUrl", this.endpointUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureBlobSourceSinkDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureBlobSourceSinkDetails 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 AzureBlobSourceSinkDetails. + */ + public static AzureBlobSourceSinkDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureBlobSourceSinkDetails deserializedAzureBlobSourceSinkDetails = new AzureBlobSourceSinkDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpointUrl".equals(fieldName)) { + deserializedAzureBlobSourceSinkDetails.endpointUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureBlobSourceSinkDetails; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupState.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupState.java new file mode 100644 index 000000000000..3a3ec4e66dfd --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current state of the backup. + */ +public final class BackupState extends ExpandableStringEnum { + /** + * Static value Initiated for BackupState. + */ + public static final BackupState INITIATED = fromString("Initiated"); + + /** + * Static value InProgress for BackupState. + */ + public static final BackupState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Succeeded for BackupState. + */ + public static final BackupState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for BackupState. + */ + public static final BackupState FAILED = fromString("Failed"); + + /** + * Creates a new instance of BackupState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BackupState() { + } + + /** + * Creates or finds a BackupState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupState. + */ + public static BackupState fromString(String name) { + return fromString(name, BackupState.class); + } + + /** + * Gets known BackupState values. + * + * @return known BackupState values. + */ + public static Collection values() { + return values(BackupState.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobProperties.java new file mode 100644 index 000000000000..c119d4862a91 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobProperties.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base copy job properties. + */ +@Immutable +public class BaseCopyJobProperties implements JsonSerializable { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.fromString("BaseCopyJobProperties"); + + /** + * Creates an instance of BaseCopyJobProperties class. + */ + public BaseCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + public CopyJobType jobType() { + return this.jobType; + } + + /** + * 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("jobType", this.jobType == null ? null : this.jobType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BaseCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BaseCopyJobProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BaseCopyJobProperties. + */ + public static BaseCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("jobType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("CassandraRUToCassandraRU".equals(discriminatorValue)) { + return CassandraRUToCassandraRUCopyJobProperties.fromJson(readerToUse.reset()); + } else if ("AzureBlobStorageToCassandraRU".equals(discriminatorValue)) { + return BlobToCassandraRUCopyJobProperties.fromJson(readerToUse.reset()); + } else if ("CassandraRUToAzureBlobStorage".equals(discriminatorValue)) { + return CassandraRUToBlobCopyJobProperties.fromJson(readerToUse.reset()); + } else if ("MongoRUToMongoRU".equals(discriminatorValue)) { + return MongoRUToMongoRUCopyJobProperties.fromJson(readerToUse.reset()); + } else if ("MongoRUToMongoVCore".equals(discriminatorValue)) { + return MongoRUToMongoVCoreCopyJobProperties.fromJson(readerToUse.reset()); + } else if ("NoSqlRUToNoSqlRU".equals(discriminatorValue)) { + return NoSqlRUToNoSqlRUCopyJobProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static BaseCopyJobProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BaseCopyJobProperties deserializedBaseCopyJobProperties = new BaseCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobType".equals(fieldName)) { + deserializedBaseCopyJobProperties.jobType = CopyJobType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBaseCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobTask.java new file mode 100644 index 000000000000..0725a801e25a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobTask.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of a Copy Job Task. + */ +@Immutable +public class BaseCopyJobTask implements JsonSerializable { + /* + * Task level Total Count. + */ + private Long totalCount; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /** + * Creates an instance of BaseCopyJobTask class. + */ + public BaseCopyJobTask() { + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set the totalCount property: Task level Total Count. + * + * @param totalCount the totalCount value to set. + * @return the BaseCopyJobTask object itself. + */ + BaseCopyJobTask withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + public Long processedCount() { + return this.processedCount; + } + + /** + * Set the processedCount property: Task level Processed Count. + * + * @param processedCount the processedCount value to set. + * @return the BaseCopyJobTask object itself. + */ + BaseCopyJobTask withProcessedCount(Long processedCount) { + this.processedCount = processedCount; + 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BaseCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BaseCopyJobTask if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BaseCopyJobTask. + */ + public static BaseCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BaseCopyJobTask deserializedBaseCopyJobTask = new BaseCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedBaseCopyJobTask.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedBaseCopyJobTask.processedCount = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedBaseCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCosmosDataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCosmosDataTransferDataSourceSink.java new file mode 100644 index 000000000000..cc55932b6deb --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCosmosDataTransferDataSourceSink.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * A base CosmosDB data source/sink. + */ +@Fluent +public class BaseCosmosDataTransferDataSourceSink extends DataTransferDataSourceSink { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.BASE_COSMOS_DATA_TRANSFER_DATA_SOURCE_SINK; + + /* + * The remoteAccountName property. + */ + private String remoteAccountName; + + /** + * Creates an instance of BaseCosmosDataTransferDataSourceSink class. + */ + public BaseCosmosDataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + @Override + public DataTransferComponent component() { + return this.component; + } + + /** + * Get the remoteAccountName property: The remoteAccountName property. + * + * @return the remoteAccountName value. + */ + public String remoteAccountName() { + return this.remoteAccountName; + } + + /** + * Set the remoteAccountName property: The remoteAccountName property. + * + * @param remoteAccountName the remoteAccountName value to set. + * @return the BaseCosmosDataTransferDataSourceSink object itself. + */ + public BaseCosmosDataTransferDataSourceSink withRemoteAccountName(String remoteAccountName) { + this.remoteAccountName = remoteAccountName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("component", this.component == null ? null : this.component.toString()); + jsonWriter.writeStringField("remoteAccountName", this.remoteAccountName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BaseCosmosDataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BaseCosmosDataTransferDataSourceSink if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BaseCosmosDataTransferDataSourceSink. + */ + public static BaseCosmosDataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("component".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("CosmosDBCassandra".equals(discriminatorValue)) { + return CosmosCassandraDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else if ("CosmosDBMongo".equals(discriminatorValue)) { + return CosmosMongoDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else if ("CosmosDBSql".equals(discriminatorValue)) { + return CosmosSqlDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static BaseCosmosDataTransferDataSourceSink fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BaseCosmosDataTransferDataSourceSink deserializedBaseCosmosDataTransferDataSourceSink + = new BaseCosmosDataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("component".equals(fieldName)) { + deserializedBaseCosmosDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else if ("remoteAccountName".equals(fieldName)) { + deserializedBaseCosmosDataTransferDataSourceSink.remoteAccountName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBaseCosmosDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobProperties.java new file mode 100644 index 000000000000..66ea84405135 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobProperties.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Source Azure Blob Storage to Destination Cassandra copy job properties. + */ +@Fluent +public final class BlobToCassandraRUCopyJobProperties extends BaseCopyJobProperties { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.AZURE_BLOB_STORAGE_TO_CASSANDRA_RU; + + /* + * Azure Storage container DataStore details + */ + private AzureBlobSourceSinkDetails sourceDetails; + + /* + * Destination Cassandra DataStore details + */ + private CosmosDBSourceSinkDetails destinationDetails; + + /* + * Copy Job tasks. + */ + private List tasks; + + /** + * Creates an instance of BlobToCassandraRUCopyJobProperties class. + */ + public BlobToCassandraRUCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + @Override + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Get the sourceDetails property: Azure Storage container DataStore details. + * + * @return the sourceDetails value. + */ + public AzureBlobSourceSinkDetails sourceDetails() { + return this.sourceDetails; + } + + /** + * Set the sourceDetails property: Azure Storage container DataStore details. + * + * @param sourceDetails the sourceDetails value to set. + * @return the BlobToCassandraRUCopyJobProperties object itself. + */ + public BlobToCassandraRUCopyJobProperties withSourceDetails(AzureBlobSourceSinkDetails sourceDetails) { + this.sourceDetails = sourceDetails; + return this; + } + + /** + * Get the destinationDetails property: Destination Cassandra DataStore details. + * + * @return the destinationDetails value. + */ + public CosmosDBSourceSinkDetails destinationDetails() { + return this.destinationDetails; + } + + /** + * Set the destinationDetails property: Destination Cassandra DataStore details. + * + * @param destinationDetails the destinationDetails value to set. + * @return the BlobToCassandraRUCopyJobProperties object itself. + */ + public BlobToCassandraRUCopyJobProperties withDestinationDetails(CosmosDBSourceSinkDetails destinationDetails) { + this.destinationDetails = destinationDetails; + return this; + } + + /** + * Get the tasks property: Copy Job tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Copy Job tasks. + * + * @param tasks the tasks value to set. + * @return the BlobToCassandraRUCopyJobProperties object itself. + */ + public BlobToCassandraRUCopyJobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceDetails() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceDetails in model BlobToCassandraRUCopyJobProperties")); + } else { + sourceDetails().validate(); + } + if (destinationDetails() != null) { + destinationDetails().validate(); + } + if (tasks() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tasks in model BlobToCassandraRUCopyJobProperties")); + } else { + tasks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobToCassandraRUCopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sourceDetails", this.sourceDetails); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("destinationDetails", this.destinationDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobToCassandraRUCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobToCassandraRUCopyJobProperties 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 BlobToCassandraRUCopyJobProperties. + */ + public static BlobToCassandraRUCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobToCassandraRUCopyJobProperties deserializedBlobToCassandraRUCopyJobProperties + = new BlobToCassandraRUCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceDetails".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobProperties.sourceDetails + = AzureBlobSourceSinkDetails.fromJson(reader); + } else if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> BlobToCassandraRUCopyJobTask.fromJson(reader1)); + deserializedBlobToCassandraRUCopyJobProperties.tasks = tasks; + } else if ("jobType".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobProperties.jobType = CopyJobType.fromString(reader.getString()); + } else if ("destinationDetails".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobProperties.destinationDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobToCassandraRUCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobTask.java new file mode 100644 index 000000000000..fe69adf7e156 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobTask.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The BlobToCassandraRUCopyJobTask model. + */ +@Fluent +public final class BlobToCassandraRUCopyJobTask extends BaseCopyJobTask { + /* + * Source Azure Blob container + */ + private AzureBlobContainer source; + + /* + * Destination Cassandra table + */ + private CosmosDBCassandraTable destination; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /* + * Task level Total Count. + */ + private Long totalCount; + + /** + * Creates an instance of BlobToCassandraRUCopyJobTask class. + */ + public BlobToCassandraRUCopyJobTask() { + } + + /** + * Get the source property: Source Azure Blob container. + * + * @return the source value. + */ + public AzureBlobContainer source() { + return this.source; + } + + /** + * Set the source property: Source Azure Blob container. + * + * @param source the source value to set. + * @return the BlobToCassandraRUCopyJobTask object itself. + */ + public BlobToCassandraRUCopyJobTask withSource(AzureBlobContainer source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination Cassandra table. + * + * @return the destination value. + */ + public CosmosDBCassandraTable destination() { + return this.destination; + } + + /** + * Set the destination property: Destination Cassandra table. + * + * @param destination the destination value to set. + * @return the BlobToCassandraRUCopyJobTask object itself. + */ + public BlobToCassandraRUCopyJobTask withDestination(CosmosDBCassandraTable destination) { + this.destination = destination; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + @Override + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + @Override + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model BlobToCassandraRUCopyJobTask")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model BlobToCassandraRUCopyJobTask")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobToCassandraRUCopyJobTask.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobToCassandraRUCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobToCassandraRUCopyJobTask 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 BlobToCassandraRUCopyJobTask. + */ + public static BlobToCassandraRUCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobToCassandraRUCopyJobTask deserializedBlobToCassandraRUCopyJobTask = new BlobToCassandraRUCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobTask.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobTask.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("source".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobTask.source = AzureBlobContainer.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobTask.destination = CosmosDBCassandraTable.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobToCassandraRUCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityMode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityMode.java new file mode 100644 index 000000000000..8320a12b24d1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates the capacity mode of the account. + */ +public final class CapacityMode extends ExpandableStringEnum { + /** + * Static value None for CapacityMode. + */ + public static final CapacityMode NONE = fromString("None"); + + /** + * Static value Provisioned for CapacityMode. + */ + public static final CapacityMode PROVISIONED = fromString("Provisioned"); + + /** + * Static value Serverless for CapacityMode. + */ + public static final CapacityMode SERVERLESS = fromString("Serverless"); + + /** + * Creates a new instance of CapacityMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CapacityMode() { + } + + /** + * Creates or finds a CapacityMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapacityMode. + */ + public static CapacityMode fromString(String name) { + return fromString(name, CapacityMode.class); + } + + /** + * Gets known CapacityMode values. + * + * @return known CapacityMode values. + */ + public static Collection values() { + return values(CapacityMode.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeChangeTransitionState.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeChangeTransitionState.java new file mode 100644 index 000000000000..858a2eab6ea3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeChangeTransitionState.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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 java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The transition state information related capacity mode change with update request. + */ +@Fluent +public final class CapacityModeChangeTransitionState implements JsonSerializable { + /* + * The transition status of capacity mode. + */ + private CapacityModeTransitionStatus capacityModeTransitionStatus; + + /* + * Indicates the current capacity mode of the account. + */ + private CapacityMode currentCapacityMode; + + /* + * Indicates the previous capacity mode of the account before successful transition. + */ + private CapacityMode previousCapacityMode; + + /* + * Begin time in UTC of the capacity mode change. + */ + private OffsetDateTime capacityModeTransitionBeginTimestamp; + + /* + * End time in UTC of the capacity mode change. + */ + private OffsetDateTime capacityModeTransitionEndTimestamp; + + /* + * End time in UTC of the last successful capacity mode change. + */ + private OffsetDateTime capacityModeLastSuccessfulTransitionEndTimestamp; + + /** + * Creates an instance of CapacityModeChangeTransitionState class. + */ + public CapacityModeChangeTransitionState() { + } + + /** + * Get the capacityModeTransitionStatus property: The transition status of capacity mode. + * + * @return the capacityModeTransitionStatus value. + */ + public CapacityModeTransitionStatus capacityModeTransitionStatus() { + return this.capacityModeTransitionStatus; + } + + /** + * Set the capacityModeTransitionStatus property: The transition status of capacity mode. + * + * @param capacityModeTransitionStatus the capacityModeTransitionStatus value to set. + * @return the CapacityModeChangeTransitionState object itself. + */ + public CapacityModeChangeTransitionState + withCapacityModeTransitionStatus(CapacityModeTransitionStatus capacityModeTransitionStatus) { + this.capacityModeTransitionStatus = capacityModeTransitionStatus; + return this; + } + + /** + * Get the currentCapacityMode property: Indicates the current capacity mode of the account. + * + * @return the currentCapacityMode value. + */ + public CapacityMode currentCapacityMode() { + return this.currentCapacityMode; + } + + /** + * Set the currentCapacityMode property: Indicates the current capacity mode of the account. + * + * @param currentCapacityMode the currentCapacityMode value to set. + * @return the CapacityModeChangeTransitionState object itself. + */ + public CapacityModeChangeTransitionState withCurrentCapacityMode(CapacityMode currentCapacityMode) { + this.currentCapacityMode = currentCapacityMode; + return this; + } + + /** + * Get the previousCapacityMode property: Indicates the previous capacity mode of the account before successful + * transition. + * + * @return the previousCapacityMode value. + */ + public CapacityMode previousCapacityMode() { + return this.previousCapacityMode; + } + + /** + * Set the previousCapacityMode property: Indicates the previous capacity mode of the account before successful + * transition. + * + * @param previousCapacityMode the previousCapacityMode value to set. + * @return the CapacityModeChangeTransitionState object itself. + */ + public CapacityModeChangeTransitionState withPreviousCapacityMode(CapacityMode previousCapacityMode) { + this.previousCapacityMode = previousCapacityMode; + return this; + } + + /** + * Get the capacityModeTransitionBeginTimestamp property: Begin time in UTC of the capacity mode change. + * + * @return the capacityModeTransitionBeginTimestamp value. + */ + public OffsetDateTime capacityModeTransitionBeginTimestamp() { + return this.capacityModeTransitionBeginTimestamp; + } + + /** + * Get the capacityModeTransitionEndTimestamp property: End time in UTC of the capacity mode change. + * + * @return the capacityModeTransitionEndTimestamp value. + */ + public OffsetDateTime capacityModeTransitionEndTimestamp() { + return this.capacityModeTransitionEndTimestamp; + } + + /** + * Get the capacityModeLastSuccessfulTransitionEndTimestamp property: End time in UTC of the last successful + * capacity mode change. + * + * @return the capacityModeLastSuccessfulTransitionEndTimestamp value. + */ + public OffsetDateTime capacityModeLastSuccessfulTransitionEndTimestamp() { + return this.capacityModeLastSuccessfulTransitionEndTimestamp; + } + + /** + * 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("capacityModeTransitionStatus", + this.capacityModeTransitionStatus == null ? null : this.capacityModeTransitionStatus.toString()); + jsonWriter.writeStringField("currentCapacityMode", + this.currentCapacityMode == null ? null : this.currentCapacityMode.toString()); + jsonWriter.writeStringField("previousCapacityMode", + this.previousCapacityMode == null ? null : this.previousCapacityMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapacityModeChangeTransitionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapacityModeChangeTransitionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapacityModeChangeTransitionState. + */ + public static CapacityModeChangeTransitionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapacityModeChangeTransitionState deserializedCapacityModeChangeTransitionState + = new CapacityModeChangeTransitionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacityModeTransitionStatus".equals(fieldName)) { + deserializedCapacityModeChangeTransitionState.capacityModeTransitionStatus + = CapacityModeTransitionStatus.fromString(reader.getString()); + } else if ("currentCapacityMode".equals(fieldName)) { + deserializedCapacityModeChangeTransitionState.currentCapacityMode + = CapacityMode.fromString(reader.getString()); + } else if ("previousCapacityMode".equals(fieldName)) { + deserializedCapacityModeChangeTransitionState.previousCapacityMode + = CapacityMode.fromString(reader.getString()); + } else if ("capacityModeTransitionBeginTimestamp".equals(fieldName)) { + deserializedCapacityModeChangeTransitionState.capacityModeTransitionBeginTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("capacityModeTransitionEndTimestamp".equals(fieldName)) { + deserializedCapacityModeChangeTransitionState.capacityModeTransitionEndTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("capacityModeLastSuccessfulTransitionEndTimestamp".equals(fieldName)) { + deserializedCapacityModeChangeTransitionState.capacityModeLastSuccessfulTransitionEndTimestamp + = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedCapacityModeChangeTransitionState; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeTransitionStatus.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeTransitionStatus.java new file mode 100644 index 000000000000..91aec5ade1cb --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeTransitionStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The transition status of capacity mode. + */ +public final class CapacityModeTransitionStatus extends ExpandableStringEnum { + /** + * Static value Invalid for CapacityModeTransitionStatus. + */ + public static final CapacityModeTransitionStatus INVALID = fromString("Invalid"); + + /** + * Static value Initialized for CapacityModeTransitionStatus. + */ + public static final CapacityModeTransitionStatus INITIALIZED = fromString("Initialized"); + + /** + * Static value InProgress for CapacityModeTransitionStatus. + */ + public static final CapacityModeTransitionStatus IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Completed for CapacityModeTransitionStatus. + */ + public static final CapacityModeTransitionStatus COMPLETED = fromString("Completed"); + + /** + * Static value Failed for CapacityModeTransitionStatus. + */ + public static final CapacityModeTransitionStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of CapacityModeTransitionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CapacityModeTransitionStatus() { + } + + /** + * Creates or finds a CapacityModeTransitionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapacityModeTransitionStatus. + */ + public static CapacityModeTransitionStatus fromString(String name) { + return fromString(name, CapacityModeTransitionStatus.class); + } + + /** + * Gets known CapacityModeTransitionStatus values. + * + * @return known CapacityModeTransitionStatus values. + */ + public static Collection values() { + return values(CapacityModeTransitionStatus.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobProperties.java new file mode 100644 index 000000000000..6498231fb887 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobProperties.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Source Cassandra to Destination Azure Blob Storage copy job properties. + */ +@Fluent +public final class CassandraRUToBlobCopyJobProperties extends BaseCopyJobProperties { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.CASSANDRA_RUTO_AZURE_BLOB_STORAGE; + + /* + * Source Cassandra DataStore details + */ + private CosmosDBSourceSinkDetails sourceDetails; + + /* + * Destination Cassandra DataStore details + */ + private AzureBlobSourceSinkDetails destinationDetails; + + /* + * Copy Job tasks. + */ + private List tasks; + + /** + * Creates an instance of CassandraRUToBlobCopyJobProperties class. + */ + public CassandraRUToBlobCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + @Override + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Get the sourceDetails property: Source Cassandra DataStore details. + * + * @return the sourceDetails value. + */ + public CosmosDBSourceSinkDetails sourceDetails() { + return this.sourceDetails; + } + + /** + * Set the sourceDetails property: Source Cassandra DataStore details. + * + * @param sourceDetails the sourceDetails value to set. + * @return the CassandraRUToBlobCopyJobProperties object itself. + */ + public CassandraRUToBlobCopyJobProperties withSourceDetails(CosmosDBSourceSinkDetails sourceDetails) { + this.sourceDetails = sourceDetails; + return this; + } + + /** + * Get the destinationDetails property: Destination Cassandra DataStore details. + * + * @return the destinationDetails value. + */ + public AzureBlobSourceSinkDetails destinationDetails() { + return this.destinationDetails; + } + + /** + * Set the destinationDetails property: Destination Cassandra DataStore details. + * + * @param destinationDetails the destinationDetails value to set. + * @return the CassandraRUToBlobCopyJobProperties object itself. + */ + public CassandraRUToBlobCopyJobProperties withDestinationDetails(AzureBlobSourceSinkDetails destinationDetails) { + this.destinationDetails = destinationDetails; + return this; + } + + /** + * Get the tasks property: Copy Job tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Copy Job tasks. + * + * @param tasks the tasks value to set. + * @return the CassandraRUToBlobCopyJobProperties object itself. + */ + public CassandraRUToBlobCopyJobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceDetails() != null) { + sourceDetails().validate(); + } + if (destinationDetails() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destinationDetails in model CassandraRUToBlobCopyJobProperties")); + } else { + destinationDetails().validate(); + } + if (tasks() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tasks in model CassandraRUToBlobCopyJobProperties")); + } else { + tasks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraRUToBlobCopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("destinationDetails", this.destinationDetails); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("sourceDetails", this.sourceDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRUToBlobCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRUToBlobCopyJobProperties 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 CassandraRUToBlobCopyJobProperties. + */ + public static CassandraRUToBlobCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRUToBlobCopyJobProperties deserializedCassandraRUToBlobCopyJobProperties + = new CassandraRUToBlobCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationDetails".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobProperties.destinationDetails + = AzureBlobSourceSinkDetails.fromJson(reader); + } else if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> CassandraRUToBlobCopyJobTask.fromJson(reader1)); + deserializedCassandraRUToBlobCopyJobProperties.tasks = tasks; + } else if ("jobType".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobProperties.jobType = CopyJobType.fromString(reader.getString()); + } else if ("sourceDetails".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobProperties.sourceDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRUToBlobCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobTask.java new file mode 100644 index 000000000000..aebb1488a6a0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobTask.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CassandraRUToBlobCopyJobTask model. + */ +@Fluent +public final class CassandraRUToBlobCopyJobTask extends BaseCopyJobTask { + /* + * Source Cassandra table + */ + private CosmosDBCassandraTable source; + + /* + * Destination Azure Blob container + */ + private AzureBlobContainer destination; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /* + * Task level Total Count. + */ + private Long totalCount; + + /** + * Creates an instance of CassandraRUToBlobCopyJobTask class. + */ + public CassandraRUToBlobCopyJobTask() { + } + + /** + * Get the source property: Source Cassandra table. + * + * @return the source value. + */ + public CosmosDBCassandraTable source() { + return this.source; + } + + /** + * Set the source property: Source Cassandra table. + * + * @param source the source value to set. + * @return the CassandraRUToBlobCopyJobTask object itself. + */ + public CassandraRUToBlobCopyJobTask withSource(CosmosDBCassandraTable source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination Azure Blob container. + * + * @return the destination value. + */ + public AzureBlobContainer destination() { + return this.destination; + } + + /** + * Set the destination property: Destination Azure Blob container. + * + * @param destination the destination value to set. + * @return the CassandraRUToBlobCopyJobTask object itself. + */ + public CassandraRUToBlobCopyJobTask withDestination(AzureBlobContainer destination) { + this.destination = destination; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + @Override + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + @Override + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model CassandraRUToBlobCopyJobTask")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model CassandraRUToBlobCopyJobTask")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraRUToBlobCopyJobTask.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRUToBlobCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRUToBlobCopyJobTask 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 CassandraRUToBlobCopyJobTask. + */ + public static CassandraRUToBlobCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRUToBlobCopyJobTask deserializedCassandraRUToBlobCopyJobTask = new CassandraRUToBlobCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobTask.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobTask.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("source".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobTask.source = CosmosDBCassandraTable.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobTask.destination = AzureBlobContainer.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRUToBlobCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobProperties.java new file mode 100644 index 000000000000..4499f240b6f3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobProperties.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Source Cassandra to Destination Cassandra copy job properties. + */ +@Fluent +public final class CassandraRUToCassandraRUCopyJobProperties extends BaseCopyJobProperties { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.CASSANDRA_RUTO_CASSANDRA_RU; + + /* + * Source Cassandra DataStore details + */ + private CosmosDBSourceSinkDetails sourceDetails; + + /* + * Destination Cassandra DataStore details + */ + private CosmosDBSourceSinkDetails destinationDetails; + + /* + * Copy Job tasks. + */ + private List tasks; + + /** + * Creates an instance of CassandraRUToCassandraRUCopyJobProperties class. + */ + public CassandraRUToCassandraRUCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + @Override + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Get the sourceDetails property: Source Cassandra DataStore details. + * + * @return the sourceDetails value. + */ + public CosmosDBSourceSinkDetails sourceDetails() { + return this.sourceDetails; + } + + /** + * Set the sourceDetails property: Source Cassandra DataStore details. + * + * @param sourceDetails the sourceDetails value to set. + * @return the CassandraRUToCassandraRUCopyJobProperties object itself. + */ + public CassandraRUToCassandraRUCopyJobProperties withSourceDetails(CosmosDBSourceSinkDetails sourceDetails) { + this.sourceDetails = sourceDetails; + return this; + } + + /** + * Get the destinationDetails property: Destination Cassandra DataStore details. + * + * @return the destinationDetails value. + */ + public CosmosDBSourceSinkDetails destinationDetails() { + return this.destinationDetails; + } + + /** + * Set the destinationDetails property: Destination Cassandra DataStore details. + * + * @param destinationDetails the destinationDetails value to set. + * @return the CassandraRUToCassandraRUCopyJobProperties object itself. + */ + public CassandraRUToCassandraRUCopyJobProperties + withDestinationDetails(CosmosDBSourceSinkDetails destinationDetails) { + this.destinationDetails = destinationDetails; + return this; + } + + /** + * Get the tasks property: Copy Job tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Copy Job tasks. + * + * @param tasks the tasks value to set. + * @return the CassandraRUToCassandraRUCopyJobProperties object itself. + */ + public CassandraRUToCassandraRUCopyJobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceDetails() != null) { + sourceDetails().validate(); + } + if (destinationDetails() != null) { + destinationDetails().validate(); + } + if (tasks() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tasks in model CassandraRUToCassandraRUCopyJobProperties")); + } else { + tasks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraRUToCassandraRUCopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("sourceDetails", this.sourceDetails); + jsonWriter.writeJsonField("destinationDetails", this.destinationDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRUToCassandraRUCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRUToCassandraRUCopyJobProperties 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 CassandraRUToCassandraRUCopyJobProperties. + */ + public static CassandraRUToCassandraRUCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRUToCassandraRUCopyJobProperties deserializedCassandraRUToCassandraRUCopyJobProperties + = new CassandraRUToCassandraRUCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> CassandraRUToCassandraRUCopyJobTask.fromJson(reader1)); + deserializedCassandraRUToCassandraRUCopyJobProperties.tasks = tasks; + } else if ("jobType".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobProperties.jobType + = CopyJobType.fromString(reader.getString()); + } else if ("sourceDetails".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobProperties.sourceDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else if ("destinationDetails".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobProperties.destinationDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRUToCassandraRUCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobTask.java new file mode 100644 index 000000000000..9c987b2a437a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobTask.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CassandraRUToCassandraRUCopyJobTask model. + */ +@Fluent +public final class CassandraRUToCassandraRUCopyJobTask extends BaseCopyJobTask { + /* + * Source Cassandra table + */ + private CosmosDBCassandraTable source; + + /* + * Destination Cassandra table + */ + private CosmosDBCassandraTable destination; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /* + * Task level Total Count. + */ + private Long totalCount; + + /** + * Creates an instance of CassandraRUToCassandraRUCopyJobTask class. + */ + public CassandraRUToCassandraRUCopyJobTask() { + } + + /** + * Get the source property: Source Cassandra table. + * + * @return the source value. + */ + public CosmosDBCassandraTable source() { + return this.source; + } + + /** + * Set the source property: Source Cassandra table. + * + * @param source the source value to set. + * @return the CassandraRUToCassandraRUCopyJobTask object itself. + */ + public CassandraRUToCassandraRUCopyJobTask withSource(CosmosDBCassandraTable source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination Cassandra table. + * + * @return the destination value. + */ + public CosmosDBCassandraTable destination() { + return this.destination; + } + + /** + * Set the destination property: Destination Cassandra table. + * + * @param destination the destination value to set. + * @return the CassandraRUToCassandraRUCopyJobTask object itself. + */ + public CassandraRUToCassandraRUCopyJobTask withDestination(CosmosDBCassandraTable destination) { + this.destination = destination; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + @Override + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + @Override + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model CassandraRUToCassandraRUCopyJobTask")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model CassandraRUToCassandraRUCopyJobTask")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraRUToCassandraRUCopyJobTask.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRUToCassandraRUCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRUToCassandraRUCopyJobTask 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 CassandraRUToCassandraRUCopyJobTask. + */ + public static CassandraRUToCassandraRUCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRUToCassandraRUCopyJobTask deserializedCassandraRUToCassandraRUCopyJobTask + = new CassandraRUToCassandraRUCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobTask.totalCount + = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobTask.processedCount + = reader.getNullable(JsonReader::getLong); + } else if ("source".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobTask.source = CosmosDBCassandraTable.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobTask.destination + = CosmosDBCassandraTable.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRUToCassandraRUCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewCreateUpdateParameters.java new file mode 100644 index 000000000000..35eba5b26df9 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewCreateUpdateParameters.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.fluent.models.CassandraViewCreateUpdateProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Parameters to create and update Cosmos DB Cassandra view. + */ +@Fluent +public final class CassandraViewCreateUpdateParameters extends ArmResourceProperties { + /* + * Properties to create and update Azure Cosmos DB Cassandra view. + */ + private CassandraViewCreateUpdateProperties innerProperties = new CassandraViewCreateUpdateProperties(); + + /* + * The type of Azure resource. + */ + private String type; + + /* + * The name of the ARM resource. + */ + private String name; + + /* + * The unique resource identifier of the ARM resource. + */ + private String id; + + /** + * Creates an instance of CassandraViewCreateUpdateParameters class. + */ + public CassandraViewCreateUpdateParameters() { + } + + /** + * Get the innerProperties property: Properties to create and update Azure Cosmos DB Cassandra view. + * + * @return the innerProperties value. + */ + private CassandraViewCreateUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the ARM resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The unique resource identifier of the ARM resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CassandraViewCreateUpdateParameters withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CassandraViewCreateUpdateParameters withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CassandraViewCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + + /** + * Get the resource property: The standard JSON format of a Cassandra view. + * + * @return the resource value. + */ + public CassandraViewResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Set the resource property: The standard JSON format of a Cassandra view. + * + * @param resource the resource value to set. + * @return the CassandraViewCreateUpdateParameters object itself. + */ + public CassandraViewCreateUpdateParameters withResource(CassandraViewResource resource) { + if (this.innerProperties() == null) { + this.innerProperties = new CassandraViewCreateUpdateProperties(); + } + this.innerProperties().withResource(resource); + return this; + } + + /** + * Get the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @return the options value. + */ + public CreateUpdateOptions options() { + return this.innerProperties() == null ? null : this.innerProperties().options(); + } + + /** + * Set the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @param options the options value to set. + * @return the CassandraViewCreateUpdateParameters object itself. + */ + public CassandraViewCreateUpdateParameters withOptions(CreateUpdateOptions options) { + if (this.innerProperties() == null) { + this.innerProperties = new CassandraViewCreateUpdateProperties(); + } + this.innerProperties().withOptions(options); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model CassandraViewCreateUpdateParameters")); + } else { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraViewCreateUpdateParameters.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("identity", identity()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewCreateUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewCreateUpdateParameters 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 CassandraViewCreateUpdateParameters. + */ + public static CassandraViewCreateUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewCreateUpdateParameters deserializedCassandraViewCreateUpdateParameters + = new CassandraViewCreateUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCassandraViewCreateUpdateParameters.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCassandraViewCreateUpdateParameters.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCassandraViewCreateUpdateParameters.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCassandraViewCreateUpdateParameters.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCassandraViewCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedCassandraViewCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedCassandraViewCreateUpdateParameters.innerProperties + = CassandraViewCreateUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewCreateUpdateParameters; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesOptions.java new file mode 100644 index 000000000000..2e9565755a96 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesOptions.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CassandraViewGetPropertiesOptions model. + */ +@Immutable +public final class CassandraViewGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + + /** + * Creates an instance of CassandraViewGetPropertiesOptions class. + */ + private CassandraViewGetPropertiesOptions() { + } + + /** + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. + */ + @Override + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; + } + + /** + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. + */ + @Override + public Integer throughput() { + return this.throughput; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (autoscaleSettings() != null) { + autoscaleSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("throughput", throughput()); + jsonWriter.writeJsonField("autoscaleSettings", autoscaleSettings()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewGetPropertiesOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewGetPropertiesOptions if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CassandraViewGetPropertiesOptions. + */ + public static CassandraViewGetPropertiesOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewGetPropertiesOptions deserializedCassandraViewGetPropertiesOptions + = new CassandraViewGetPropertiesOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("throughput".equals(fieldName)) { + deserializedCassandraViewGetPropertiesOptions.throughput = reader.getNullable(JsonReader::getInt); + } else if ("autoscaleSettings".equals(fieldName)) { + deserializedCassandraViewGetPropertiesOptions.autoscaleSettings + = AutoscaleSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewGetPropertiesOptions; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesResource.java new file mode 100644 index 000000000000..80429737f9d4 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesResource.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CassandraViewGetPropertiesResource model. + */ +@Immutable +public final class CassandraViewGetPropertiesResource extends CassandraViewResource { + /* + * A system generated property. A unique identifier. + */ + private String rid; + + /* + * A system generated property that denotes the last updated timestamp of the resource. + */ + private Float ts; + + /* + * A system generated property representing the resource etag required for optimistic concurrency control. + */ + private String etag; + + /** + * Creates an instance of CassandraViewGetPropertiesResource class. + */ + private CassandraViewGetPropertiesResource() { + } + + /** + * Get the rid property: A system generated property. A unique identifier. + * + * @return the rid value. + */ + public String rid() { + return this.rid; + } + + /** + * Get the ts property: A system generated property that denotes the last updated timestamp of the resource. + * + * @return the ts value. + */ + public Float ts() { + return this.ts; + } + + /** + * Get the etag property: A system generated property representing the resource etag required for optimistic + * concurrency control. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property id in model CassandraViewGetPropertiesResource")); + } + if (viewDefinition() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property viewDefinition in model CassandraViewGetPropertiesResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraViewGetPropertiesResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("viewDefinition", viewDefinition()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewGetPropertiesResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewGetPropertiesResource 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 CassandraViewGetPropertiesResource. + */ + public static CassandraViewGetPropertiesResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewGetPropertiesResource deserializedCassandraViewGetPropertiesResource + = new CassandraViewGetPropertiesResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCassandraViewGetPropertiesResource.withId(reader.getString()); + } else if ("viewDefinition".equals(fieldName)) { + deserializedCassandraViewGetPropertiesResource.withViewDefinition(reader.getString()); + } else if ("_rid".equals(fieldName)) { + deserializedCassandraViewGetPropertiesResource.rid = reader.getString(); + } else if ("_ts".equals(fieldName)) { + deserializedCassandraViewGetPropertiesResource.ts = reader.getNullable(JsonReader::getFloat); + } else if ("_etag".equals(fieldName)) { + deserializedCassandraViewGetPropertiesResource.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewGetPropertiesResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewResource.java new file mode 100644 index 000000000000..3bed32022878 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewResource.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * Cosmos DB Cassandra view resource object. + */ +@Fluent +public class CassandraViewResource implements JsonSerializable { + /* + * Name of the Cosmos DB Cassandra view + */ + private String id; + + /* + * View Definition of the Cosmos DB Cassandra view + */ + private String viewDefinition; + + /** + * Creates an instance of CassandraViewResource class. + */ + public CassandraViewResource() { + } + + /** + * Get the id property: Name of the Cosmos DB Cassandra view. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Name of the Cosmos DB Cassandra view. + * + * @param id the id value to set. + * @return the CassandraViewResource object itself. + */ + public CassandraViewResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the viewDefinition property: View Definition of the Cosmos DB Cassandra view. + * + * @return the viewDefinition value. + */ + public String viewDefinition() { + return this.viewDefinition; + } + + /** + * Set the viewDefinition property: View Definition of the Cosmos DB Cassandra view. + * + * @param viewDefinition the viewDefinition value to set. + * @return the CassandraViewResource object itself. + */ + public CassandraViewResource withViewDefinition(String viewDefinition) { + this.viewDefinition = viewDefinition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model CassandraViewResource")); + } + if (viewDefinition() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property viewDefinition in model CassandraViewResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraViewResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("viewDefinition", this.viewDefinition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewResource 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 CassandraViewResource. + */ + public static CassandraViewResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewResource deserializedCassandraViewResource = new CassandraViewResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCassandraViewResource.id = reader.getString(); + } else if ("viewDefinition".equals(fieldName)) { + deserializedCassandraViewResource.viewDefinition = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterResourceProperties.java index 572a4ac2caf6..f172e65d6088 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterResourceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterResourceProperties.java @@ -130,6 +130,11 @@ public final class ClusterResourceProperties implements JsonSerializable writer.writeString(element)); jsonWriter.writeArrayField("backupSchedules", this.backupSchedules, @@ -815,6 +843,8 @@ public static ClusterResourceProperties fromJson(JsonReader jsonReader) throws I } else if ("cassandraAuditLoggingEnabled".equals(fieldName)) { deserializedClusterResourceProperties.cassandraAuditLoggingEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("clusterType".equals(fieldName)) { + deserializedClusterResourceProperties.clusterType = ClusterType.fromString(reader.getString()); } else if ("provisionError".equals(fieldName)) { deserializedClusterResourceProperties.provisionError = CassandraError.fromJson(reader); } else if ("extensions".equals(fieldName)) { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterType.java new file mode 100644 index 000000000000..88f29bdf4b39 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of the cluster. If set to Production, some operations might not be permitted on cluster. + */ +public final class ClusterType extends ExpandableStringEnum { + /** + * Static value Production for ClusterType. + */ + public static final ClusterType PRODUCTION = fromString("Production"); + + /** + * Static value NonProduction for ClusterType. + */ + public static final ClusterType NON_PRODUCTION = fromString("NonProduction"); + + /** + * Creates a new instance of ClusterType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterType() { + } + + /** + * Creates or finds a ClusterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterType. + */ + public static ClusterType fromString(String name) { + return fromString(name, ClusterType.class); + } + + /** + * Gets known ClusterType values. + * + * @return known ClusterType values. + */ + public static Collection values() { + return values(ClusterType.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandAsyncPostBody.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandAsyncPostBody.java new file mode 100644 index 000000000000..944ff7ec007d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandAsyncPostBody.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * Specification of which command to run where. + */ +@Fluent +public final class CommandAsyncPostBody implements JsonSerializable { + /* + * The command which should be run + */ + private String command; + + /* + * The arguments for the command to be run + */ + private Object arguments; + + /* + * IP address of the cassandra host to run the command on + */ + private String host; + + /* + * If true, stops cassandra before executing the command and then start it again + */ + private Boolean cassandraStopStart; + + /* + * If true, allows the command to *write* to the cassandra directory, otherwise read-only. + */ + private Boolean readWrite; + + /** + * Creates an instance of CommandAsyncPostBody class. + */ + public CommandAsyncPostBody() { + } + + /** + * Get the command property: The command which should be run. + * + * @return the command value. + */ + public String command() { + return this.command; + } + + /** + * Set the command property: The command which should be run. + * + * @param command the command value to set. + * @return the CommandAsyncPostBody object itself. + */ + public CommandAsyncPostBody withCommand(String command) { + this.command = command; + return this; + } + + /** + * Get the arguments property: The arguments for the command to be run. + * + * @return the arguments value. + */ + public Object arguments() { + return this.arguments; + } + + /** + * Set the arguments property: The arguments for the command to be run. + * + * @param arguments the arguments value to set. + * @return the CommandAsyncPostBody object itself. + */ + public CommandAsyncPostBody withArguments(Object arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get the host property: IP address of the cassandra host to run the command on. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: IP address of the cassandra host to run the command on. + * + * @param host the host value to set. + * @return the CommandAsyncPostBody object itself. + */ + public CommandAsyncPostBody withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the cassandraStopStart property: If true, stops cassandra before executing the command and then start it + * again. + * + * @return the cassandraStopStart value. + */ + public Boolean cassandraStopStart() { + return this.cassandraStopStart; + } + + /** + * Set the cassandraStopStart property: If true, stops cassandra before executing the command and then start it + * again. + * + * @param cassandraStopStart the cassandraStopStart value to set. + * @return the CommandAsyncPostBody object itself. + */ + public CommandAsyncPostBody withCassandraStopStart(Boolean cassandraStopStart) { + this.cassandraStopStart = cassandraStopStart; + return this; + } + + /** + * Get the readWrite property: If true, allows the command to *write* to the cassandra directory, otherwise + * read-only. + * + * @return the readWrite value. + */ + public Boolean readWrite() { + return this.readWrite; + } + + /** + * Set the readWrite property: If true, allows the command to *write* to the cassandra directory, otherwise + * read-only. + * + * @param readWrite the readWrite value to set. + * @return the CommandAsyncPostBody object itself. + */ + public CommandAsyncPostBody withReadWrite(Boolean readWrite) { + this.readWrite = readWrite; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (command() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property command in model CommandAsyncPostBody")); + } + if (host() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property host in model CommandAsyncPostBody")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CommandAsyncPostBody.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("command", this.command); + jsonWriter.writeStringField("host", this.host); + if (this.arguments != null) { + jsonWriter.writeUntypedField("arguments", this.arguments); + } + jsonWriter.writeBooleanField("cassandra-stop-start", this.cassandraStopStart); + jsonWriter.writeBooleanField("readWrite", this.readWrite); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CommandAsyncPostBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CommandAsyncPostBody 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 CommandAsyncPostBody. + */ + public static CommandAsyncPostBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CommandAsyncPostBody deserializedCommandAsyncPostBody = new CommandAsyncPostBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("command".equals(fieldName)) { + deserializedCommandAsyncPostBody.command = reader.getString(); + } else if ("host".equals(fieldName)) { + deserializedCommandAsyncPostBody.host = reader.getString(); + } else if ("arguments".equals(fieldName)) { + deserializedCommandAsyncPostBody.arguments = reader.readUntyped(); + } else if ("cassandra-stop-start".equals(fieldName)) { + deserializedCommandAsyncPostBody.cassandraStopStart = reader.getNullable(JsonReader::getBoolean); + } else if ("readWrite".equals(fieldName)) { + deserializedCommandAsyncPostBody.readWrite = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCommandAsyncPostBody; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandStatus.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandStatus.java new file mode 100644 index 000000000000..e8a5f0efc24d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandStatus.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the command. + */ +public final class CommandStatus extends ExpandableStringEnum { + /** + * Static value Done for CommandStatus. + */ + public static final CommandStatus DONE = fromString("Done"); + + /** + * Static value Running for CommandStatus. + */ + public static final CommandStatus RUNNING = fromString("Running"); + + /** + * Static value Enqueue for CommandStatus. + */ + public static final CommandStatus ENQUEUE = fromString("Enqueue"); + + /** + * Static value Processing for CommandStatus. + */ + public static final CommandStatus PROCESSING = fromString("Processing"); + + /** + * Static value Finished for CommandStatus. + */ + public static final CommandStatus FINISHED = fromString("Finished"); + + /** + * Static value Failed for CommandStatus. + */ + public static final CommandStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of CommandStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CommandStatus() { + } + + /** + * Creates or finds a CommandStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CommandStatus. + */ + public static CommandStatus fromString(String name) { + return fromString(name, CommandStatus.class); + } + + /** + * Gets known CommandStatus values. + * + * @return known CommandStatus values. + */ + public static Collection values() { + return values(CommandStatus.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousTier.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousTier.java index f85a9cd0352c..02a82c2673ec 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousTier.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousTier.java @@ -21,6 +21,11 @@ public final class ContinuousTier extends ExpandableStringEnum { */ public static final ContinuousTier CONTINUOUS30DAYS = fromString("Continuous30Days"); + /** + * Continuous 35 Days backup tier. + */ + public static final ContinuousTier CONTINUOUS35DAYS = fromString("Continuous35Days"); + /** * Creates a new instance of ContinuousTier value. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobMode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobMode.java new file mode 100644 index 000000000000..4f9dbf085e30 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Mode of job execution. + */ +public final class CopyJobMode extends ExpandableStringEnum { + /** + * Static value Offline for CopyJobMode. + */ + public static final CopyJobMode OFFLINE = fromString("Offline"); + + /** + * Static value Online for CopyJobMode. + */ + public static final CopyJobMode ONLINE = fromString("Online"); + + /** + * Creates a new instance of CopyJobMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CopyJobMode() { + } + + /** + * Creates or finds a CopyJobMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding CopyJobMode. + */ + public static CopyJobMode fromString(String name) { + return fromString(name, CopyJobMode.class); + } + + /** + * Gets known CopyJobMode values. + * + * @return known CopyJobMode values. + */ + public static Collection values() { + return values(CopyJobMode.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobProperties.java new file mode 100644 index 000000000000..ec93ebd6e333 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobProperties.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +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 java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The properties of a Copy Job. + */ +@Fluent +public final class CopyJobProperties implements JsonSerializable { + /* + * Job Properties + */ + private BaseCopyJobProperties jobProperties; + + /* + * Job Status + */ + private CopyJobStatus status; + + /* + * Processed Count + */ + private Long processedCount; + + /* + * Total Count + */ + private Long totalCount; + + /* + * Last Updated Time (ISO-8601 format) + */ + private OffsetDateTime lastUpdatedUtcTime; + + /* + * Worker count + */ + private Integer workerCount; + + /* + * Error response for Faulted job + */ + private ManagementError error; + + /* + * Total Duration of Job + */ + private String duration; + + /* + * Mode of job execution + */ + private CopyJobMode mode; + + /** + * Creates an instance of CopyJobProperties class. + */ + public CopyJobProperties() { + } + + /** + * Get the jobProperties property: Job Properties. + * + * @return the jobProperties value. + */ + public BaseCopyJobProperties jobProperties() { + return this.jobProperties; + } + + /** + * Set the jobProperties property: Job Properties. + * + * @param jobProperties the jobProperties value to set. + * @return the CopyJobProperties object itself. + */ + public CopyJobProperties withJobProperties(BaseCopyJobProperties jobProperties) { + this.jobProperties = jobProperties; + return this; + } + + /** + * Get the status property: Job Status. + * + * @return the status value. + */ + public CopyJobStatus status() { + return this.status; + } + + /** + * Get the processedCount property: Processed Count. + * + * @return the processedCount value. + */ + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Total Count. + * + * @return the totalCount value. + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Get the lastUpdatedUtcTime property: Last Updated Time (ISO-8601 format). + * + * @return the lastUpdatedUtcTime value. + */ + public OffsetDateTime lastUpdatedUtcTime() { + return this.lastUpdatedUtcTime; + } + + /** + * Get the workerCount property: Worker count. + * + * @return the workerCount value. + */ + public Integer workerCount() { + return this.workerCount; + } + + /** + * Set the workerCount property: Worker count. + * + * @param workerCount the workerCount value to set. + * @return the CopyJobProperties object itself. + */ + public CopyJobProperties withWorkerCount(Integer workerCount) { + this.workerCount = workerCount; + return this; + } + + /** + * Get the error property: Error response for Faulted job. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the duration property: Total Duration of Job. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Get the mode property: Mode of job execution. + * + * @return the mode value. + */ + public CopyJobMode mode() { + return this.mode; + } + + /** + * Set the mode property: Mode of job execution. + * + * @param mode the mode value to set. + * @return the CopyJobProperties object itself. + */ + public CopyJobProperties withMode(CopyJobMode mode) { + this.mode = mode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (jobProperties() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property jobProperties in model CopyJobProperties")); + } else { + jobProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("jobProperties", this.jobProperties); + jsonWriter.writeNumberField("workerCount", this.workerCount); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CopyJobProperties 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 CopyJobProperties. + */ + public static CopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CopyJobProperties deserializedCopyJobProperties = new CopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobProperties".equals(fieldName)) { + deserializedCopyJobProperties.jobProperties = BaseCopyJobProperties.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedCopyJobProperties.status = CopyJobStatus.fromString(reader.getString()); + } else if ("processedCount".equals(fieldName)) { + deserializedCopyJobProperties.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("totalCount".equals(fieldName)) { + deserializedCopyJobProperties.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("lastUpdatedUtcTime".equals(fieldName)) { + deserializedCopyJobProperties.lastUpdatedUtcTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("workerCount".equals(fieldName)) { + deserializedCopyJobProperties.workerCount = reader.getNullable(JsonReader::getInt); + } else if ("error".equals(fieldName)) { + deserializedCopyJobProperties.error = ManagementError.fromJson(reader); + } else if ("duration".equals(fieldName)) { + deserializedCopyJobProperties.duration = reader.getString(); + } else if ("mode".equals(fieldName)) { + deserializedCopyJobProperties.mode = CopyJobMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobStatus.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobStatus.java new file mode 100644 index 000000000000..854462526cee --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobStatus.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Job Status. + */ +public final class CopyJobStatus extends ExpandableStringEnum { + /** + * Static value Pending for CopyJobStatus. + */ + public static final CopyJobStatus PENDING = fromString("Pending"); + + /** + * Static value Partitioning for CopyJobStatus. + */ + public static final CopyJobStatus PARTITIONING = fromString("Partitioning"); + + /** + * Static value Running for CopyJobStatus. + */ + public static final CopyJobStatus RUNNING = fromString("Running"); + + /** + * Static value Paused for CopyJobStatus. + */ + public static final CopyJobStatus PAUSED = fromString("Paused"); + + /** + * Static value Completed for CopyJobStatus. + */ + public static final CopyJobStatus COMPLETED = fromString("Completed"); + + /** + * Static value Faulted for CopyJobStatus. + */ + public static final CopyJobStatus FAULTED = fromString("Faulted"); + + /** + * Static value Cancelled for CopyJobStatus. + */ + public static final CopyJobStatus CANCELLED = fromString("Cancelled"); + + /** + * Creates a new instance of CopyJobStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CopyJobStatus() { + } + + /** + * Creates or finds a CopyJobStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CopyJobStatus. + */ + public static CopyJobStatus fromString(String name) { + return fromString(name, CopyJobStatus.class); + } + + /** + * Gets known CopyJobStatus values. + * + * @return known CopyJobStatus values. + */ + public static Collection values() { + return values(CopyJobStatus.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobType.java new file mode 100644 index 000000000000..526971be2d7b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobType.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Copy Job Type. + */ +public final class CopyJobType extends ExpandableStringEnum { + /** + * Static value CassandraRUToCassandraRU for CopyJobType. + */ + public static final CopyJobType CASSANDRA_RUTO_CASSANDRA_RU = fromString("CassandraRUToCassandraRU"); + + /** + * Static value CassandraRUToAzureBlobStorage for CopyJobType. + */ + public static final CopyJobType CASSANDRA_RUTO_AZURE_BLOB_STORAGE = fromString("CassandraRUToAzureBlobStorage"); + + /** + * Static value AzureBlobStorageToCassandraRU for CopyJobType. + */ + public static final CopyJobType AZURE_BLOB_STORAGE_TO_CASSANDRA_RU = fromString("AzureBlobStorageToCassandraRU"); + + /** + * Static value MongoRUToMongoRU for CopyJobType. + */ + public static final CopyJobType MONGO_RUTO_MONGO_RU = fromString("MongoRUToMongoRU"); + + /** + * Static value MongoRUToMongoVCore for CopyJobType. + */ + public static final CopyJobType MONGO_RUTO_MONGO_VCORE = fromString("MongoRUToMongoVCore"); + + /** + * Static value NoSqlRUToNoSqlRU for CopyJobType. + */ + public static final CopyJobType NO_SQL_RUTO_NO_SQL_RU = fromString("NoSqlRUToNoSqlRU"); + + /** + * Creates a new instance of CopyJobType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CopyJobType() { + } + + /** + * Creates or finds a CopyJobType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CopyJobType. + */ + public static CopyJobType fromString(String name) { + return fromString(name, CopyJobType.class); + } + + /** + * Gets known CopyJobType values. + * + * @return known CopyJobType values. + */ + public static Collection values() { + return values(CopyJobType.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosCassandraDataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosCassandraDataTransferDataSourceSink.java new file mode 100644 index 000000000000..412ce6c75d25 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosCassandraDataTransferDataSourceSink.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB Cassandra API data source/sink. + */ +@Fluent +public final class CosmosCassandraDataTransferDataSourceSink extends BaseCosmosDataTransferDataSourceSink { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.COSMOS_DBCASSANDRA; + + /* + * The keyspaceName property. + */ + private String keyspaceName; + + /* + * The tableName property. + */ + private String tableName; + + /** + * Creates an instance of CosmosCassandraDataTransferDataSourceSink class. + */ + public CosmosCassandraDataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + @Override + public DataTransferComponent component() { + return this.component; + } + + /** + * Get the keyspaceName property: The keyspaceName property. + * + * @return the keyspaceName value. + */ + public String keyspaceName() { + return this.keyspaceName; + } + + /** + * Set the keyspaceName property: The keyspaceName property. + * + * @param keyspaceName the keyspaceName value to set. + * @return the CosmosCassandraDataTransferDataSourceSink object itself. + */ + public CosmosCassandraDataTransferDataSourceSink withKeyspaceName(String keyspaceName) { + this.keyspaceName = keyspaceName; + return this; + } + + /** + * Get the tableName property: The tableName property. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: The tableName property. + * + * @param tableName the tableName value to set. + * @return the CosmosCassandraDataTransferDataSourceSink object itself. + */ + public CosmosCassandraDataTransferDataSourceSink withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CosmosCassandraDataTransferDataSourceSink withRemoteAccountName(String remoteAccountName) { + super.withRemoteAccountName(remoteAccountName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (keyspaceName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyspaceName in model CosmosCassandraDataTransferDataSourceSink")); + } + if (tableName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tableName in model CosmosCassandraDataTransferDataSourceSink")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosCassandraDataTransferDataSourceSink.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("remoteAccountName", remoteAccountName()); + jsonWriter.writeStringField("keyspaceName", this.keyspaceName); + jsonWriter.writeStringField("tableName", this.tableName); + jsonWriter.writeStringField("component", this.component == null ? null : this.component.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosCassandraDataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosCassandraDataTransferDataSourceSink 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 CosmosCassandraDataTransferDataSourceSink. + */ + public static CosmosCassandraDataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosCassandraDataTransferDataSourceSink deserializedCosmosCassandraDataTransferDataSourceSink + = new CosmosCassandraDataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remoteAccountName".equals(fieldName)) { + deserializedCosmosCassandraDataTransferDataSourceSink.withRemoteAccountName(reader.getString()); + } else if ("keyspaceName".equals(fieldName)) { + deserializedCosmosCassandraDataTransferDataSourceSink.keyspaceName = reader.getString(); + } else if ("tableName".equals(fieldName)) { + deserializedCosmosCassandraDataTransferDataSourceSink.tableName = reader.getString(); + } else if ("component".equals(fieldName)) { + deserializedCosmosCassandraDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosCassandraDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBCassandraTable.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBCassandraTable.java new file mode 100644 index 000000000000..8cb7c3d4169a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBCassandraTable.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * A CosmosDB Cassandra table. + */ +@Fluent +public final class CosmosDBCassandraTable implements JsonSerializable { + /* + * Azure Cosmos DB for Apache Cassandra keyspace. + */ + private String keyspaceName; + + /* + * Azure Cosmos DB for Apache Cassandra table. + */ + private String tableName; + + /** + * Creates an instance of CosmosDBCassandraTable class. + */ + public CosmosDBCassandraTable() { + } + + /** + * Get the keyspaceName property: Azure Cosmos DB for Apache Cassandra keyspace. + * + * @return the keyspaceName value. + */ + public String keyspaceName() { + return this.keyspaceName; + } + + /** + * Set the keyspaceName property: Azure Cosmos DB for Apache Cassandra keyspace. + * + * @param keyspaceName the keyspaceName value to set. + * @return the CosmosDBCassandraTable object itself. + */ + public CosmosDBCassandraTable withKeyspaceName(String keyspaceName) { + this.keyspaceName = keyspaceName; + return this; + } + + /** + * Get the tableName property: Azure Cosmos DB for Apache Cassandra table. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: Azure Cosmos DB for Apache Cassandra table. + * + * @param tableName the tableName value to set. + * @return the CosmosDBCassandraTable object itself. + */ + public CosmosDBCassandraTable withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyspaceName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyspaceName in model CosmosDBCassandraTable")); + } + if (tableName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tableName in model CosmosDBCassandraTable")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosDBCassandraTable.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyspaceName", this.keyspaceName); + jsonWriter.writeStringField("tableName", this.tableName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosDBCassandraTable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosDBCassandraTable 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 CosmosDBCassandraTable. + */ + public static CosmosDBCassandraTable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosDBCassandraTable deserializedCosmosDBCassandraTable = new CosmosDBCassandraTable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyspaceName".equals(fieldName)) { + deserializedCosmosDBCassandraTable.keyspaceName = reader.getString(); + } else if ("tableName".equals(fieldName)) { + deserializedCosmosDBCassandraTable.tableName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosDBCassandraTable; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoCollection.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoCollection.java new file mode 100644 index 000000000000..c8793bcecfcc --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoCollection.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * A CosmosDB Mongo collection. + */ +@Fluent +public final class CosmosDBMongoCollection implements JsonSerializable { + /* + * Azure Cosmos DB for MongoDB (RU) database. + */ + private String databaseName; + + /* + * Azure Cosmos DB for MongoDB (RU) collection. + */ + private String collectionName; + + /** + * Creates an instance of CosmosDBMongoCollection class. + */ + public CosmosDBMongoCollection() { + } + + /** + * Get the databaseName property: Azure Cosmos DB for MongoDB (RU) database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Azure Cosmos DB for MongoDB (RU) database. + * + * @param databaseName the databaseName value to set. + * @return the CosmosDBMongoCollection object itself. + */ + public CosmosDBMongoCollection withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the collectionName property: Azure Cosmos DB for MongoDB (RU) collection. + * + * @return the collectionName value. + */ + public String collectionName() { + return this.collectionName; + } + + /** + * Set the collectionName property: Azure Cosmos DB for MongoDB (RU) collection. + * + * @param collectionName the collectionName value to set. + * @return the CosmosDBMongoCollection object itself. + */ + public CosmosDBMongoCollection withCollectionName(String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model CosmosDBMongoCollection")); + } + if (collectionName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property collectionName in model CosmosDBMongoCollection")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosDBMongoCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("collectionName", this.collectionName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosDBMongoCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosDBMongoCollection 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 CosmosDBMongoCollection. + */ + public static CosmosDBMongoCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosDBMongoCollection deserializedCosmosDBMongoCollection = new CosmosDBMongoCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedCosmosDBMongoCollection.databaseName = reader.getString(); + } else if ("collectionName".equals(fieldName)) { + deserializedCosmosDBMongoCollection.collectionName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosDBMongoCollection; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoVCoreCollection.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoVCoreCollection.java new file mode 100644 index 000000000000..778a3cb5c50a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoVCoreCollection.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * A CosmosDB Mongo vCore collection. + */ +@Fluent +public final class CosmosDBMongoVCoreCollection implements JsonSerializable { + /* + * Azure Cosmos DB for MongoDB (vCore) database. + */ + private String databaseName; + + /* + * Azure Cosmos DB for MongoDB (vCore) collection. + */ + private String collectionName; + + /** + * Creates an instance of CosmosDBMongoVCoreCollection class. + */ + public CosmosDBMongoVCoreCollection() { + } + + /** + * Get the databaseName property: Azure Cosmos DB for MongoDB (vCore) database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Azure Cosmos DB for MongoDB (vCore) database. + * + * @param databaseName the databaseName value to set. + * @return the CosmosDBMongoVCoreCollection object itself. + */ + public CosmosDBMongoVCoreCollection withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the collectionName property: Azure Cosmos DB for MongoDB (vCore) collection. + * + * @return the collectionName value. + */ + public String collectionName() { + return this.collectionName; + } + + /** + * Set the collectionName property: Azure Cosmos DB for MongoDB (vCore) collection. + * + * @param collectionName the collectionName value to set. + * @return the CosmosDBMongoVCoreCollection object itself. + */ + public CosmosDBMongoVCoreCollection withCollectionName(String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model CosmosDBMongoVCoreCollection")); + } + if (collectionName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property collectionName in model CosmosDBMongoVCoreCollection")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosDBMongoVCoreCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("collectionName", this.collectionName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosDBMongoVCoreCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosDBMongoVCoreCollection 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 CosmosDBMongoVCoreCollection. + */ + public static CosmosDBMongoVCoreCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosDBMongoVCoreCollection deserializedCosmosDBMongoVCoreCollection = new CosmosDBMongoVCoreCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedCosmosDBMongoVCoreCollection.databaseName = reader.getString(); + } else if ("collectionName".equals(fieldName)) { + deserializedCosmosDBMongoVCoreCollection.collectionName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosDBMongoVCoreCollection; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBNoSqlContainer.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBNoSqlContainer.java new file mode 100644 index 000000000000..8af2545e1019 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBNoSqlContainer.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * A CosmosDB NoSQL container. + */ +@Fluent +public final class CosmosDBNoSqlContainer implements JsonSerializable { + /* + * Azure Cosmos DB for NoSQL database. + */ + private String databaseName; + + /* + * Azure Cosmos DB for NoSQL container. + */ + private String containerName; + + /** + * Creates an instance of CosmosDBNoSqlContainer class. + */ + public CosmosDBNoSqlContainer() { + } + + /** + * Get the databaseName property: Azure Cosmos DB for NoSQL database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Azure Cosmos DB for NoSQL database. + * + * @param databaseName the databaseName value to set. + * @return the CosmosDBNoSqlContainer object itself. + */ + public CosmosDBNoSqlContainer withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the containerName property: Azure Cosmos DB for NoSQL container. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Azure Cosmos DB for NoSQL container. + * + * @param containerName the containerName value to set. + * @return the CosmosDBNoSqlContainer object itself. + */ + public CosmosDBNoSqlContainer withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model CosmosDBNoSqlContainer")); + } + if (containerName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containerName in model CosmosDBNoSqlContainer")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosDBNoSqlContainer.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("containerName", this.containerName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosDBNoSqlContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosDBNoSqlContainer 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 CosmosDBNoSqlContainer. + */ + public static CosmosDBNoSqlContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosDBNoSqlContainer deserializedCosmosDBNoSqlContainer = new CosmosDBNoSqlContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedCosmosDBNoSqlContainer.databaseName = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedCosmosDBNoSqlContainer.containerName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosDBNoSqlContainer; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBSourceSinkDetails.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBSourceSinkDetails.java new file mode 100644 index 000000000000..a907c00d01f8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBSourceSinkDetails.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB data source/sink details. + */ +@Fluent +public final class CosmosDBSourceSinkDetails implements JsonSerializable { + /* + * Name of remote account in case of cross-account data transfer. + */ + private String remoteAccountName; + + /** + * Creates an instance of CosmosDBSourceSinkDetails class. + */ + public CosmosDBSourceSinkDetails() { + } + + /** + * Get the remoteAccountName property: Name of remote account in case of cross-account data transfer. + * + * @return the remoteAccountName value. + */ + public String remoteAccountName() { + return this.remoteAccountName; + } + + /** + * Set the remoteAccountName property: Name of remote account in case of cross-account data transfer. + * + * @param remoteAccountName the remoteAccountName value to set. + * @return the CosmosDBSourceSinkDetails object itself. + */ + public CosmosDBSourceSinkDetails withRemoteAccountName(String remoteAccountName) { + this.remoteAccountName = remoteAccountName; + 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("remoteAccountName", this.remoteAccountName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosDBSourceSinkDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosDBSourceSinkDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CosmosDBSourceSinkDetails. + */ + public static CosmosDBSourceSinkDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosDBSourceSinkDetails deserializedCosmosDBSourceSinkDetails = new CosmosDBSourceSinkDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remoteAccountName".equals(fieldName)) { + deserializedCosmosDBSourceSinkDetails.remoteAccountName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosDBSourceSinkDetails; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoDataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoDataTransferDataSourceSink.java new file mode 100644 index 000000000000..c2b74aa30b30 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoDataTransferDataSourceSink.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB Mongo API data source/sink. + */ +@Fluent +public final class CosmosMongoDataTransferDataSourceSink extends BaseCosmosDataTransferDataSourceSink { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.COSMOS_DBMONGO; + + /* + * The databaseName property. + */ + private String databaseName; + + /* + * The collectionName property. + */ + private String collectionName; + + /** + * Creates an instance of CosmosMongoDataTransferDataSourceSink class. + */ + public CosmosMongoDataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + @Override + public DataTransferComponent component() { + return this.component; + } + + /** + * Get the databaseName property: The databaseName property. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The databaseName property. + * + * @param databaseName the databaseName value to set. + * @return the CosmosMongoDataTransferDataSourceSink object itself. + */ + public CosmosMongoDataTransferDataSourceSink withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the collectionName property: The collectionName property. + * + * @return the collectionName value. + */ + public String collectionName() { + return this.collectionName; + } + + /** + * Set the collectionName property: The collectionName property. + * + * @param collectionName the collectionName value to set. + * @return the CosmosMongoDataTransferDataSourceSink object itself. + */ + public CosmosMongoDataTransferDataSourceSink withCollectionName(String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CosmosMongoDataTransferDataSourceSink withRemoteAccountName(String remoteAccountName) { + super.withRemoteAccountName(remoteAccountName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model CosmosMongoDataTransferDataSourceSink")); + } + if (collectionName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property collectionName in model CosmosMongoDataTransferDataSourceSink")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosMongoDataTransferDataSourceSink.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("remoteAccountName", remoteAccountName()); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("collectionName", this.collectionName); + jsonWriter.writeStringField("component", this.component == null ? null : this.component.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosMongoDataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosMongoDataTransferDataSourceSink 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 CosmosMongoDataTransferDataSourceSink. + */ + public static CosmosMongoDataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosMongoDataTransferDataSourceSink deserializedCosmosMongoDataTransferDataSourceSink + = new CosmosMongoDataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remoteAccountName".equals(fieldName)) { + deserializedCosmosMongoDataTransferDataSourceSink.withRemoteAccountName(reader.getString()); + } else if ("databaseName".equals(fieldName)) { + deserializedCosmosMongoDataTransferDataSourceSink.databaseName = reader.getString(); + } else if ("collectionName".equals(fieldName)) { + deserializedCosmosMongoDataTransferDataSourceSink.collectionName = reader.getString(); + } else if ("component".equals(fieldName)) { + deserializedCosmosMongoDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosMongoDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoVCoreDataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoVCoreDataTransferDataSourceSink.java new file mode 100644 index 000000000000..3c6d82eb656e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoVCoreDataTransferDataSourceSink.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB Mongo vCore API data source/sink. + */ +@Fluent +public final class CosmosMongoVCoreDataTransferDataSourceSink extends DataTransferDataSourceSink { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.COSMOS_DBMONGO_VCORE; + + /* + * The databaseName property. + */ + private String databaseName; + + /* + * The collectionName property. + */ + private String collectionName; + + /* + * The hostName property. + */ + private String hostname; + + /* + * The connectionStringKeyVaultUri property. + */ + private String connectionStringKeyVaultUri; + + /** + * Creates an instance of CosmosMongoVCoreDataTransferDataSourceSink class. + */ + public CosmosMongoVCoreDataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + @Override + public DataTransferComponent component() { + return this.component; + } + + /** + * Get the databaseName property: The databaseName property. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The databaseName property. + * + * @param databaseName the databaseName value to set. + * @return the CosmosMongoVCoreDataTransferDataSourceSink object itself. + */ + public CosmosMongoVCoreDataTransferDataSourceSink withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the collectionName property: The collectionName property. + * + * @return the collectionName value. + */ + public String collectionName() { + return this.collectionName; + } + + /** + * Set the collectionName property: The collectionName property. + * + * @param collectionName the collectionName value to set. + * @return the CosmosMongoVCoreDataTransferDataSourceSink object itself. + */ + public CosmosMongoVCoreDataTransferDataSourceSink withCollectionName(String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * Get the hostname property: The hostName property. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The hostName property. + * + * @param hostname the hostname value to set. + * @return the CosmosMongoVCoreDataTransferDataSourceSink object itself. + */ + public CosmosMongoVCoreDataTransferDataSourceSink withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the connectionStringKeyVaultUri property: The connectionStringKeyVaultUri property. + * + * @return the connectionStringKeyVaultUri value. + */ + public String connectionStringKeyVaultUri() { + return this.connectionStringKeyVaultUri; + } + + /** + * Set the connectionStringKeyVaultUri property: The connectionStringKeyVaultUri property. + * + * @param connectionStringKeyVaultUri the connectionStringKeyVaultUri value to set. + * @return the CosmosMongoVCoreDataTransferDataSourceSink object itself. + */ + public CosmosMongoVCoreDataTransferDataSourceSink + withConnectionStringKeyVaultUri(String connectionStringKeyVaultUri) { + this.connectionStringKeyVaultUri = connectionStringKeyVaultUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model CosmosMongoVCoreDataTransferDataSourceSink")); + } + if (collectionName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property collectionName in model CosmosMongoVCoreDataTransferDataSourceSink")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosMongoVCoreDataTransferDataSourceSink.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("collectionName", this.collectionName); + jsonWriter.writeStringField("component", this.component == null ? null : this.component.toString()); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeStringField("connectionStringKeyVaultUri", this.connectionStringKeyVaultUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosMongoVCoreDataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosMongoVCoreDataTransferDataSourceSink 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 CosmosMongoVCoreDataTransferDataSourceSink. + */ + public static CosmosMongoVCoreDataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosMongoVCoreDataTransferDataSourceSink deserializedCosmosMongoVCoreDataTransferDataSourceSink + = new CosmosMongoVCoreDataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedCosmosMongoVCoreDataTransferDataSourceSink.databaseName = reader.getString(); + } else if ("collectionName".equals(fieldName)) { + deserializedCosmosMongoVCoreDataTransferDataSourceSink.collectionName = reader.getString(); + } else if ("component".equals(fieldName)) { + deserializedCosmosMongoVCoreDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else if ("hostName".equals(fieldName)) { + deserializedCosmosMongoVCoreDataTransferDataSourceSink.hostname = reader.getString(); + } else if ("connectionStringKeyVaultUri".equals(fieldName)) { + deserializedCosmosMongoVCoreDataTransferDataSourceSink.connectionStringKeyVaultUri + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosMongoVCoreDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosSqlDataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosSqlDataTransferDataSourceSink.java new file mode 100644 index 000000000000..3b10121c00b7 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosSqlDataTransferDataSourceSink.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB No Sql API data source/sink. + */ +@Fluent +public final class CosmosSqlDataTransferDataSourceSink extends BaseCosmosDataTransferDataSourceSink { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.COSMOS_DBSQL; + + /* + * The databaseName property. + */ + private String databaseName; + + /* + * The containerName property. + */ + private String containerName; + + /** + * Creates an instance of CosmosSqlDataTransferDataSourceSink class. + */ + public CosmosSqlDataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + @Override + public DataTransferComponent component() { + return this.component; + } + + /** + * Get the databaseName property: The databaseName property. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The databaseName property. + * + * @param databaseName the databaseName value to set. + * @return the CosmosSqlDataTransferDataSourceSink object itself. + */ + public CosmosSqlDataTransferDataSourceSink withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the containerName property: The containerName property. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The containerName property. + * + * @param containerName the containerName value to set. + * @return the CosmosSqlDataTransferDataSourceSink object itself. + */ + public CosmosSqlDataTransferDataSourceSink withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CosmosSqlDataTransferDataSourceSink withRemoteAccountName(String remoteAccountName) { + super.withRemoteAccountName(remoteAccountName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model CosmosSqlDataTransferDataSourceSink")); + } + if (containerName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containerName in model CosmosSqlDataTransferDataSourceSink")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosSqlDataTransferDataSourceSink.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("remoteAccountName", remoteAccountName()); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeStringField("component", this.component == null ? null : this.component.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosSqlDataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosSqlDataTransferDataSourceSink 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 CosmosSqlDataTransferDataSourceSink. + */ + public static CosmosSqlDataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosSqlDataTransferDataSourceSink deserializedCosmosSqlDataTransferDataSourceSink + = new CosmosSqlDataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remoteAccountName".equals(fieldName)) { + deserializedCosmosSqlDataTransferDataSourceSink.withRemoteAccountName(reader.getString()); + } else if ("databaseName".equals(fieldName)) { + deserializedCosmosSqlDataTransferDataSourceSink.databaseName = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedCosmosSqlDataTransferDataSourceSink.containerName = reader.getString(); + } else if ("component".equals(fieldName)) { + deserializedCosmosSqlDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosSqlDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateJobRequest.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateJobRequest.java new file mode 100644 index 000000000000..dc52691984b5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateJobRequest.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.fluent.models.DataTransferJobProperties; +import java.io.IOException; + +/** + * Parameters to create Data Transfer Job. + */ +@Fluent +public final class CreateJobRequest extends ArmProxyResource { + /* + * Data Transfer Create Job Properties + */ + private DataTransferJobProperties properties; + + /* + * The type of Azure resource. + */ + private String type; + + /* + * The name of the database account. + */ + private String name; + + /* + * The unique resource identifier of the database account. + */ + private String id; + + /** + * Creates an instance of CreateJobRequest class. + */ + public CreateJobRequest() { + } + + /** + * Get the properties property: Data Transfer Create Job Properties. + * + * @return the properties value. + */ + public DataTransferJobProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Data Transfer Create Job Properties. + * + * @param properties the properties value to set. + * @return the CreateJobRequest object itself. + */ + public CreateJobRequest withProperties(DataTransferJobProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the database account. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The unique resource identifier of the database account. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model CreateJobRequest")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateJobRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateJobRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateJobRequest 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 CreateJobRequest. + */ + public static CreateJobRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateJobRequest deserializedCreateJobRequest = new CreateJobRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCreateJobRequest.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCreateJobRequest.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCreateJobRequest.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCreateJobRequest.properties = DataTransferJobProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCreateJobRequest; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicy.java new file mode 100644 index 000000000000..6296338c4537 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicy.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * Data masking policy for the container. + */ +@Fluent +public final class DataMaskingPolicy implements JsonSerializable { + /* + * List of JSON paths to include in the masking policy. + */ + private List includedPaths; + + /* + * List of JSON paths to exclude from masking. + */ + private List excludedPaths; + + /* + * Flag indicating whether the data masking policy is enabled. + */ + private Boolean isPolicyEnabled; + + /** + * Creates an instance of DataMaskingPolicy class. + */ + public DataMaskingPolicy() { + } + + /** + * Get the includedPaths property: List of JSON paths to include in the masking policy. + * + * @return the includedPaths value. + */ + public List includedPaths() { + return this.includedPaths; + } + + /** + * Set the includedPaths property: List of JSON paths to include in the masking policy. + * + * @param includedPaths the includedPaths value to set. + * @return the DataMaskingPolicy object itself. + */ + public DataMaskingPolicy withIncludedPaths(List includedPaths) { + this.includedPaths = includedPaths; + return this; + } + + /** + * Get the excludedPaths property: List of JSON paths to exclude from masking. + * + * @return the excludedPaths value. + */ + public List excludedPaths() { + return this.excludedPaths; + } + + /** + * Set the excludedPaths property: List of JSON paths to exclude from masking. + * + * @param excludedPaths the excludedPaths value to set. + * @return the DataMaskingPolicy object itself. + */ + public DataMaskingPolicy withExcludedPaths(List excludedPaths) { + this.excludedPaths = excludedPaths; + return this; + } + + /** + * Get the isPolicyEnabled property: Flag indicating whether the data masking policy is enabled. + * + * @return the isPolicyEnabled value. + */ + public Boolean isPolicyEnabled() { + return this.isPolicyEnabled; + } + + /** + * Set the isPolicyEnabled property: Flag indicating whether the data masking policy is enabled. + * + * @param isPolicyEnabled the isPolicyEnabled value to set. + * @return the DataMaskingPolicy object itself. + */ + public DataMaskingPolicy withIsPolicyEnabled(Boolean isPolicyEnabled) { + this.isPolicyEnabled = isPolicyEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (includedPaths() != null) { + includedPaths().forEach(e -> e.validate()); + } + if (excludedPaths() != null) { + excludedPaths().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("includedPaths", this.includedPaths, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("excludedPaths", this.excludedPaths, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("isPolicyEnabled", this.isPolicyEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataMaskingPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataMaskingPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataMaskingPolicy. + */ + public static DataMaskingPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataMaskingPolicy deserializedDataMaskingPolicy = new DataMaskingPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("includedPaths".equals(fieldName)) { + List includedPaths + = reader.readArray(reader1 -> DataMaskingPolicyIncludedPathsItem.fromJson(reader1)); + deserializedDataMaskingPolicy.includedPaths = includedPaths; + } else if ("excludedPaths".equals(fieldName)) { + List excludedPaths + = reader.readArray(reader1 -> DataMaskingPolicyExcludedPathsItem.fromJson(reader1)); + deserializedDataMaskingPolicy.excludedPaths = excludedPaths; + } else if ("isPolicyEnabled".equals(fieldName)) { + deserializedDataMaskingPolicy.isPolicyEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDataMaskingPolicy; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyExcludedPathsItem.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyExcludedPathsItem.java new file mode 100644 index 000000000000..d763e621f874 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyExcludedPathsItem.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * JSON path to exclude from masking. + */ +@Fluent +public final class DataMaskingPolicyExcludedPathsItem implements JsonSerializable { + /* + * The JSON path to exclude from masking (e.g. "/id"). + */ + private String path; + + /** + * Creates an instance of DataMaskingPolicyExcludedPathsItem class. + */ + public DataMaskingPolicyExcludedPathsItem() { + } + + /** + * Get the path property: The JSON path to exclude from masking (e.g. "/id"). + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The JSON path to exclude from masking (e.g. "/id"). + * + * @param path the path value to set. + * @return the DataMaskingPolicyExcludedPathsItem object itself. + */ + public DataMaskingPolicyExcludedPathsItem withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (path() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property path in model DataMaskingPolicyExcludedPathsItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataMaskingPolicyExcludedPathsItem.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataMaskingPolicyExcludedPathsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataMaskingPolicyExcludedPathsItem 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 DataMaskingPolicyExcludedPathsItem. + */ + public static DataMaskingPolicyExcludedPathsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataMaskingPolicyExcludedPathsItem deserializedDataMaskingPolicyExcludedPathsItem + = new DataMaskingPolicyExcludedPathsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedDataMaskingPolicyExcludedPathsItem.path = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataMaskingPolicyExcludedPathsItem; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyIncludedPathsItem.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyIncludedPathsItem.java new file mode 100644 index 000000000000..bf5f01d2bfde --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyIncludedPathsItem.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * JSON path to include in the masking policy. + */ +@Fluent +public final class DataMaskingPolicyIncludedPathsItem implements JsonSerializable { + /* + * The JSON path to apply masking (e.g. "/contact/phones"). + */ + private String path; + + /* + * Masking strategy to apply (e.g. "MaskSubstring"). + */ + private String strategy; + + /* + * Start position for substring masking (when applicable). + */ + private Integer startPosition; + + /* + * Length of substring to mask (when applicable). + */ + private Integer length; + + /** + * Creates an instance of DataMaskingPolicyIncludedPathsItem class. + */ + public DataMaskingPolicyIncludedPathsItem() { + } + + /** + * Get the path property: The JSON path to apply masking (e.g. "/contact/phones"). + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The JSON path to apply masking (e.g. "/contact/phones"). + * + * @param path the path value to set. + * @return the DataMaskingPolicyIncludedPathsItem object itself. + */ + public DataMaskingPolicyIncludedPathsItem withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the strategy property: Masking strategy to apply (e.g. "MaskSubstring"). + * + * @return the strategy value. + */ + public String strategy() { + return this.strategy; + } + + /** + * Set the strategy property: Masking strategy to apply (e.g. "MaskSubstring"). + * + * @param strategy the strategy value to set. + * @return the DataMaskingPolicyIncludedPathsItem object itself. + */ + public DataMaskingPolicyIncludedPathsItem withStrategy(String strategy) { + this.strategy = strategy; + return this; + } + + /** + * Get the startPosition property: Start position for substring masking (when applicable). + * + * @return the startPosition value. + */ + public Integer startPosition() { + return this.startPosition; + } + + /** + * Set the startPosition property: Start position for substring masking (when applicable). + * + * @param startPosition the startPosition value to set. + * @return the DataMaskingPolicyIncludedPathsItem object itself. + */ + public DataMaskingPolicyIncludedPathsItem withStartPosition(Integer startPosition) { + this.startPosition = startPosition; + return this; + } + + /** + * Get the length property: Length of substring to mask (when applicable). + * + * @return the length value. + */ + public Integer length() { + return this.length; + } + + /** + * Set the length property: Length of substring to mask (when applicable). + * + * @param length the length value to set. + * @return the DataMaskingPolicyIncludedPathsItem object itself. + */ + public DataMaskingPolicyIncludedPathsItem withLength(Integer length) { + this.length = length; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (path() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property path in model DataMaskingPolicyIncludedPathsItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataMaskingPolicyIncludedPathsItem.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("strategy", this.strategy); + jsonWriter.writeNumberField("startPosition", this.startPosition); + jsonWriter.writeNumberField("length", this.length); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataMaskingPolicyIncludedPathsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataMaskingPolicyIncludedPathsItem 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 DataMaskingPolicyIncludedPathsItem. + */ + public static DataMaskingPolicyIncludedPathsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataMaskingPolicyIncludedPathsItem deserializedDataMaskingPolicyIncludedPathsItem + = new DataMaskingPolicyIncludedPathsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedDataMaskingPolicyIncludedPathsItem.path = reader.getString(); + } else if ("strategy".equals(fieldName)) { + deserializedDataMaskingPolicyIncludedPathsItem.strategy = reader.getString(); + } else if ("startPosition".equals(fieldName)) { + deserializedDataMaskingPolicyIncludedPathsItem.startPosition + = reader.getNullable(JsonReader::getInt); + } else if ("length".equals(fieldName)) { + deserializedDataMaskingPolicyIncludedPathsItem.length = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDataMaskingPolicyIncludedPathsItem; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferComponent.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferComponent.java new file mode 100644 index 000000000000..7041441dc313 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferComponent.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for DataTransferComponent. + */ +public final class DataTransferComponent extends ExpandableStringEnum { + /** + * Static value CosmosDBCassandra for DataTransferComponent. + */ + public static final DataTransferComponent COSMOS_DBCASSANDRA = fromString("CosmosDBCassandra"); + + /** + * Static value CosmosDBMongo for DataTransferComponent. + */ + public static final DataTransferComponent COSMOS_DBMONGO = fromString("CosmosDBMongo"); + + /** + * Static value CosmosDBMongoVCore for DataTransferComponent. + */ + public static final DataTransferComponent COSMOS_DBMONGO_VCORE = fromString("CosmosDBMongoVCore"); + + /** + * Static value CosmosDBSql for DataTransferComponent. + */ + public static final DataTransferComponent COSMOS_DBSQL = fromString("CosmosDBSql"); + + /** + * Static value AzureBlobStorage for DataTransferComponent. + */ + public static final DataTransferComponent AZURE_BLOB_STORAGE = fromString("AzureBlobStorage"); + + /** + * Static value BaseCosmosDataTransferDataSourceSink for DataTransferComponent. + */ + public static final DataTransferComponent BASE_COSMOS_DATA_TRANSFER_DATA_SOURCE_SINK + = fromString("BaseCosmosDataTransferDataSourceSink"); + + /** + * Creates a new instance of DataTransferComponent value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataTransferComponent() { + } + + /** + * Creates or finds a DataTransferComponent from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataTransferComponent. + */ + public static DataTransferComponent fromString(String name) { + return fromString(name, DataTransferComponent.class); + } + + /** + * Gets known DataTransferComponent values. + * + * @return known DataTransferComponent values. + */ + public static Collection values() { + return values(DataTransferComponent.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferDataSourceSink.java new file mode 100644 index 000000000000..c845ab841018 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferDataSourceSink.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base class for all DataTransfer source/sink. + */ +@Immutable +public class DataTransferDataSourceSink implements JsonSerializable { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.fromString("DataTransferDataSourceSink"); + + /** + * Creates an instance of DataTransferDataSourceSink class. + */ + public DataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + public DataTransferComponent component() { + return this.component; + } + + /** + * 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("component", this.component == null ? null : this.component.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTransferDataSourceSink if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataTransferDataSourceSink. + */ + public static DataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("component".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("BaseCosmosDataTransferDataSourceSink".equals(discriminatorValue)) { + return BaseCosmosDataTransferDataSourceSink.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("CosmosDBCassandra".equals(discriminatorValue)) { + return CosmosCassandraDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else if ("CosmosDBMongo".equals(discriminatorValue)) { + return CosmosMongoDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else if ("CosmosDBSql".equals(discriminatorValue)) { + return CosmosSqlDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else if ("CosmosDBMongoVCore".equals(discriminatorValue)) { + return CosmosMongoVCoreDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else if ("AzureBlobStorage".equals(discriminatorValue)) { + return AzureBlobDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DataTransferDataSourceSink fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTransferDataSourceSink deserializedDataTransferDataSourceSink = new DataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("component".equals(fieldName)) { + deserializedDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferJobMode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferJobMode.java new file mode 100644 index 000000000000..b05fd5830741 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferJobMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Mode of job execution. + */ +public final class DataTransferJobMode extends ExpandableStringEnum { + /** + * Static value Offline for DataTransferJobMode. + */ + public static final DataTransferJobMode OFFLINE = fromString("Offline"); + + /** + * Static value Online for DataTransferJobMode. + */ + public static final DataTransferJobMode ONLINE = fromString("Online"); + + /** + * Creates a new instance of DataTransferJobMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataTransferJobMode() { + } + + /** + * Creates or finds a DataTransferJobMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataTransferJobMode. + */ + public static DataTransferJobMode fromString(String name) { + return fromString(name, DataTransferJobMode.class); + } + + /** + * Gets known DataTransferJobMode values. + * + * @return known DataTransferJobMode values. + */ + public static Collection values() { + return values(DataTransferJobMode.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountCreateUpdateParameters.java index cb922f255595..fd6975e4bd95 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountCreateUpdateParameters.java @@ -711,6 +711,32 @@ public List networkAclBypassResourceIds() { return this; } + /** + * Get the diagnosticLogSettings property: The Object representing the different Diagnostic log settings for the + * Cosmos DB Account. + * + * @return the diagnosticLogSettings value. + */ + public DiagnosticLogSettings diagnosticLogSettings() { + return this.innerProperties() == null ? null : this.innerProperties().diagnosticLogSettings(); + } + + /** + * Set the diagnosticLogSettings property: The Object representing the different Diagnostic log settings for the + * Cosmos DB Account. + * + * @param diagnosticLogSettings the diagnosticLogSettings value to set. + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters + withDiagnosticLogSettings(DiagnosticLogSettings diagnosticLogSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseAccountCreateUpdateProperties(); + } + this.innerProperties().withDiagnosticLogSettings(diagnosticLogSettings); + return this; + } + /** * Get the disableLocalAuth property: Opt-out of local authentication and ensure only MSI and AAD can be used * exclusively for authentication. @@ -784,6 +810,54 @@ public DatabaseAccountCreateUpdateParameters withCapacity(Capacity capacity) { return this; } + /** + * Get the capacityMode property: Indicates the capacityMode of the Cosmos DB account. + * + * @return the capacityMode value. + */ + public CapacityMode capacityMode() { + return this.innerProperties() == null ? null : this.innerProperties().capacityMode(); + } + + /** + * Set the capacityMode property: Indicates the capacityMode of the Cosmos DB account. + * + * @param capacityMode the capacityMode value to set. + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withCapacityMode(CapacityMode capacityMode) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseAccountCreateUpdateProperties(); + } + this.innerProperties().withCapacityMode(capacityMode); + return this; + } + + /** + * Get the enableMaterializedViews property: Flag to indicate whether to enable MaterializedViews on the Cosmos DB + * account. + * + * @return the enableMaterializedViews value. + */ + public Boolean enableMaterializedViews() { + return this.innerProperties() == null ? null : this.innerProperties().enableMaterializedViews(); + } + + /** + * Set the enableMaterializedViews property: Flag to indicate whether to enable MaterializedViews on the Cosmos DB + * account. + * + * @param enableMaterializedViews the enableMaterializedViews value to set. + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withEnableMaterializedViews(Boolean enableMaterializedViews) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseAccountCreateUpdateProperties(); + } + this.innerProperties().withEnableMaterializedViews(enableMaterializedViews); + return this; + } + /** * Get the keysMetadata property: This property is ignored during the update/create operation, as the metadata is * read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. @@ -971,6 +1045,56 @@ public Boolean enablePerRegionPerPartitionAutoscale() { return this; } + /** + * Get the enableAllVersionsAndDeletesChangeFeed property: Flag to indicate if All Versions and Deletes Change feed + * feature is enabled on the account. + * + * @return the enableAllVersionsAndDeletesChangeFeed value. + */ + public Boolean enableAllVersionsAndDeletesChangeFeed() { + return this.innerProperties() == null ? null : this.innerProperties().enableAllVersionsAndDeletesChangeFeed(); + } + + /** + * Set the enableAllVersionsAndDeletesChangeFeed property: Flag to indicate if All Versions and Deletes Change feed + * feature is enabled on the account. + * + * @param enableAllVersionsAndDeletesChangeFeed the enableAllVersionsAndDeletesChangeFeed value to set. + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters + withEnableAllVersionsAndDeletesChangeFeed(Boolean enableAllVersionsAndDeletesChangeFeed) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseAccountCreateUpdateProperties(); + } + this.innerProperties().withEnableAllVersionsAndDeletesChangeFeed(enableAllVersionsAndDeletesChangeFeed); + return this; + } + + /** + * Get the softDeleteConfiguration property: The configuration for soft delete on the Cosmos DB account. + * + * @return the softDeleteConfiguration value. + */ + public SoftDeleteConfiguration softDeleteConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().softDeleteConfiguration(); + } + + /** + * Set the softDeleteConfiguration property: The configuration for soft delete on the Cosmos DB account. + * + * @param softDeleteConfiguration the softDeleteConfiguration value to set. + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters + withSoftDeleteConfiguration(SoftDeleteConfiguration softDeleteConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseAccountCreateUpdateProperties(); + } + this.innerProperties().withSoftDeleteConfiguration(softDeleteConfiguration); + return this; + } + /** * Get the enforceHierarchicalPartitionKeyIdLastLevel property: Flag to indicate enabling/disabling of hierarchical * partition key ID last level enforcement on the account. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountRegenerateKeyParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountRegenerateKeyParameters.java index 0b23b0c1e639..180896b30728 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountRegenerateKeyParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountRegenerateKeyParameters.java @@ -23,6 +23,11 @@ public final class DatabaseAccountRegenerateKeyParameters */ private KeyKind keyKind; + /* + * Optional flag indicating whether to skip account keys last usage check. + */ + private Boolean skipAccountKeysLastUsageCheck; + /** * Creates an instance of DatabaseAccountRegenerateKeyParameters class. */ @@ -49,6 +54,29 @@ public DatabaseAccountRegenerateKeyParameters withKeyKind(KeyKind keyKind) { return this; } + /** + * Get the skipAccountKeysLastUsageCheck property: Optional flag indicating whether to skip account keys last usage + * check. + * + * @return the skipAccountKeysLastUsageCheck value. + */ + public Boolean skipAccountKeysLastUsageCheck() { + return this.skipAccountKeysLastUsageCheck; + } + + /** + * Set the skipAccountKeysLastUsageCheck property: Optional flag indicating whether to skip account keys last usage + * check. + * + * @param skipAccountKeysLastUsageCheck the skipAccountKeysLastUsageCheck value to set. + * @return the DatabaseAccountRegenerateKeyParameters object itself. + */ + public DatabaseAccountRegenerateKeyParameters + withSkipAccountKeysLastUsageCheck(Boolean skipAccountKeysLastUsageCheck) { + this.skipAccountKeysLastUsageCheck = skipAccountKeysLastUsageCheck; + return this; + } + /** * Validates the instance. * @@ -71,6 +99,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("keyKind", this.keyKind == null ? null : this.keyKind.toString()); + jsonWriter.writeBooleanField("skipAccountKeysLastUsageCheck", this.skipAccountKeysLastUsageCheck); return jsonWriter.writeEndObject(); } @@ -93,6 +122,9 @@ public static DatabaseAccountRegenerateKeyParameters fromJson(JsonReader jsonRea if ("keyKind".equals(fieldName)) { deserializedDatabaseAccountRegenerateKeyParameters.keyKind = KeyKind.fromString(reader.getString()); + } else if ("skipAccountKeysLastUsageCheck".equals(fieldName)) { + deserializedDatabaseAccountRegenerateKeyParameters.skipAccountKeysLastUsageCheck + = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountUpdateParameters.java index cb33454dfca9..63c2612b2948 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountUpdateParameters.java @@ -650,6 +650,31 @@ public DatabaseAccountUpdateParameters withNetworkAclBypassResourceIds(List { + /* + * Describe the level of detail with which queries are to be logged. + */ + private EnableFullTextQuery enableFullTextQuery; + + /** + * Creates an instance of DiagnosticLogSettings class. + */ + public DiagnosticLogSettings() { + } + + /** + * Get the enableFullTextQuery property: Describe the level of detail with which queries are to be logged. + * + * @return the enableFullTextQuery value. + */ + public EnableFullTextQuery enableFullTextQuery() { + return this.enableFullTextQuery; + } + + /** + * Set the enableFullTextQuery property: Describe the level of detail with which queries are to be logged. + * + * @param enableFullTextQuery the enableFullTextQuery value to set. + * @return the DiagnosticLogSettings object itself. + */ + public DiagnosticLogSettings withEnableFullTextQuery(EnableFullTextQuery enableFullTextQuery) { + this.enableFullTextQuery = enableFullTextQuery; + 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("enableFullTextQuery", + this.enableFullTextQuery == null ? null : this.enableFullTextQuery.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticLogSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticLogSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticLogSettings. + */ + public static DiagnosticLogSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticLogSettings deserializedDiagnosticLogSettings = new DiagnosticLogSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableFullTextQuery".equals(fieldName)) { + deserializedDiagnosticLogSettings.enableFullTextQuery + = EnableFullTextQuery.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticLogSettings; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/EnableFullTextQuery.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/EnableFullTextQuery.java new file mode 100644 index 000000000000..bb214f6b3f46 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/EnableFullTextQuery.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +/** + * Describe the level of detail with which queries are to be logged. + */ +public enum EnableFullTextQuery { + /** + * Enum value None. + */ + NONE("None"), + + /** + * Enum value True. + */ + TRUE("True"), + + /** + * Enum value False. + */ + FALSE("False"); + + /** + * The actual serialized value for a EnableFullTextQuery instance. + */ + private final String value; + + EnableFullTextQuery(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EnableFullTextQuery instance. + * + * @param value the serialized value to parse. + * @return the parsed EnableFullTextQuery object, or null if unable to parse. + */ + public static EnableFullTextQuery fromString(String value) { + if (value == null) { + return null; + } + EnableFullTextQuery[] items = EnableFullTextQuery.values(); + for (EnableFullTextQuery item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetAnalyticsPropertiesStorageLocationType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetAnalyticsPropertiesStorageLocationType.java new file mode 100644 index 000000000000..8d80cd49a5b2 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetAnalyticsPropertiesStorageLocationType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of the fleet analytics resource. + */ +public final class FleetAnalyticsPropertiesStorageLocationType + extends ExpandableStringEnum { + /** + * Static value StorageAccount for FleetAnalyticsPropertiesStorageLocationType. + */ + public static final FleetAnalyticsPropertiesStorageLocationType STORAGE_ACCOUNT = fromString("StorageAccount"); + + /** + * Static value FabricLakehouse for FleetAnalyticsPropertiesStorageLocationType. + */ + public static final FleetAnalyticsPropertiesStorageLocationType FABRIC_LAKEHOUSE = fromString("FabricLakehouse"); + + /** + * Creates a new instance of FleetAnalyticsPropertiesStorageLocationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FleetAnalyticsPropertiesStorageLocationType() { + } + + /** + * Creates or finds a FleetAnalyticsPropertiesStorageLocationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FleetAnalyticsPropertiesStorageLocationType. + */ + public static FleetAnalyticsPropertiesStorageLocationType fromString(String name) { + return fromString(name, FleetAnalyticsPropertiesStorageLocationType.class); + } + + /** + * Gets known FleetAnalyticsPropertiesStorageLocationType values. + * + * @return known FleetAnalyticsPropertiesStorageLocationType values. + */ + public static Collection values() { + return values(FleetAnalyticsPropertiesStorageLocationType.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetAuthenticationType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetAuthenticationType.java new file mode 100644 index 000000000000..527f4e638de5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetAuthenticationType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The authentication method used for the Garnet cluster. + */ +public final class GarnetAuthenticationType extends ExpandableStringEnum { + /** + * Microsoft Entra authentication. + */ + public static final GarnetAuthenticationType ENTRA = fromString("Entra"); + + /** + * Creates a new instance of GarnetAuthenticationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GarnetAuthenticationType() { + } + + /** + * Creates or finds a GarnetAuthenticationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GarnetAuthenticationType. + */ + public static GarnetAuthenticationType fromString(String name) { + return fromString(name, GarnetAuthenticationType.class); + } + + /** + * Gets known GarnetAuthenticationType values. + * + * @return known GarnetAuthenticationType values. + */ + public static Collection values() { + return values(GarnetAuthenticationType.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetCacheProvisioningState.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetCacheProvisioningState.java new file mode 100644 index 000000000000..f4173605363d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetCacheProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the resource at the time the operation was called. + */ +public final class GarnetCacheProvisioningState extends ExpandableStringEnum { + /** + * Creating. + */ + public static final GarnetCacheProvisioningState CREATING = fromString("Creating"); + + /** + * Updating. + */ + public static final GarnetCacheProvisioningState UPDATING = fromString("Updating"); + + /** + * Deleting. + */ + public static final GarnetCacheProvisioningState DELETING = fromString("Deleting"); + + /** + * Succeeded. + */ + public static final GarnetCacheProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Failed. + */ + public static final GarnetCacheProvisioningState FAILED = fromString("Failed"); + + /** + * Canceled. + */ + public static final GarnetCacheProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of GarnetCacheProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GarnetCacheProvisioningState() { + } + + /** + * Creates or finds a GarnetCacheProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GarnetCacheProvisioningState. + */ + public static GarnetCacheProvisioningState fromString(String name) { + return fromString(name, GarnetCacheProvisioningState.class); + } + + /** + * Gets known GarnetCacheProvisioningState values. + * + * @return known GarnetCacheProvisioningState values. + */ + public static Collection values() { + return values(GarnetCacheProvisioningState.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatch.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatch.java new file mode 100644 index 000000000000..16c4730da9f8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatch.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * Representation of a Garnet cache cluster for updates. + */ +@Fluent +public final class GarnetClusterResourcePatch implements JsonSerializable { + /* + * Properties of a Garnet cache cluster for updates. + */ + private GarnetClusterResourcePatchProperties properties; + + /** + * Creates an instance of GarnetClusterResourcePatch class. + */ + public GarnetClusterResourcePatch() { + } + + /** + * Get the properties property: Properties of a Garnet cache cluster for updates. + * + * @return the properties value. + */ + public GarnetClusterResourcePatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of a Garnet cache cluster for updates. + * + * @param properties the properties value to set. + * @return the GarnetClusterResourcePatch object itself. + */ + public GarnetClusterResourcePatch withProperties(GarnetClusterResourcePatchProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GarnetClusterResourcePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GarnetClusterResourcePatch if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GarnetClusterResourcePatch. + */ + public static GarnetClusterResourcePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GarnetClusterResourcePatch deserializedGarnetClusterResourcePatch = new GarnetClusterResourcePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedGarnetClusterResourcePatch.properties + = GarnetClusterResourcePatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGarnetClusterResourcePatch; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatchProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatchProperties.java new file mode 100644 index 000000000000..7e7688eb4caa --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatchProperties.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a Garnet cache cluster for updates. + */ +@Fluent +public final class GarnetClusterResourcePatchProperties + implements JsonSerializable { + /* + * Type of the cluster. If set to Production, some operations might not be permitted on cluster. + */ + private ClusterType clusterType; + + /* + * Extensions to be added or updated on cluster. + */ + private List extensions; + + /* + * The authentication method used for the Garnet cluster. + */ + private GarnetAuthenticationType authenticationMethod; + + /* + * Flag to indicate if persistence is enabled for the Garnet cluster. + */ + private Boolean persistence; + + /** + * Creates an instance of GarnetClusterResourcePatchProperties class. + */ + public GarnetClusterResourcePatchProperties() { + } + + /** + * Get the clusterType property: Type of the cluster. If set to Production, some operations might not be permitted + * on cluster. + * + * @return the clusterType value. + */ + public ClusterType clusterType() { + return this.clusterType; + } + + /** + * Set the clusterType property: Type of the cluster. If set to Production, some operations might not be permitted + * on cluster. + * + * @param clusterType the clusterType value to set. + * @return the GarnetClusterResourcePatchProperties object itself. + */ + public GarnetClusterResourcePatchProperties withClusterType(ClusterType clusterType) { + this.clusterType = clusterType; + return this; + } + + /** + * Get the extensions property: Extensions to be added or updated on cluster. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: Extensions to be added or updated on cluster. + * + * @param extensions the extensions value to set. + * @return the GarnetClusterResourcePatchProperties object itself. + */ + public GarnetClusterResourcePatchProperties withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the authenticationMethod property: The authentication method used for the Garnet cluster. + * + * @return the authenticationMethod value. + */ + public GarnetAuthenticationType authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set the authenticationMethod property: The authentication method used for the Garnet cluster. + * + * @param authenticationMethod the authenticationMethod value to set. + * @return the GarnetClusterResourcePatchProperties object itself. + */ + public GarnetClusterResourcePatchProperties + withAuthenticationMethod(GarnetAuthenticationType authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Get the persistence property: Flag to indicate if persistence is enabled for the Garnet cluster. + * + * @return the persistence value. + */ + public Boolean persistence() { + return this.persistence; + } + + /** + * Set the persistence property: Flag to indicate if persistence is enabled for the Garnet cluster. + * + * @param persistence the persistence value to set. + * @return the GarnetClusterResourcePatchProperties object itself. + */ + public GarnetClusterResourcePatchProperties withPersistence(Boolean persistence) { + this.persistence = persistence; + 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("clusterType", this.clusterType == null ? null : this.clusterType.toString()); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("authenticationMethod", + this.authenticationMethod == null ? null : this.authenticationMethod.toString()); + jsonWriter.writeBooleanField("persistence", this.persistence); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GarnetClusterResourcePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GarnetClusterResourcePatchProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GarnetClusterResourcePatchProperties. + */ + public static GarnetClusterResourcePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GarnetClusterResourcePatchProperties deserializedGarnetClusterResourcePatchProperties + = new GarnetClusterResourcePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterType".equals(fieldName)) { + deserializedGarnetClusterResourcePatchProperties.clusterType + = ClusterType.fromString(reader.getString()); + } else if ("extensions".equals(fieldName)) { + List extensions = reader.readArray(reader1 -> reader1.getString()); + deserializedGarnetClusterResourcePatchProperties.extensions = extensions; + } else if ("authenticationMethod".equals(fieldName)) { + deserializedGarnetClusterResourcePatchProperties.authenticationMethod + = GarnetAuthenticationType.fromString(reader.getString()); + } else if ("persistence".equals(fieldName)) { + deserializedGarnetClusterResourcePatchProperties.persistence + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedGarnetClusterResourcePatchProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourceProperties.java new file mode 100644 index 000000000000..c4e9415b3624 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourceProperties.java @@ -0,0 +1,442 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a Garnet cache cluster. + */ +@Fluent +public final class GarnetClusterResourceProperties implements JsonSerializable { + /* + * The provisioning state of the resource. + */ + private GarnetCacheProvisioningState provisioningState; + + /* + * Resource id of a subnet that this cluster's management service should have its network interface attached to. The + * subnet must be routable to all subnets that will be delegated to data centers. The resource id must be of the + * form '/subscriptions//resourceGroups//providers/Microsoft.Network/virtualNetworks//subnets/' + */ + private String subnetId; + + /* + * Endpoints for clients to connect to the cluster. + */ + private List endPoints; + + /* + * Number of copies of data maintained by the cluster. + */ + private Integer replicationFactor; + + /* + * Number of shards in the cluster. + */ + private Integer shardCount; + + /* + * Virtual Machine SKU used for clusters. Default value is Standard_DS14_v2. + */ + private String nodeSku; + + /* + * If the data center has Availability Zone support, apply it to the Virtual Machine ScaleSet that host the garnet + * cluster virtual machines. + */ + private Boolean availabilityZone; + + /* + * The authentication method used for the Garnet cluster. + */ + private GarnetAuthenticationType authenticationMethod; + + /* + * Flag to indicate if persistence is enabled for the Garnet cluster. + */ + private Boolean persistence; + + /* + * Allocation state of the cluster and data center resources. Active implies the virtual machines of the cluster are + * allocated, deallocated implies virtual machines and resources are deallocated. + */ + private AllocationState allocationState; + + /* + * Type of the cluster. If set to Production, some operations might not be permitted on cluster. + */ + private ClusterType clusterType; + + /* + * Error related to resource provisioning. + */ + private ManagementError provisionError; + + /* + * Extensions to be added or updated on cluster. + */ + private List extensions; + + /** + * Creates an instance of GarnetClusterResourceProperties class. + */ + public GarnetClusterResourceProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public GarnetCacheProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the subnetId property: Resource id of a subnet that this cluster's management service should have its network + * interface attached to. The subnet must be routable to all subnets that will be delegated to data centers. The + * resource id must be of the form '/subscriptions/<subscription id>/resourceGroups/<resource + * group>/providers/Microsoft.Network/virtualNetworks/<virtual network>/subnets/<subnet>'. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: Resource id of a subnet that this cluster's management service should have its network + * interface attached to. The subnet must be routable to all subnets that will be delegated to data centers. The + * resource id must be of the form '/subscriptions/<subscription id>/resourceGroups/<resource + * group>/providers/Microsoft.Network/virtualNetworks/<virtual network>/subnets/<subnet>'. + * + * @param subnetId the subnetId value to set. + * @return the GarnetClusterResourceProperties object itself. + */ + public GarnetClusterResourceProperties withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the endPoints property: Endpoints for clients to connect to the cluster. + * + * @return the endPoints value. + */ + public List endPoints() { + return this.endPoints; + } + + /** + * Get the replicationFactor property: Number of copies of data maintained by the cluster. + * + * @return the replicationFactor value. + */ + public Integer replicationFactor() { + return this.replicationFactor; + } + + /** + * Set the replicationFactor property: Number of copies of data maintained by the cluster. + * + * @param replicationFactor the replicationFactor value to set. + * @return the GarnetClusterResourceProperties object itself. + */ + public GarnetClusterResourceProperties withReplicationFactor(Integer replicationFactor) { + this.replicationFactor = replicationFactor; + return this; + } + + /** + * Get the shardCount property: Number of shards in the cluster. + * + * @return the shardCount value. + */ + public Integer shardCount() { + return this.shardCount; + } + + /** + * Set the shardCount property: Number of shards in the cluster. + * + * @param shardCount the shardCount value to set. + * @return the GarnetClusterResourceProperties object itself. + */ + public GarnetClusterResourceProperties withShardCount(Integer shardCount) { + this.shardCount = shardCount; + return this; + } + + /** + * Get the nodeSku property: Virtual Machine SKU used for clusters. Default value is Standard_DS14_v2. + * + * @return the nodeSku value. + */ + public String nodeSku() { + return this.nodeSku; + } + + /** + * Set the nodeSku property: Virtual Machine SKU used for clusters. Default value is Standard_DS14_v2. + * + * @param nodeSku the nodeSku value to set. + * @return the GarnetClusterResourceProperties object itself. + */ + public GarnetClusterResourceProperties withNodeSku(String nodeSku) { + this.nodeSku = nodeSku; + return this; + } + + /** + * Get the availabilityZone property: If the data center has Availability Zone support, apply it to the Virtual + * Machine ScaleSet that host the garnet cluster virtual machines. + * + * @return the availabilityZone value. + */ + public Boolean availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: If the data center has Availability Zone support, apply it to the Virtual + * Machine ScaleSet that host the garnet cluster virtual machines. + * + * @param availabilityZone the availabilityZone value to set. + * @return the GarnetClusterResourceProperties object itself. + */ + public GarnetClusterResourceProperties withAvailabilityZone(Boolean availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the authenticationMethod property: The authentication method used for the Garnet cluster. + * + * @return the authenticationMethod value. + */ + public GarnetAuthenticationType authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set the authenticationMethod property: The authentication method used for the Garnet cluster. + * + * @param authenticationMethod the authenticationMethod value to set. + * @return the GarnetClusterResourceProperties object itself. + */ + public GarnetClusterResourceProperties withAuthenticationMethod(GarnetAuthenticationType authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Get the persistence property: Flag to indicate if persistence is enabled for the Garnet cluster. + * + * @return the persistence value. + */ + public Boolean persistence() { + return this.persistence; + } + + /** + * Set the persistence property: Flag to indicate if persistence is enabled for the Garnet cluster. + * + * @param persistence the persistence value to set. + * @return the GarnetClusterResourceProperties object itself. + */ + public GarnetClusterResourceProperties withPersistence(Boolean persistence) { + this.persistence = persistence; + return this; + } + + /** + * Get the allocationState property: Allocation state of the cluster and data center resources. Active implies the + * virtual machines of the cluster are allocated, deallocated implies virtual machines and resources are + * deallocated. + * + * @return the allocationState value. + */ + public AllocationState allocationState() { + return this.allocationState; + } + + /** + * Set the allocationState property: Allocation state of the cluster and data center resources. Active implies the + * virtual machines of the cluster are allocated, deallocated implies virtual machines and resources are + * deallocated. + * + * @param allocationState the allocationState value to set. + * @return the GarnetClusterResourceProperties object itself. + */ + public GarnetClusterResourceProperties withAllocationState(AllocationState allocationState) { + this.allocationState = allocationState; + return this; + } + + /** + * Get the clusterType property: Type of the cluster. If set to Production, some operations might not be permitted + * on cluster. + * + * @return the clusterType value. + */ + public ClusterType clusterType() { + return this.clusterType; + } + + /** + * Set the clusterType property: Type of the cluster. If set to Production, some operations might not be permitted + * on cluster. + * + * @param clusterType the clusterType value to set. + * @return the GarnetClusterResourceProperties object itself. + */ + public GarnetClusterResourceProperties withClusterType(ClusterType clusterType) { + this.clusterType = clusterType; + return this; + } + + /** + * Get the provisionError property: Error related to resource provisioning. + * + * @return the provisionError value. + */ + public ManagementError provisionError() { + return this.provisionError; + } + + /** + * Set the provisionError property: Error related to resource provisioning. + * + * @param provisionError the provisionError value to set. + * @return the GarnetClusterResourceProperties object itself. + */ + public GarnetClusterResourceProperties withProvisionError(ManagementError provisionError) { + this.provisionError = provisionError; + return this; + } + + /** + * Get the extensions property: Extensions to be added or updated on cluster. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: Extensions to be added or updated on cluster. + * + * @param extensions the extensions value to set. + * @return the GarnetClusterResourceProperties object itself. + */ + public GarnetClusterResourceProperties withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endPoints() != null) { + endPoints().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeNumberField("replicationFactor", this.replicationFactor); + jsonWriter.writeNumberField("shardCount", this.shardCount); + jsonWriter.writeStringField("nodeSku", this.nodeSku); + jsonWriter.writeBooleanField("availabilityZone", this.availabilityZone); + jsonWriter.writeStringField("authenticationMethod", + this.authenticationMethod == null ? null : this.authenticationMethod.toString()); + jsonWriter.writeBooleanField("persistence", this.persistence); + jsonWriter.writeStringField("allocationState", + this.allocationState == null ? null : this.allocationState.toString()); + jsonWriter.writeStringField("clusterType", this.clusterType == null ? null : this.clusterType.toString()); + jsonWriter.writeJsonField("provisionError", this.provisionError); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GarnetClusterResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GarnetClusterResourceProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GarnetClusterResourceProperties. + */ + public static GarnetClusterResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GarnetClusterResourceProperties deserializedGarnetClusterResourceProperties + = new GarnetClusterResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedGarnetClusterResourceProperties.provisioningState + = GarnetCacheProvisioningState.fromString(reader.getString()); + } else if ("subnetId".equals(fieldName)) { + deserializedGarnetClusterResourceProperties.subnetId = reader.getString(); + } else if ("endPoints".equals(fieldName)) { + List endPoints + = reader.readArray(reader1 -> GarnetClusterResourcePropertiesEndPointsItem.fromJson(reader1)); + deserializedGarnetClusterResourceProperties.endPoints = endPoints; + } else if ("replicationFactor".equals(fieldName)) { + deserializedGarnetClusterResourceProperties.replicationFactor + = reader.getNullable(JsonReader::getInt); + } else if ("shardCount".equals(fieldName)) { + deserializedGarnetClusterResourceProperties.shardCount = reader.getNullable(JsonReader::getInt); + } else if ("nodeSku".equals(fieldName)) { + deserializedGarnetClusterResourceProperties.nodeSku = reader.getString(); + } else if ("availabilityZone".equals(fieldName)) { + deserializedGarnetClusterResourceProperties.availabilityZone + = reader.getNullable(JsonReader::getBoolean); + } else if ("authenticationMethod".equals(fieldName)) { + deserializedGarnetClusterResourceProperties.authenticationMethod + = GarnetAuthenticationType.fromString(reader.getString()); + } else if ("persistence".equals(fieldName)) { + deserializedGarnetClusterResourceProperties.persistence + = reader.getNullable(JsonReader::getBoolean); + } else if ("allocationState".equals(fieldName)) { + deserializedGarnetClusterResourceProperties.allocationState + = AllocationState.fromString(reader.getString()); + } else if ("clusterType".equals(fieldName)) { + deserializedGarnetClusterResourceProperties.clusterType + = ClusterType.fromString(reader.getString()); + } else if ("provisionError".equals(fieldName)) { + deserializedGarnetClusterResourceProperties.provisionError = ManagementError.fromJson(reader); + } else if ("extensions".equals(fieldName)) { + List extensions = reader.readArray(reader1 -> reader1.getString()); + deserializedGarnetClusterResourceProperties.extensions = extensions; + } else { + reader.skipChildren(); + } + } + + return deserializedGarnetClusterResourceProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePropertiesEndPointsItem.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePropertiesEndPointsItem.java new file mode 100644 index 000000000000..0b20b8d938e7 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePropertiesEndPointsItem.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Endpoint for clients to connect to the cluster. + */ +@Immutable +public final class GarnetClusterResourcePropertiesEndPointsItem + implements JsonSerializable { + /* + * Ipv4 address of the endpoint. + */ + private String ipAddress; + + /* + * Port number. + */ + private Integer port; + + /** + * Creates an instance of GarnetClusterResourcePropertiesEndPointsItem class. + */ + private GarnetClusterResourcePropertiesEndPointsItem() { + } + + /** + * Get the ipAddress property: Ipv4 address of the endpoint. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the port property: Port number. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * 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("ipAddress", this.ipAddress); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GarnetClusterResourcePropertiesEndPointsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GarnetClusterResourcePropertiesEndPointsItem if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GarnetClusterResourcePropertiesEndPointsItem. + */ + public static GarnetClusterResourcePropertiesEndPointsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GarnetClusterResourcePropertiesEndPointsItem deserializedGarnetClusterResourcePropertiesEndPointsItem + = new GarnetClusterResourcePropertiesEndPointsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipAddress".equals(fieldName)) { + deserializedGarnetClusterResourcePropertiesEndPointsItem.ipAddress = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedGarnetClusterResourcePropertiesEndPointsItem.port + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedGarnetClusterResourcePropertiesEndPointsItem; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResource.java new file mode 100644 index 000000000000..f3d4be58a8d0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResource.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * Cosmos DB Graph resource object. + */ +@Fluent +public class GraphResource implements JsonSerializable { + /* + * Name of the Cosmos DB Graph + */ + private String id; + + /** + * Creates an instance of GraphResource class. + */ + public GraphResource() { + } + + /** + * Get the id property: Name of the Cosmos DB Graph. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Name of the Cosmos DB Graph. + * + * @param id the id value to set. + * @return the GraphResource object itself. + */ + public GraphResource withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model GraphResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GraphResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResource 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 GraphResource. + */ + public static GraphResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResource deserializedGraphResource = new GraphResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGraphResource.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceCreateUpdateParameters.java new file mode 100644 index 000000000000..132a45335589 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceCreateUpdateParameters.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.fluent.models.GraphResourceCreateUpdateProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Parameters to create and update Cosmos DB Graph resource. + */ +@Fluent +public final class GraphResourceCreateUpdateParameters extends ArmResourceProperties { + /* + * Properties to create and update Azure Cosmos DB Graph resource. + */ + private GraphResourceCreateUpdateProperties innerProperties = new GraphResourceCreateUpdateProperties(); + + /* + * The type of Azure resource. + */ + private String type; + + /* + * The name of the ARM resource. + */ + private String name; + + /* + * The unique resource identifier of the ARM resource. + */ + private String id; + + /** + * Creates an instance of GraphResourceCreateUpdateParameters class. + */ + public GraphResourceCreateUpdateParameters() { + } + + /** + * Get the innerProperties property: Properties to create and update Azure Cosmos DB Graph resource. + * + * @return the innerProperties value. + */ + private GraphResourceCreateUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the ARM resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The unique resource identifier of the ARM resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public GraphResourceCreateUpdateParameters withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GraphResourceCreateUpdateParameters withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GraphResourceCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + + /** + * Get the resource property: The standard JSON format of a Graph resource. + * + * @return the resource value. + */ + public GraphResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Set the resource property: The standard JSON format of a Graph resource. + * + * @param resource the resource value to set. + * @return the GraphResourceCreateUpdateParameters object itself. + */ + public GraphResourceCreateUpdateParameters withResource(GraphResource resource) { + if (this.innerProperties() == null) { + this.innerProperties = new GraphResourceCreateUpdateProperties(); + } + this.innerProperties().withResource(resource); + return this; + } + + /** + * Get the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @return the options value. + */ + public CreateUpdateOptions options() { + return this.innerProperties() == null ? null : this.innerProperties().options(); + } + + /** + * Set the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @param options the options value to set. + * @return the GraphResourceCreateUpdateParameters object itself. + */ + public GraphResourceCreateUpdateParameters withOptions(CreateUpdateOptions options) { + if (this.innerProperties() == null) { + this.innerProperties = new GraphResourceCreateUpdateProperties(); + } + this.innerProperties().withOptions(options); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model GraphResourceCreateUpdateParameters")); + } else { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GraphResourceCreateUpdateParameters.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("identity", identity()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourceCreateUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourceCreateUpdateParameters 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 GraphResourceCreateUpdateParameters. + */ + public static GraphResourceCreateUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourceCreateUpdateParameters deserializedGraphResourceCreateUpdateParameters + = new GraphResourceCreateUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGraphResourceCreateUpdateParameters.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGraphResourceCreateUpdateParameters.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGraphResourceCreateUpdateParameters.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedGraphResourceCreateUpdateParameters.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGraphResourceCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedGraphResourceCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedGraphResourceCreateUpdateParameters.innerProperties + = GraphResourceCreateUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourceCreateUpdateParameters; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesOptions.java new file mode 100644 index 000000000000..79c6e686f8cb --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesOptions.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The GraphResourceGetPropertiesOptions model. + */ +@Immutable +public final class GraphResourceGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + + /** + * Creates an instance of GraphResourceGetPropertiesOptions class. + */ + private GraphResourceGetPropertiesOptions() { + } + + /** + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. + */ + @Override + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; + } + + /** + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. + */ + @Override + public Integer throughput() { + return this.throughput; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (autoscaleSettings() != null) { + autoscaleSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("throughput", throughput()); + jsonWriter.writeJsonField("autoscaleSettings", autoscaleSettings()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourceGetPropertiesOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourceGetPropertiesOptions if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphResourceGetPropertiesOptions. + */ + public static GraphResourceGetPropertiesOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourceGetPropertiesOptions deserializedGraphResourceGetPropertiesOptions + = new GraphResourceGetPropertiesOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("throughput".equals(fieldName)) { + deserializedGraphResourceGetPropertiesOptions.throughput = reader.getNullable(JsonReader::getInt); + } else if ("autoscaleSettings".equals(fieldName)) { + deserializedGraphResourceGetPropertiesOptions.autoscaleSettings + = AutoscaleSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourceGetPropertiesOptions; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesResource.java new file mode 100644 index 000000000000..b0facce9b0d8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesResource.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The GraphResourceGetPropertiesResource model. + */ +@Immutable +public final class GraphResourceGetPropertiesResource extends GraphResource { + /** + * Creates an instance of GraphResourceGetPropertiesResource class. + */ + private GraphResourceGetPropertiesResource() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property id in model GraphResourceGetPropertiesResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GraphResourceGetPropertiesResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourceGetPropertiesResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourceGetPropertiesResource 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 GraphResourceGetPropertiesResource. + */ + public static GraphResourceGetPropertiesResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourceGetPropertiesResource deserializedGraphResourceGetPropertiesResource + = new GraphResourceGetPropertiesResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGraphResourceGetPropertiesResource.withId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourceGetPropertiesResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IssueType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IssueType.java new file mode 100644 index 000000000000..a54c57901ff0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IssueType.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of issue. + */ +public final class IssueType extends ExpandableStringEnum { + /** + * Unknown issue type. + */ + public static final IssueType UNKNOWN = fromString("Unknown"); + + /** + * An error occurred while applying the network security perimeter (NSP) configuration. + */ + public static final IssueType CONFIGURATION_PROPAGATION_FAILURE = fromString("ConfigurationPropagationFailure"); + + /** + * A network connectivity issue is happening on the resource which could be addressed either by adding new resources + * to the network security perimeter (NSP) or by modifying access rules. + */ + public static final IssueType MISSING_PERIMETER_CONFIGURATION = fromString("MissingPerimeterConfiguration"); + + /** + * An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound + * traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to + * perform outbound access as a member of the NSP. + */ + public static final IssueType MISSING_IDENTITY_CONFIGURATION = fromString("MissingIdentityConfiguration"); + + /** + * Creates a new instance of IssueType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IssueType() { + } + + /** + * Creates or finds a IssueType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IssueType. + */ + public static IssueType fromString(String name) { + return fromString(name, IssueType.class); + } + + /** + * Gets known IssueType values. + * + * @return known IssueType values. + */ + public static Collection values() { + return values(IssueType.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDefinition.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDefinition.java new file mode 100644 index 000000000000..6042d80abfe3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDefinition.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * Materialized View definition for the container. + */ +@Fluent +public final class MaterializedViewDefinition implements JsonSerializable { + /* + * An unique identifier for the source collection. This is a system generated property. + */ + private String sourceCollectionRid; + + /* + * The name of the source container on which the Materialized View will be created. + */ + private String sourceCollectionId; + + /* + * The definition should be an SQL query which would be used to fetch data from the source container to populate + * into the Materialized View container. + */ + private String definition; + + /* + * Throughput bucket assigned for the materialized view operations on target container. + */ + private Integer throughputBucketForBuild; + + /** + * Creates an instance of MaterializedViewDefinition class. + */ + public MaterializedViewDefinition() { + } + + /** + * Get the sourceCollectionRid property: An unique identifier for the source collection. This is a system generated + * property. + * + * @return the sourceCollectionRid value. + */ + public String sourceCollectionRid() { + return this.sourceCollectionRid; + } + + /** + * Get the sourceCollectionId property: The name of the source container on which the Materialized View will be + * created. + * + * @return the sourceCollectionId value. + */ + public String sourceCollectionId() { + return this.sourceCollectionId; + } + + /** + * Set the sourceCollectionId property: The name of the source container on which the Materialized View will be + * created. + * + * @param sourceCollectionId the sourceCollectionId value to set. + * @return the MaterializedViewDefinition object itself. + */ + public MaterializedViewDefinition withSourceCollectionId(String sourceCollectionId) { + this.sourceCollectionId = sourceCollectionId; + return this; + } + + /** + * Get the definition property: The definition should be an SQL query which would be used to fetch data from the + * source container to populate into the Materialized View container. + * + * @return the definition value. + */ + public String definition() { + return this.definition; + } + + /** + * Set the definition property: The definition should be an SQL query which would be used to fetch data from the + * source container to populate into the Materialized View container. + * + * @param definition the definition value to set. + * @return the MaterializedViewDefinition object itself. + */ + public MaterializedViewDefinition withDefinition(String definition) { + this.definition = definition; + return this; + } + + /** + * Get the throughputBucketForBuild property: Throughput bucket assigned for the materialized view operations on + * target container. + * + * @return the throughputBucketForBuild value. + */ + public Integer throughputBucketForBuild() { + return this.throughputBucketForBuild; + } + + /** + * Set the throughputBucketForBuild property: Throughput bucket assigned for the materialized view operations on + * target container. + * + * @param throughputBucketForBuild the throughputBucketForBuild value to set. + * @return the MaterializedViewDefinition object itself. + */ + public MaterializedViewDefinition withThroughputBucketForBuild(Integer throughputBucketForBuild) { + this.throughputBucketForBuild = throughputBucketForBuild; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceCollectionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceCollectionId in model MaterializedViewDefinition")); + } + if (definition() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property definition in model MaterializedViewDefinition")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MaterializedViewDefinition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceCollectionId", this.sourceCollectionId); + jsonWriter.writeStringField("definition", this.definition); + jsonWriter.writeNumberField("throughputBucketForBuild", this.throughputBucketForBuild); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaterializedViewDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaterializedViewDefinition 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 MaterializedViewDefinition. + */ + public static MaterializedViewDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaterializedViewDefinition deserializedMaterializedViewDefinition = new MaterializedViewDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceCollectionId".equals(fieldName)) { + deserializedMaterializedViewDefinition.sourceCollectionId = reader.getString(); + } else if ("definition".equals(fieldName)) { + deserializedMaterializedViewDefinition.definition = reader.getString(); + } else if ("sourceCollectionRid".equals(fieldName)) { + deserializedMaterializedViewDefinition.sourceCollectionRid = reader.getString(); + } else if ("throughputBucketForBuild".equals(fieldName)) { + deserializedMaterializedViewDefinition.throughputBucketForBuild + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMaterializedViewDefinition; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDetails.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDetails.java new file mode 100644 index 000000000000..f5d1df314e1f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDetails.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * MaterializedViewDetails, contains Id & _rid fields of materialized view. + */ +@Fluent +public final class MaterializedViewDetails implements JsonSerializable { + /* + * Id field of Materialized container. + */ + private String id; + + /* + * _rid field of Materialized container. + */ + private String rid; + + /** + * Creates an instance of MaterializedViewDetails class. + */ + public MaterializedViewDetails() { + } + + /** + * Get the id property: Id field of Materialized container. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id field of Materialized container. + * + * @param id the id value to set. + * @return the MaterializedViewDetails object itself. + */ + public MaterializedViewDetails withId(String id) { + this.id = id; + return this; + } + + /** + * Get the rid property: _rid field of Materialized container. + * + * @return the rid value. + */ + public String rid() { + return this.rid; + } + + /** + * Set the rid property: _rid field of Materialized container. + * + * @param rid the rid value to set. + * @return the MaterializedViewDetails object itself. + */ + public MaterializedViewDetails withRid(String rid) { + this.rid = rid; + 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("id", this.id); + jsonWriter.writeStringField("_rid", this.rid); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaterializedViewDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaterializedViewDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaterializedViewDetails. + */ + public static MaterializedViewDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaterializedViewDetails deserializedMaterializedViewDetails = new MaterializedViewDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMaterializedViewDetails.id = reader.getString(); + } else if ("_rid".equals(fieldName)) { + deserializedMaterializedViewDetails.rid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMaterializedViewDetails; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsProperties.java new file mode 100644 index 000000000000..7a76fb9f7996 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * Materialized Views Properties for the source container. + */ +@Fluent +public final class MaterializedViewsProperties implements JsonSerializable { + /* + * Throughput bucket assigned for the materialized view operations on source container. + */ + private Integer throughputBucketForBuild; + + /** + * Creates an instance of MaterializedViewsProperties class. + */ + public MaterializedViewsProperties() { + } + + /** + * Get the throughputBucketForBuild property: Throughput bucket assigned for the materialized view operations on + * source container. + * + * @return the throughputBucketForBuild value. + */ + public Integer throughputBucketForBuild() { + return this.throughputBucketForBuild; + } + + /** + * Set the throughputBucketForBuild property: Throughput bucket assigned for the materialized view operations on + * source container. + * + * @param throughputBucketForBuild the throughputBucketForBuild value to set. + * @return the MaterializedViewsProperties object itself. + */ + public MaterializedViewsProperties withThroughputBucketForBuild(Integer throughputBucketForBuild) { + this.throughputBucketForBuild = throughputBucketForBuild; + 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.writeNumberField("throughputBucketForBuild", this.throughputBucketForBuild); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaterializedViewsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaterializedViewsProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaterializedViewsProperties. + */ + public static MaterializedViewsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaterializedViewsProperties deserializedMaterializedViewsProperties = new MaterializedViewsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("throughputBucketForBuild".equals(fieldName)) { + deserializedMaterializedViewsProperties.throughputBucketForBuild + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMaterializedViewsProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MergeParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MergeParameters.java new file mode 100644 index 000000000000..598ee637bd57 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MergeParameters.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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 properties of an Azure Cosmos DB merge operations. + */ +@Fluent +public final class MergeParameters implements JsonSerializable { + /* + * Specifies whether the operation is a real merge operation or a simulation. + */ + private Boolean isDryRun; + + /** + * Creates an instance of MergeParameters class. + */ + public MergeParameters() { + } + + /** + * Get the isDryRun property: Specifies whether the operation is a real merge operation or a simulation. + * + * @return the isDryRun value. + */ + public Boolean isDryRun() { + return this.isDryRun; + } + + /** + * Set the isDryRun property: Specifies whether the operation is a real merge operation or a simulation. + * + * @param isDryRun the isDryRun value to set. + * @return the MergeParameters object itself. + */ + public MergeParameters withIsDryRun(Boolean isDryRun) { + this.isDryRun = isDryRun; + 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("isDryRun", this.isDryRun); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MergeParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MergeParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MergeParameters. + */ + public static MergeParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MergeParameters deserializedMergeParameters = new MergeParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isDryRun".equals(fieldName)) { + deserializedMergeParameters.isDryRun = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMergeParameters; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobProperties.java new file mode 100644 index 000000000000..69256a98483c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobProperties.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Source Mongo to Destination Mongo copy job properties. + */ +@Fluent +public final class MongoRUToMongoRUCopyJobProperties extends BaseCopyJobProperties { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.MONGO_RUTO_MONGO_RU; + + /* + * Source Mongo DataStore details + */ + private CosmosDBSourceSinkDetails sourceDetails; + + /* + * Destination Mongo DataStore details + */ + private CosmosDBSourceSinkDetails destinationDetails; + + /* + * Copy Job tasks. + */ + private List tasks; + + /** + * Creates an instance of MongoRUToMongoRUCopyJobProperties class. + */ + public MongoRUToMongoRUCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + @Override + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Get the sourceDetails property: Source Mongo DataStore details. + * + * @return the sourceDetails value. + */ + public CosmosDBSourceSinkDetails sourceDetails() { + return this.sourceDetails; + } + + /** + * Set the sourceDetails property: Source Mongo DataStore details. + * + * @param sourceDetails the sourceDetails value to set. + * @return the MongoRUToMongoRUCopyJobProperties object itself. + */ + public MongoRUToMongoRUCopyJobProperties withSourceDetails(CosmosDBSourceSinkDetails sourceDetails) { + this.sourceDetails = sourceDetails; + return this; + } + + /** + * Get the destinationDetails property: Destination Mongo DataStore details. + * + * @return the destinationDetails value. + */ + public CosmosDBSourceSinkDetails destinationDetails() { + return this.destinationDetails; + } + + /** + * Set the destinationDetails property: Destination Mongo DataStore details. + * + * @param destinationDetails the destinationDetails value to set. + * @return the MongoRUToMongoRUCopyJobProperties object itself. + */ + public MongoRUToMongoRUCopyJobProperties withDestinationDetails(CosmosDBSourceSinkDetails destinationDetails) { + this.destinationDetails = destinationDetails; + return this; + } + + /** + * Get the tasks property: Copy Job tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Copy Job tasks. + * + * @param tasks the tasks value to set. + * @return the MongoRUToMongoRUCopyJobProperties object itself. + */ + public MongoRUToMongoRUCopyJobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceDetails() != null) { + sourceDetails().validate(); + } + if (destinationDetails() != null) { + destinationDetails().validate(); + } + if (tasks() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tasks in model MongoRUToMongoRUCopyJobProperties")); + } else { + tasks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoRUToMongoRUCopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("sourceDetails", this.sourceDetails); + jsonWriter.writeJsonField("destinationDetails", this.destinationDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoRUToMongoRUCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoRUToMongoRUCopyJobProperties 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 MongoRUToMongoRUCopyJobProperties. + */ + public static MongoRUToMongoRUCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoRUToMongoRUCopyJobProperties deserializedMongoRUToMongoRUCopyJobProperties + = new MongoRUToMongoRUCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> MongoRUToMongoRUCopyJobTask.fromJson(reader1)); + deserializedMongoRUToMongoRUCopyJobProperties.tasks = tasks; + } else if ("jobType".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobProperties.jobType = CopyJobType.fromString(reader.getString()); + } else if ("sourceDetails".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobProperties.sourceDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else if ("destinationDetails".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobProperties.destinationDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoRUToMongoRUCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobTask.java new file mode 100644 index 000000000000..dc49d39cfde4 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobTask.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MongoRUToMongoRUCopyJobTask model. + */ +@Fluent +public final class MongoRUToMongoRUCopyJobTask extends BaseCopyJobTask { + /* + * Source Mongo (RU) collection + */ + private CosmosDBMongoCollection source; + + /* + * Destination Mongo (RU) collection + */ + private CosmosDBMongoCollection destination; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /* + * Task level Total Count. + */ + private Long totalCount; + + /** + * Creates an instance of MongoRUToMongoRUCopyJobTask class. + */ + public MongoRUToMongoRUCopyJobTask() { + } + + /** + * Get the source property: Source Mongo (RU) collection. + * + * @return the source value. + */ + public CosmosDBMongoCollection source() { + return this.source; + } + + /** + * Set the source property: Source Mongo (RU) collection. + * + * @param source the source value to set. + * @return the MongoRUToMongoRUCopyJobTask object itself. + */ + public MongoRUToMongoRUCopyJobTask withSource(CosmosDBMongoCollection source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination Mongo (RU) collection. + * + * @return the destination value. + */ + public CosmosDBMongoCollection destination() { + return this.destination; + } + + /** + * Set the destination property: Destination Mongo (RU) collection. + * + * @param destination the destination value to set. + * @return the MongoRUToMongoRUCopyJobTask object itself. + */ + public MongoRUToMongoRUCopyJobTask withDestination(CosmosDBMongoCollection destination) { + this.destination = destination; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + @Override + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + @Override + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model MongoRUToMongoRUCopyJobTask")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model MongoRUToMongoRUCopyJobTask")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoRUToMongoRUCopyJobTask.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoRUToMongoRUCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoRUToMongoRUCopyJobTask 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 MongoRUToMongoRUCopyJobTask. + */ + public static MongoRUToMongoRUCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoRUToMongoRUCopyJobTask deserializedMongoRUToMongoRUCopyJobTask = new MongoRUToMongoRUCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobTask.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobTask.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("source".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobTask.source = CosmosDBMongoCollection.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobTask.destination = CosmosDBMongoCollection.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoRUToMongoRUCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobProperties.java new file mode 100644 index 000000000000..bdfd34369921 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobProperties.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Source Mongo to Destination Mongo vCore copy job properties. + */ +@Fluent +public final class MongoRUToMongoVCoreCopyJobProperties extends BaseCopyJobProperties { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.MONGO_RUTO_MONGO_VCORE; + + /* + * Source Mongo (RU) DataStore details + */ + private CosmosDBSourceSinkDetails sourceDetails; + + /* + * Destination Mongo (vCore) DataStore details + */ + private MongoVCoreSourceSinkDetails destinationDetails; + + /* + * Copy Job tasks. + */ + private List tasks; + + /** + * Creates an instance of MongoRUToMongoVCoreCopyJobProperties class. + */ + public MongoRUToMongoVCoreCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + @Override + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Get the sourceDetails property: Source Mongo (RU) DataStore details. + * + * @return the sourceDetails value. + */ + public CosmosDBSourceSinkDetails sourceDetails() { + return this.sourceDetails; + } + + /** + * Set the sourceDetails property: Source Mongo (RU) DataStore details. + * + * @param sourceDetails the sourceDetails value to set. + * @return the MongoRUToMongoVCoreCopyJobProperties object itself. + */ + public MongoRUToMongoVCoreCopyJobProperties withSourceDetails(CosmosDBSourceSinkDetails sourceDetails) { + this.sourceDetails = sourceDetails; + return this; + } + + /** + * Get the destinationDetails property: Destination Mongo (vCore) DataStore details. + * + * @return the destinationDetails value. + */ + public MongoVCoreSourceSinkDetails destinationDetails() { + return this.destinationDetails; + } + + /** + * Set the destinationDetails property: Destination Mongo (vCore) DataStore details. + * + * @param destinationDetails the destinationDetails value to set. + * @return the MongoRUToMongoVCoreCopyJobProperties object itself. + */ + public MongoRUToMongoVCoreCopyJobProperties withDestinationDetails(MongoVCoreSourceSinkDetails destinationDetails) { + this.destinationDetails = destinationDetails; + return this; + } + + /** + * Get the tasks property: Copy Job tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Copy Job tasks. + * + * @param tasks the tasks value to set. + * @return the MongoRUToMongoVCoreCopyJobProperties object itself. + */ + public MongoRUToMongoVCoreCopyJobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceDetails() != null) { + sourceDetails().validate(); + } + if (destinationDetails() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destinationDetails in model MongoRUToMongoVCoreCopyJobProperties")); + } else { + destinationDetails().validate(); + } + if (tasks() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tasks in model MongoRUToMongoVCoreCopyJobProperties")); + } else { + tasks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoRUToMongoVCoreCopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("destinationDetails", this.destinationDetails); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("sourceDetails", this.sourceDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoRUToMongoVCoreCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoRUToMongoVCoreCopyJobProperties 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 MongoRUToMongoVCoreCopyJobProperties. + */ + public static MongoRUToMongoVCoreCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoRUToMongoVCoreCopyJobProperties deserializedMongoRUToMongoVCoreCopyJobProperties + = new MongoRUToMongoVCoreCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationDetails".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobProperties.destinationDetails + = MongoVCoreSourceSinkDetails.fromJson(reader); + } else if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> MongoRUToMongoVCoreCopyJobTask.fromJson(reader1)); + deserializedMongoRUToMongoVCoreCopyJobProperties.tasks = tasks; + } else if ("jobType".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobProperties.jobType + = CopyJobType.fromString(reader.getString()); + } else if ("sourceDetails".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobProperties.sourceDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoRUToMongoVCoreCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobTask.java new file mode 100644 index 000000000000..3adb4e02cfad --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobTask.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MongoRUToMongoVCoreCopyJobTask model. + */ +@Fluent +public final class MongoRUToMongoVCoreCopyJobTask extends BaseCopyJobTask { + /* + * Source Mongo (RU) collection + */ + private CosmosDBMongoCollection source; + + /* + * Destination Mongo (vCore) collection + */ + private CosmosDBMongoVCoreCollection destination; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /* + * Task level Total Count. + */ + private Long totalCount; + + /** + * Creates an instance of MongoRUToMongoVCoreCopyJobTask class. + */ + public MongoRUToMongoVCoreCopyJobTask() { + } + + /** + * Get the source property: Source Mongo (RU) collection. + * + * @return the source value. + */ + public CosmosDBMongoCollection source() { + return this.source; + } + + /** + * Set the source property: Source Mongo (RU) collection. + * + * @param source the source value to set. + * @return the MongoRUToMongoVCoreCopyJobTask object itself. + */ + public MongoRUToMongoVCoreCopyJobTask withSource(CosmosDBMongoCollection source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination Mongo (vCore) collection. + * + * @return the destination value. + */ + public CosmosDBMongoVCoreCollection destination() { + return this.destination; + } + + /** + * Set the destination property: Destination Mongo (vCore) collection. + * + * @param destination the destination value to set. + * @return the MongoRUToMongoVCoreCopyJobTask object itself. + */ + public MongoRUToMongoVCoreCopyJobTask withDestination(CosmosDBMongoVCoreCollection destination) { + this.destination = destination; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + @Override + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + @Override + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model MongoRUToMongoVCoreCopyJobTask")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model MongoRUToMongoVCoreCopyJobTask")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoRUToMongoVCoreCopyJobTask.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoRUToMongoVCoreCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoRUToMongoVCoreCopyJobTask 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 MongoRUToMongoVCoreCopyJobTask. + */ + public static MongoRUToMongoVCoreCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoRUToMongoVCoreCopyJobTask deserializedMongoRUToMongoVCoreCopyJobTask + = new MongoRUToMongoVCoreCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobTask.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobTask.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("source".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobTask.source = CosmosDBMongoCollection.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobTask.destination + = CosmosDBMongoVCoreCollection.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoRUToMongoVCoreCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoVCoreSourceSinkDetails.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoVCoreSourceSinkDetails.java new file mode 100644 index 000000000000..5dd75fce6b8e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoVCoreSourceSinkDetails.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB Mongo vCore data source/sink details. + */ +@Fluent +public final class MongoVCoreSourceSinkDetails implements JsonSerializable { + /* + * The hostName property. + */ + private String hostname; + + /* + * URI of Azure KeyVault secret containing connection string. + */ + private String connectionStringKeyVaultUri; + + /** + * Creates an instance of MongoVCoreSourceSinkDetails class. + */ + public MongoVCoreSourceSinkDetails() { + } + + /** + * Get the hostname property: The hostName property. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The hostName property. + * + * @param hostname the hostname value to set. + * @return the MongoVCoreSourceSinkDetails object itself. + */ + public MongoVCoreSourceSinkDetails withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the connectionStringKeyVaultUri property: URI of Azure KeyVault secret containing connection string. + * + * @return the connectionStringKeyVaultUri value. + */ + public String connectionStringKeyVaultUri() { + return this.connectionStringKeyVaultUri; + } + + /** + * Set the connectionStringKeyVaultUri property: URI of Azure KeyVault secret containing connection string. + * + * @param connectionStringKeyVaultUri the connectionStringKeyVaultUri value to set. + * @return the MongoVCoreSourceSinkDetails object itself. + */ + public MongoVCoreSourceSinkDetails withConnectionStringKeyVaultUri(String connectionStringKeyVaultUri) { + this.connectionStringKeyVaultUri = connectionStringKeyVaultUri; + 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("hostName", this.hostname); + jsonWriter.writeStringField("connectionStringKeyVaultUri", this.connectionStringKeyVaultUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoVCoreSourceSinkDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoVCoreSourceSinkDetails if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoVCoreSourceSinkDetails. + */ + public static MongoVCoreSourceSinkDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoVCoreSourceSinkDetails deserializedMongoVCoreSourceSinkDetails = new MongoVCoreSourceSinkDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedMongoVCoreSourceSinkDetails.hostname = reader.getString(); + } else if ("connectionStringKeyVaultUri".equals(fieldName)) { + deserializedMongoVCoreSourceSinkDetails.connectionStringKeyVaultUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoVCoreSourceSinkDetails; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeter.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeter.java new file mode 100644 index 000000000000..0ad05fe980a0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeter.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information about a network security perimeter (NSP). + */ +@Immutable +public final class NetworkSecurityPerimeter implements JsonSerializable { + /* + * Fully qualified Azure resource ID of the NSP resource + */ + private String id; + + /* + * Universal unique ID (UUID) of the network security perimeter + */ + private String perimeterGuid; + + /* + * Location of the network security perimeter + */ + private String location; + + /** + * Creates an instance of NetworkSecurityPerimeter class. + */ + private NetworkSecurityPerimeter() { + } + + /** + * Get the id property: Fully qualified Azure resource ID of the NSP resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the perimeterGuid property: Universal unique ID (UUID) of the network security perimeter. + * + * @return the perimeterGuid value. + */ + public String perimeterGuid() { + return this.perimeterGuid; + } + + /** + * Get the location property: Location of the network security perimeter. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * 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("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/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProperties.java new file mode 100644 index 000000000000..d28d8e0fe0ba --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProperties.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Network security configuration properties. + */ +@Immutable +public final class NetworkSecurityPerimeterConfigurationProperties + implements JsonSerializable { + /* + * Provisioning state of the network security perimeter configuration + */ + private NetworkSecurityPerimeterConfigurationProvisioningState provisioningState; + + /* + * List of provisioning issues, if any + */ + private List provisioningIssues; + + /* + * Information about the network security perimeter (NSP) + */ + private NetworkSecurityPerimeter networkSecurityPerimeter; + + /* + * Information about the resource association + */ + private ResourceAssociation resourceAssociation; + + /* + * Network security perimeter configuration profile + */ + private NetworkSecurityProfile profile; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationProperties class. + */ + private NetworkSecurityPerimeterConfigurationProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the network security perimeter configuration. + * + * @return the provisioningState value. + */ + public NetworkSecurityPerimeterConfigurationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the provisioningIssues property: List of provisioning issues, if any. + * + * @return the provisioningIssues value. + */ + public List provisioningIssues() { + return this.provisioningIssues; + } + + /** + * Get the networkSecurityPerimeter property: Information about the network security perimeter (NSP). + * + * @return the networkSecurityPerimeter value. + */ + public NetworkSecurityPerimeter networkSecurityPerimeter() { + return this.networkSecurityPerimeter; + } + + /** + * Get the resourceAssociation property: Information about the resource association. + * + * @return the resourceAssociation value. + */ + public ResourceAssociation resourceAssociation() { + return this.resourceAssociation; + } + + /** + * Get the profile property: Network security perimeter configuration profile. + * + * @return the profile value. + */ + public NetworkSecurityProfile profile() { + return this.profile; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provisioningIssues() != null) { + provisioningIssues().forEach(e -> e.validate()); + } + if (networkSecurityPerimeter() != null) { + networkSecurityPerimeter().validate(); + } + if (resourceAssociation() != null) { + resourceAssociation().validate(); + } + if (profile() != null) { + profile().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("networkSecurityPerimeter", this.networkSecurityPerimeter); + jsonWriter.writeJsonField("resourceAssociation", this.resourceAssociation); + jsonWriter.writeJsonField("profile", this.profile); + 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 + = ResourceAssociation.fromJson(reader); + } else if ("profile".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.profile + = NetworkSecurityProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProvisioningState.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProvisioningState.java new file mode 100644 index 000000000000..5b2c3e8a4eca --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProvisioningState.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of a network security perimeter configuration that is being created or updated. + */ +public final class NetworkSecurityPerimeterConfigurationProvisioningState + extends ExpandableStringEnum { + /** + * The configuration was provisioned successfully. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * The configuration is being created. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState CREATING = fromString("Creating"); + + /** + * The configuration is being updated. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState UPDATING = fromString("Updating"); + + /** + * The configuration is being deleted. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState DELETING = fromString("Deleting"); + + /** + * The configuration request was accepted and provisioning has not started yet. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * The configuration failed to provision. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState FAILED = fromString("Failed"); + + /** + * The configuration provisioning was canceled. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of NetworkSecurityPerimeterConfigurationProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkSecurityPerimeterConfigurationProvisioningState() { + } + + /** + * Creates or finds a NetworkSecurityPerimeterConfigurationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static NetworkSecurityPerimeterConfigurationProvisioningState fromString(String name) { + return fromString(name, NetworkSecurityPerimeterConfigurationProvisioningState.class); + } + + /** + * Gets known NetworkSecurityPerimeterConfigurationProvisioningState values. + * + * @return known NetworkSecurityPerimeterConfigurationProvisioningState values. + */ + public static Collection values() { + return values(NetworkSecurityPerimeterConfigurationProvisioningState.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityProfile.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityProfile.java new file mode 100644 index 000000000000..16f932adcfd7 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityProfile.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Network security perimeter configuration profile. + */ +@Immutable +public final class NetworkSecurityProfile implements JsonSerializable { + /* + * Name of the profile + */ + private String name; + + /* + * Current access rules version + */ + private Integer accessRulesVersion; + + /* + * List of Access Rules + */ + private List accessRules; + + /* + * Current diagnostic settings version + */ + private Integer diagnosticSettingsVersion; + + /* + * List of log categories that are enabled + */ + private List enabledLogCategories; + + /** + * Creates an instance of NetworkSecurityProfile class. + */ + private NetworkSecurityProfile() { + } + + /** + * Get the name property: Name of the profile. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the accessRulesVersion property: Current access rules version. + * + * @return the accessRulesVersion value. + */ + public Integer accessRulesVersion() { + return this.accessRulesVersion; + } + + /** + * Get the accessRules property: List of Access Rules. + * + * @return the accessRules value. + */ + public List accessRules() { + return this.accessRules; + } + + /** + * Get the diagnosticSettingsVersion property: Current diagnostic settings version. + * + * @return the diagnosticSettingsVersion value. + */ + public Integer diagnosticSettingsVersion() { + return this.diagnosticSettingsVersion; + } + + /** + * Get the enabledLogCategories property: List of log categories that are enabled. + * + * @return the enabledLogCategories value. + */ + public List enabledLogCategories() { + return this.enabledLogCategories; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessRules() != null) { + 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 NetworkSecurityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkSecurityProfile. + */ + public static NetworkSecurityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityProfile deserializedNetworkSecurityProfile = new NetworkSecurityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkSecurityProfile.name = reader.getString(); + } else if ("accessRulesVersion".equals(fieldName)) { + deserializedNetworkSecurityProfile.accessRulesVersion = reader.getNullable(JsonReader::getInt); + } else if ("accessRules".equals(fieldName)) { + List accessRules = reader.readArray(reader1 -> AccessRule.fromJson(reader1)); + deserializedNetworkSecurityProfile.accessRules = accessRules; + } else if ("diagnosticSettingsVersion".equals(fieldName)) { + deserializedNetworkSecurityProfile.diagnosticSettingsVersion + = reader.getNullable(JsonReader::getInt); + } else if ("enabledLogCategories".equals(fieldName)) { + List enabledLogCategories = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkSecurityProfile.enabledLogCategories = enabledLogCategories; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityProfile; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobProperties.java new file mode 100644 index 000000000000..46dad67b3b21 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobProperties.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Source SQL to Destination SQL copy job properties. + */ +@Fluent +public final class NoSqlRUToNoSqlRUCopyJobProperties extends BaseCopyJobProperties { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.NO_SQL_RUTO_NO_SQL_RU; + + /* + * Source SQL DataStore details + */ + private CosmosDBSourceSinkDetails sourceDetails; + + /* + * Destination SQL DataStore details + */ + private CosmosDBSourceSinkDetails destinationDetails; + + /* + * Copy Job tasks. + */ + private List tasks; + + /** + * Creates an instance of NoSqlRUToNoSqlRUCopyJobProperties class. + */ + public NoSqlRUToNoSqlRUCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + @Override + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Get the sourceDetails property: Source SQL DataStore details. + * + * @return the sourceDetails value. + */ + public CosmosDBSourceSinkDetails sourceDetails() { + return this.sourceDetails; + } + + /** + * Set the sourceDetails property: Source SQL DataStore details. + * + * @param sourceDetails the sourceDetails value to set. + * @return the NoSqlRUToNoSqlRUCopyJobProperties object itself. + */ + public NoSqlRUToNoSqlRUCopyJobProperties withSourceDetails(CosmosDBSourceSinkDetails sourceDetails) { + this.sourceDetails = sourceDetails; + return this; + } + + /** + * Get the destinationDetails property: Destination SQL DataStore details. + * + * @return the destinationDetails value. + */ + public CosmosDBSourceSinkDetails destinationDetails() { + return this.destinationDetails; + } + + /** + * Set the destinationDetails property: Destination SQL DataStore details. + * + * @param destinationDetails the destinationDetails value to set. + * @return the NoSqlRUToNoSqlRUCopyJobProperties object itself. + */ + public NoSqlRUToNoSqlRUCopyJobProperties withDestinationDetails(CosmosDBSourceSinkDetails destinationDetails) { + this.destinationDetails = destinationDetails; + return this; + } + + /** + * Get the tasks property: Copy Job tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Copy Job tasks. + * + * @param tasks the tasks value to set. + * @return the NoSqlRUToNoSqlRUCopyJobProperties object itself. + */ + public NoSqlRUToNoSqlRUCopyJobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceDetails() != null) { + sourceDetails().validate(); + } + if (destinationDetails() != null) { + destinationDetails().validate(); + } + if (tasks() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tasks in model NoSqlRUToNoSqlRUCopyJobProperties")); + } else { + tasks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NoSqlRUToNoSqlRUCopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("sourceDetails", this.sourceDetails); + jsonWriter.writeJsonField("destinationDetails", this.destinationDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NoSqlRUToNoSqlRUCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NoSqlRUToNoSqlRUCopyJobProperties 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 NoSqlRUToNoSqlRUCopyJobProperties. + */ + public static NoSqlRUToNoSqlRUCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NoSqlRUToNoSqlRUCopyJobProperties deserializedNoSqlRUToNoSqlRUCopyJobProperties + = new NoSqlRUToNoSqlRUCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> NoSqlRUToNoSqlRUCopyJobTask.fromJson(reader1)); + deserializedNoSqlRUToNoSqlRUCopyJobProperties.tasks = tasks; + } else if ("jobType".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobProperties.jobType = CopyJobType.fromString(reader.getString()); + } else if ("sourceDetails".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobProperties.sourceDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else if ("destinationDetails".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobProperties.destinationDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNoSqlRUToNoSqlRUCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobTask.java new file mode 100644 index 000000000000..bcfd2179e926 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobTask.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The NoSqlRUToNoSqlRUCopyJobTask model. + */ +@Fluent +public final class NoSqlRUToNoSqlRUCopyJobTask extends BaseCopyJobTask { + /* + * Source SQL container + */ + private CosmosDBNoSqlContainer source; + + /* + * Destination SQL container + */ + private CosmosDBNoSqlContainer destination; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /* + * Task level Total Count. + */ + private Long totalCount; + + /** + * Creates an instance of NoSqlRUToNoSqlRUCopyJobTask class. + */ + public NoSqlRUToNoSqlRUCopyJobTask() { + } + + /** + * Get the source property: Source SQL container. + * + * @return the source value. + */ + public CosmosDBNoSqlContainer source() { + return this.source; + } + + /** + * Set the source property: Source SQL container. + * + * @param source the source value to set. + * @return the NoSqlRUToNoSqlRUCopyJobTask object itself. + */ + public NoSqlRUToNoSqlRUCopyJobTask withSource(CosmosDBNoSqlContainer source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination SQL container. + * + * @return the destination value. + */ + public CosmosDBNoSqlContainer destination() { + return this.destination; + } + + /** + * Set the destination property: Destination SQL container. + * + * @param destination the destination value to set. + * @return the NoSqlRUToNoSqlRUCopyJobTask object itself. + */ + public NoSqlRUToNoSqlRUCopyJobTask withDestination(CosmosDBNoSqlContainer destination) { + this.destination = destination; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + @Override + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + @Override + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model NoSqlRUToNoSqlRUCopyJobTask")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model NoSqlRUToNoSqlRUCopyJobTask")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NoSqlRUToNoSqlRUCopyJobTask.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NoSqlRUToNoSqlRUCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NoSqlRUToNoSqlRUCopyJobTask 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 NoSqlRUToNoSqlRUCopyJobTask. + */ + public static NoSqlRUToNoSqlRUCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NoSqlRUToNoSqlRUCopyJobTask deserializedNoSqlRUToNoSqlRUCopyJobTask = new NoSqlRUToNoSqlRUCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobTask.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobTask.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("source".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobTask.source = CosmosDBNoSqlContainer.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobTask.destination = CosmosDBNoSqlContainer.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNoSqlRUToNoSqlRUCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionId.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionId.java new file mode 100644 index 000000000000..b061ee41e8e2 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionId.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * PhysicalPartitionId object. + */ +@Fluent +public final class PhysicalPartitionId implements JsonSerializable { + /* + * Id of a physical partition + */ + private String id; + + /** + * Creates an instance of PhysicalPartitionId class. + */ + public PhysicalPartitionId() { + } + + /** + * Get the id property: Id of a physical partition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of a physical partition. + * + * @param id the id value to set. + * @return the PhysicalPartitionId object itself. + */ + public PhysicalPartitionId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model PhysicalPartitionId")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PhysicalPartitionId.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionId 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 PhysicalPartitionId. + */ + public static PhysicalPartitionId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionId deserializedPhysicalPartitionId = new PhysicalPartitionId(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPhysicalPartitionId.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionId; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionStorageInfo.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionStorageInfo.java new file mode 100644 index 000000000000..d2ff709b9662 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionStorageInfo.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The storage of a physical partition. + */ +@Immutable +public final class PhysicalPartitionStorageInfo implements JsonSerializable { + /* + * The unique identifier of the partition. + */ + private String id; + + /* + * The storage in KB for the physical partition. + */ + private Double storageInKB; + + /** + * Creates an instance of PhysicalPartitionStorageInfo class. + */ + private PhysicalPartitionStorageInfo() { + } + + /** + * Get the id property: The unique identifier of the partition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the storageInKB property: The storage in KB for the physical partition. + * + * @return the storageInKB value. + */ + public Double storageInKB() { + return this.storageInKB; + } + + /** + * 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 PhysicalPartitionStorageInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionStorageInfo if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PhysicalPartitionStorageInfo. + */ + public static PhysicalPartitionStorageInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionStorageInfo deserializedPhysicalPartitionStorageInfo = new PhysicalPartitionStorageInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPhysicalPartitionStorageInfo.id = reader.getString(); + } else if ("storageInKB".equals(fieldName)) { + deserializedPhysicalPartitionStorageInfo.storageInKB = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionStorageInfo; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoProperties.java new file mode 100644 index 000000000000..a3f73b2283fc --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoProperties.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties object. + */ +@Immutable +public class PhysicalPartitionThroughputInfoProperties + implements JsonSerializable { + /* + * Array of physical partition throughput info objects + */ + private List physicalPartitionThroughputInfo; + + /** + * Creates an instance of PhysicalPartitionThroughputInfoProperties class. + */ + protected PhysicalPartitionThroughputInfoProperties() { + } + + /** + * Get the physicalPartitionThroughputInfo property: Array of physical partition throughput info objects. + * + * @return the physicalPartitionThroughputInfo value. + */ + public List physicalPartitionThroughputInfo() { + return this.physicalPartitionThroughputInfo; + } + + /** + * Set the physicalPartitionThroughputInfo property: Array of physical partition throughput info objects. + * + * @param physicalPartitionThroughputInfo the physicalPartitionThroughputInfo value to set. + * @return the PhysicalPartitionThroughputInfoProperties object itself. + */ + PhysicalPartitionThroughputInfoProperties withPhysicalPartitionThroughputInfo( + List physicalPartitionThroughputInfo) { + this.physicalPartitionThroughputInfo = physicalPartitionThroughputInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (physicalPartitionThroughputInfo() != null) { + physicalPartitionThroughputInfo().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("physicalPartitionThroughputInfo", this.physicalPartitionThroughputInfo, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionThroughputInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionThroughputInfoProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PhysicalPartitionThroughputInfoProperties. + */ + public static PhysicalPartitionThroughputInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionThroughputInfoProperties deserializedPhysicalPartitionThroughputInfoProperties + = new PhysicalPartitionThroughputInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("physicalPartitionThroughputInfo".equals(fieldName)) { + List physicalPartitionThroughputInfo + = reader.readArray(reader1 -> PhysicalPartitionThroughputInfoResource.fromJson(reader1)); + deserializedPhysicalPartitionThroughputInfoProperties.physicalPartitionThroughputInfo + = physicalPartitionThroughputInfo; + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionThroughputInfoProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResource.java new file mode 100644 index 000000000000..a1496051e2e4 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResource.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * PhysicalPartitionThroughputInfo object. + */ +@Fluent +public final class PhysicalPartitionThroughputInfoResource + implements JsonSerializable { + /* + * Id of a physical partition + */ + private String id; + + /* + * Throughput of a physical partition + */ + private Double throughput; + + /* + * Target throughput of a physical partition + */ + private Double targetThroughput; + + /** + * Creates an instance of PhysicalPartitionThroughputInfoResource class. + */ + public PhysicalPartitionThroughputInfoResource() { + } + + /** + * Get the id property: Id of a physical partition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of a physical partition. + * + * @param id the id value to set. + * @return the PhysicalPartitionThroughputInfoResource object itself. + */ + public PhysicalPartitionThroughputInfoResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the throughput property: Throughput of a physical partition. + * + * @return the throughput value. + */ + public Double throughput() { + return this.throughput; + } + + /** + * Set the throughput property: Throughput of a physical partition. + * + * @param throughput the throughput value to set. + * @return the PhysicalPartitionThroughputInfoResource object itself. + */ + public PhysicalPartitionThroughputInfoResource withThroughput(Double throughput) { + this.throughput = throughput; + return this; + } + + /** + * Get the targetThroughput property: Target throughput of a physical partition. + * + * @return the targetThroughput value. + */ + public Double targetThroughput() { + return this.targetThroughput; + } + + /** + * Set the targetThroughput property: Target throughput of a physical partition. + * + * @param targetThroughput the targetThroughput value to set. + * @return the PhysicalPartitionThroughputInfoResource object itself. + */ + public PhysicalPartitionThroughputInfoResource withTargetThroughput(Double targetThroughput) { + this.targetThroughput = targetThroughput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property id in model PhysicalPartitionThroughputInfoResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PhysicalPartitionThroughputInfoResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeNumberField("throughput", this.throughput); + jsonWriter.writeNumberField("targetThroughput", this.targetThroughput); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionThroughputInfoResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionThroughputInfoResource 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 PhysicalPartitionThroughputInfoResource. + */ + public static PhysicalPartitionThroughputInfoResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionThroughputInfoResource deserializedPhysicalPartitionThroughputInfoResource + = new PhysicalPartitionThroughputInfoResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResource.id = reader.getString(); + } else if ("throughput".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResource.throughput + = reader.getNullable(JsonReader::getDouble); + } else if ("targetThroughput".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResource.targetThroughput + = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionThroughputInfoResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResultPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResultPropertiesResource.java new file mode 100644 index 000000000000..aff96117ea74 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResultPropertiesResource.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * properties of physical partition throughput info. + */ +@Immutable +public final class PhysicalPartitionThroughputInfoResultPropertiesResource + extends PhysicalPartitionThroughputInfoProperties { + /* + * Array of physical partition throughput info objects + */ + private List physicalPartitionThroughputInfo; + + /** + * Creates an instance of PhysicalPartitionThroughputInfoResultPropertiesResource class. + */ + private PhysicalPartitionThroughputInfoResultPropertiesResource() { + } + + /** + * Get the physicalPartitionThroughputInfo property: Array of physical partition throughput info objects. + * + * @return the physicalPartitionThroughputInfo value. + */ + @Override + public List physicalPartitionThroughputInfo() { + return this.physicalPartitionThroughputInfo; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (physicalPartitionThroughputInfo() != null) { + physicalPartitionThroughputInfo().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("physicalPartitionThroughputInfo", physicalPartitionThroughputInfo(), + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionThroughputInfoResultPropertiesResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionThroughputInfoResultPropertiesResource if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PhysicalPartitionThroughputInfoResultPropertiesResource. + */ + public static PhysicalPartitionThroughputInfoResultPropertiesResource fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionThroughputInfoResultPropertiesResource deserializedPhysicalPartitionThroughputInfoResultPropertiesResource + = new PhysicalPartitionThroughputInfoResultPropertiesResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("physicalPartitionThroughputInfo".equals(fieldName)) { + List physicalPartitionThroughputInfo + = reader.readArray(reader1 -> PhysicalPartitionThroughputInfoResource.fromJson(reader1)); + deserializedPhysicalPartitionThroughputInfoResultPropertiesResource.physicalPartitionThroughputInfo + = physicalPartitionThroughputInfo; + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionThroughputInfoResultPropertiesResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssue.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssue.java new file mode 100644 index 000000000000..82ca06304f7e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssue.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a provisioning issue for a network security perimeter configuration. + */ +@Immutable +public final class ProvisioningIssue implements JsonSerializable { + /* + * Name of the issue + */ + private String name; + + /* + * Details of the provisioning issue + */ + private ProvisioningIssueProperties properties; + + /** + * Creates an instance of ProvisioningIssue class. + */ + private ProvisioningIssue() { + } + + /** + * Get the name property: Name of the issue. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the properties property: Details of the provisioning issue. + * + * @return the properties value. + */ + public ProvisioningIssueProperties properties() { + return this.properties; + } + + /** + * 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(); + 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/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssueProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssueProperties.java new file mode 100644 index 000000000000..ebf16a08ad7d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssueProperties.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should + * generate separate provisioning issue elements for each separate issue detected, and include a meaningful and + * distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. + */ +@Immutable +public final class ProvisioningIssueProperties implements JsonSerializable { + /* + * Type of issue + */ + private IssueType issueType; + + /* + * Severity of the issue. + */ + private Severity severity; + + /* + * Description of the issue + */ + private String description; + + /* + * Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter + * (NSP) to remediate the issue. + */ + private List suggestedResourceIds; + + /* + * Access rules that can be added to the network security profile (NSP) to remediate the issue. + */ + private List suggestedAccessRules; + + /** + * Creates an instance of ProvisioningIssueProperties class. + */ + private ProvisioningIssueProperties() { + } + + /** + * Get the issueType property: Type of issue. + * + * @return the issueType value. + */ + public IssueType issueType() { + return this.issueType; + } + + /** + * Get the severity property: Severity of the issue. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Get the description property: Description of the issue. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the suggestedResourceIds property: Fully qualified resource IDs of suggested resources that can be associated + * to the network security perimeter (NSP) to remediate the issue. + * + * @return the suggestedResourceIds value. + */ + public List suggestedResourceIds() { + return this.suggestedResourceIds; + } + + /** + * Get the suggestedAccessRules property: Access rules that can be added to the network security profile (NSP) to + * remediate the issue. + * + * @return the suggestedAccessRules value. + */ + public List suggestedAccessRules() { + return this.suggestedAccessRules; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (suggestedAccessRules() != null) { + suggestedAccessRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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 if ("suggestedResourceIds".equals(fieldName)) { + List suggestedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedProvisioningIssueProperties.suggestedResourceIds = suggestedResourceIds; + } else if ("suggestedAccessRules".equals(fieldName)) { + List suggestedAccessRules = reader.readArray(reader1 -> AccessRule.fromJson(reader1)); + deserializedProvisioningIssueProperties.suggestedAccessRules = suggestedAccessRules; + } else { + reader.skipChildren(); + } + } + + return deserializedProvisioningIssueProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputParameters.java new file mode 100644 index 000000000000..65853a23c6e6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputParameters.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.fluent.models.RedistributeThroughputProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Cosmos DB redistribute throughput parameters object. + */ +@Fluent +public final class RedistributeThroughputParameters extends ArmResourceProperties { + /* + * Properties to redistribute throughput parameters object + */ + private RedistributeThroughputProperties innerProperties = new RedistributeThroughputProperties(); + + /* + * The type of Azure resource. + */ + private String type; + + /* + * The name of the ARM resource. + */ + private String name; + + /* + * The unique resource identifier of the ARM resource. + */ + private String id; + + /** + * Creates an instance of RedistributeThroughputParameters class. + */ + public RedistributeThroughputParameters() { + } + + /** + * Get the innerProperties property: Properties to redistribute throughput parameters object. + * + * @return the innerProperties value. + */ + private RedistributeThroughputProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the ARM resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The unique resource identifier of the ARM resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RedistributeThroughputParameters withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RedistributeThroughputParameters withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RedistributeThroughputParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + + /** + * Get the resource property: The standard JSON format of a resource throughput. + * + * @return the resource value. + */ + public RedistributeThroughputPropertiesResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Set the resource property: The standard JSON format of a resource throughput. + * + * @param resource the resource value to set. + * @return the RedistributeThroughputParameters object itself. + */ + public RedistributeThroughputParameters withResource(RedistributeThroughputPropertiesResource resource) { + if (this.innerProperties() == null) { + this.innerProperties = new RedistributeThroughputProperties(); + } + this.innerProperties().withResource(resource); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model RedistributeThroughputParameters")); + } else { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedistributeThroughputParameters.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("identity", identity()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedistributeThroughputParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedistributeThroughputParameters 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 RedistributeThroughputParameters. + */ + public static RedistributeThroughputParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedistributeThroughputParameters deserializedRedistributeThroughputParameters + = new RedistributeThroughputParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRedistributeThroughputParameters.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRedistributeThroughputParameters.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRedistributeThroughputParameters.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRedistributeThroughputParameters.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRedistributeThroughputParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedRedistributeThroughputParameters.withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedRedistributeThroughputParameters.innerProperties + = RedistributeThroughputProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRedistributeThroughputParameters; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputPropertiesResource.java new file mode 100644 index 000000000000..84471e445ae1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputPropertiesResource.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Resource to redistribute throughput for Azure Cosmos DB resource. + */ +@Fluent +public final class RedistributeThroughputPropertiesResource + implements JsonSerializable { + /* + * ThroughputPolicy to apply for throughput redistribution + */ + private ThroughputPolicyType throughputPolicy; + + /* + * Array of PhysicalPartitionThroughputInfoResource objects. + */ + private List targetPhysicalPartitionThroughputInfo; + + /* + * Array of PhysicalPartitionThroughputInfoResource objects. + */ + private List sourcePhysicalPartitionThroughputInfo; + + /** + * Creates an instance of RedistributeThroughputPropertiesResource class. + */ + public RedistributeThroughputPropertiesResource() { + } + + /** + * Get the throughputPolicy property: ThroughputPolicy to apply for throughput redistribution. + * + * @return the throughputPolicy value. + */ + public ThroughputPolicyType throughputPolicy() { + return this.throughputPolicy; + } + + /** + * Set the throughputPolicy property: ThroughputPolicy to apply for throughput redistribution. + * + * @param throughputPolicy the throughputPolicy value to set. + * @return the RedistributeThroughputPropertiesResource object itself. + */ + public RedistributeThroughputPropertiesResource withThroughputPolicy(ThroughputPolicyType throughputPolicy) { + this.throughputPolicy = throughputPolicy; + return this; + } + + /** + * Get the targetPhysicalPartitionThroughputInfo property: Array of PhysicalPartitionThroughputInfoResource objects. + * + * @return the targetPhysicalPartitionThroughputInfo value. + */ + public List targetPhysicalPartitionThroughputInfo() { + return this.targetPhysicalPartitionThroughputInfo; + } + + /** + * Set the targetPhysicalPartitionThroughputInfo property: Array of PhysicalPartitionThroughputInfoResource objects. + * + * @param targetPhysicalPartitionThroughputInfo the targetPhysicalPartitionThroughputInfo value to set. + * @return the RedistributeThroughputPropertiesResource object itself. + */ + public RedistributeThroughputPropertiesResource withTargetPhysicalPartitionThroughputInfo( + List targetPhysicalPartitionThroughputInfo) { + this.targetPhysicalPartitionThroughputInfo = targetPhysicalPartitionThroughputInfo; + return this; + } + + /** + * Get the sourcePhysicalPartitionThroughputInfo property: Array of PhysicalPartitionThroughputInfoResource objects. + * + * @return the sourcePhysicalPartitionThroughputInfo value. + */ + public List sourcePhysicalPartitionThroughputInfo() { + return this.sourcePhysicalPartitionThroughputInfo; + } + + /** + * Set the sourcePhysicalPartitionThroughputInfo property: Array of PhysicalPartitionThroughputInfoResource objects. + * + * @param sourcePhysicalPartitionThroughputInfo the sourcePhysicalPartitionThroughputInfo value to set. + * @return the RedistributeThroughputPropertiesResource object itself. + */ + public RedistributeThroughputPropertiesResource withSourcePhysicalPartitionThroughputInfo( + List sourcePhysicalPartitionThroughputInfo) { + this.sourcePhysicalPartitionThroughputInfo = sourcePhysicalPartitionThroughputInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (throughputPolicy() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property throughputPolicy in model RedistributeThroughputPropertiesResource")); + } + if (targetPhysicalPartitionThroughputInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetPhysicalPartitionThroughputInfo in model RedistributeThroughputPropertiesResource")); + } else { + targetPhysicalPartitionThroughputInfo().forEach(e -> e.validate()); + } + if (sourcePhysicalPartitionThroughputInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourcePhysicalPartitionThroughputInfo in model RedistributeThroughputPropertiesResource")); + } else { + sourcePhysicalPartitionThroughputInfo().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedistributeThroughputPropertiesResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("throughputPolicy", + this.throughputPolicy == null ? null : this.throughputPolicy.toString()); + jsonWriter.writeArrayField("targetPhysicalPartitionThroughputInfo", this.targetPhysicalPartitionThroughputInfo, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sourcePhysicalPartitionThroughputInfo", this.sourcePhysicalPartitionThroughputInfo, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedistributeThroughputPropertiesResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedistributeThroughputPropertiesResource 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 RedistributeThroughputPropertiesResource. + */ + public static RedistributeThroughputPropertiesResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedistributeThroughputPropertiesResource deserializedRedistributeThroughputPropertiesResource + = new RedistributeThroughputPropertiesResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("throughputPolicy".equals(fieldName)) { + deserializedRedistributeThroughputPropertiesResource.throughputPolicy + = ThroughputPolicyType.fromString(reader.getString()); + } else if ("targetPhysicalPartitionThroughputInfo".equals(fieldName)) { + List targetPhysicalPartitionThroughputInfo + = reader.readArray(reader1 -> PhysicalPartitionThroughputInfoResource.fromJson(reader1)); + deserializedRedistributeThroughputPropertiesResource.targetPhysicalPartitionThroughputInfo + = targetPhysicalPartitionThroughputInfo; + } else if ("sourcePhysicalPartitionThroughputInfo".equals(fieldName)) { + List sourcePhysicalPartitionThroughputInfo + = reader.readArray(reader1 -> PhysicalPartitionThroughputInfoResource.fromJson(reader1)); + deserializedRedistributeThroughputPropertiesResource.sourcePhysicalPartitionThroughputInfo + = sourcePhysicalPartitionThroughputInfo; + } else { + reader.skipChildren(); + } + } + + return deserializedRedistributeThroughputPropertiesResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociation.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociation.java new file mode 100644 index 000000000000..b6f244baf5a8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociation.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information about resource association. + */ +@Immutable +public final class ResourceAssociation implements JsonSerializable { + /* + * Name of the resource association + */ + private String name; + + /* + * Access mode of the resource association + */ + private ResourceAssociationAccessMode accessMode; + + /** + * Creates an instance of ResourceAssociation class. + */ + private ResourceAssociation() { + } + + /** + * Get the name property: Name of the resource association. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the accessMode property: Access mode of the resource association. + * + * @return the accessMode value. + */ + public ResourceAssociationAccessMode accessMode() { + return this.accessMode; + } + + /** + * 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("accessMode", this.accessMode == null ? null : this.accessMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceAssociation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceAssociation. + */ + public static ResourceAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceAssociation deserializedResourceAssociation = new ResourceAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedResourceAssociation.name = reader.getString(); + } else if ("accessMode".equals(fieldName)) { + deserializedResourceAssociation.accessMode + = ResourceAssociationAccessMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceAssociation; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociationAccessMode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociationAccessMode.java new file mode 100644 index 000000000000..53206b19d4df --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociationAccessMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Access mode of the resource association. + */ +public final class ResourceAssociationAccessMode extends ExpandableStringEnum { + /** + * Enforced access mode - traffic to the resource that failed access checks is blocked. + */ + public static final ResourceAssociationAccessMode ENFORCED = fromString("Enforced"); + + /** + * Learning access mode - traffic to the resource is enabled for analysis but not blocked. + */ + public static final ResourceAssociationAccessMode LEARNING = fromString("Learning"); + + /** + * Audit access mode - traffic to the resource that fails access checks is logged but not blocked. + */ + public static final ResourceAssociationAccessMode AUDIT = fromString("Audit"); + + /** + * Creates a new instance of ResourceAssociationAccessMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceAssociationAccessMode() { + } + + /** + * Creates or finds a ResourceAssociationAccessMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceAssociationAccessMode. + */ + public static ResourceAssociationAccessMode fromString(String name) { + return fromString(name, ResourceAssociationAccessMode.class); + } + + /** + * Gets known ResourceAssociationAccessMode values. + * + * @return known ResourceAssociationAccessMode values. + */ + public static Collection values() { + return values(ResourceAssociationAccessMode.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResourceContainer.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResourceContainer.java index 537333a3d9d5..fb01a31158d0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResourceContainer.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResourceContainer.java @@ -110,6 +110,15 @@ public void validate() { if (restoreParameters() != null) { restoreParameters().validate(); } + if (materializedViewDefinition() != null) { + materializedViewDefinition().validate(); + } + if (materializedViews() != null) { + materializedViews().forEach(e -> e.validate()); + } + if (materializedViewsProperties() != null) { + materializedViewsProperties().validate(); + } if (computedProperties() != null) { computedProperties().forEach(e -> e.validate()); } @@ -119,6 +128,9 @@ public void validate() { if (fullTextPolicy() != null) { fullTextPolicy().validate(); } + if (dataMaskingPolicy() != null) { + dataMaskingPolicy().validate(); + } } private static final ClientLogger LOGGER @@ -140,10 +152,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("analyticalStorageTtl", analyticalStorageTtl()); jsonWriter.writeJsonField("restoreParameters", restoreParameters()); jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); + jsonWriter.writeJsonField("materializedViewDefinition", materializedViewDefinition()); + jsonWriter.writeArrayField("materializedViews", materializedViews(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("materializedViewsProperties", materializedViewsProperties()); jsonWriter.writeArrayField("computedProperties", computedProperties(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("vectorEmbeddingPolicy", vectorEmbeddingPolicy()); jsonWriter.writeJsonField("fullTextPolicy", fullTextPolicy()); + jsonWriter.writeJsonField("dataMaskingPolicy", dataMaskingPolicy()); return jsonWriter.writeEndObject(); } @@ -193,6 +210,17 @@ public static RestorableSqlContainerPropertiesResourceContainer fromJson(JsonRea } else if ("createMode".equals(fieldName)) { deserializedRestorableSqlContainerPropertiesResourceContainer .withCreateMode(CreateMode.fromString(reader.getString())); + } else if ("materializedViewDefinition".equals(fieldName)) { + deserializedRestorableSqlContainerPropertiesResourceContainer + .withMaterializedViewDefinition(MaterializedViewDefinition.fromJson(reader)); + } else if ("materializedViews".equals(fieldName)) { + List materializedViews + = reader.readArray(reader1 -> MaterializedViewDetails.fromJson(reader1)); + deserializedRestorableSqlContainerPropertiesResourceContainer + .withMaterializedViews(materializedViews); + } else if ("materializedViewsProperties".equals(fieldName)) { + deserializedRestorableSqlContainerPropertiesResourceContainer + .withMaterializedViewsProperties(MaterializedViewsProperties.fromJson(reader)); } else if ("computedProperties".equals(fieldName)) { List computedProperties = reader.readArray(reader1 -> ComputedProperty.fromJson(reader1)); @@ -204,6 +232,9 @@ public static RestorableSqlContainerPropertiesResourceContainer fromJson(JsonRea } else if ("fullTextPolicy".equals(fieldName)) { deserializedRestorableSqlContainerPropertiesResourceContainer .withFullTextPolicy(FullTextPolicy.fromJson(reader)); + } else if ("dataMaskingPolicy".equals(fieldName)) { + deserializedRestorableSqlContainerPropertiesResourceContainer + .withDataMaskingPolicy(DataMaskingPolicy.fromJson(reader)); } else if ("_rid".equals(fieldName)) { deserializedRestorableSqlContainerPropertiesResourceContainer.rid = reader.getString(); } else if ("_ts".equals(fieldName)) { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputParameters.java new file mode 100644 index 000000000000..f22891ff4518 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputParameters.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.fluent.models.RetrieveThroughputProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Cosmos DB retrieve throughput parameters object. + */ +@Fluent +public final class RetrieveThroughputParameters extends ArmResourceProperties { + /* + * Properties to retrieve throughput parameters object + */ + private RetrieveThroughputProperties innerProperties = new RetrieveThroughputProperties(); + + /* + * The type of Azure resource. + */ + private String type; + + /* + * The name of the ARM resource. + */ + private String name; + + /* + * The unique resource identifier of the ARM resource. + */ + private String id; + + /** + * Creates an instance of RetrieveThroughputParameters class. + */ + public RetrieveThroughputParameters() { + } + + /** + * Get the innerProperties property: Properties to retrieve throughput parameters object. + * + * @return the innerProperties value. + */ + private RetrieveThroughputProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the ARM resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The unique resource identifier of the ARM resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RetrieveThroughputParameters withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RetrieveThroughputParameters withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RetrieveThroughputParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + + /** + * Get the resource property: The standard JSON format of a resource throughput. + * + * @return the resource value. + */ + public RetrieveThroughputPropertiesResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Set the resource property: The standard JSON format of a resource throughput. + * + * @param resource the resource value to set. + * @return the RetrieveThroughputParameters object itself. + */ + public RetrieveThroughputParameters withResource(RetrieveThroughputPropertiesResource resource) { + if (this.innerProperties() == null) { + this.innerProperties = new RetrieveThroughputProperties(); + } + this.innerProperties().withResource(resource); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model RetrieveThroughputParameters")); + } else { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RetrieveThroughputParameters.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("identity", identity()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RetrieveThroughputParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RetrieveThroughputParameters 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 RetrieveThroughputParameters. + */ + public static RetrieveThroughputParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RetrieveThroughputParameters deserializedRetrieveThroughputParameters = new RetrieveThroughputParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRetrieveThroughputParameters.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRetrieveThroughputParameters.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRetrieveThroughputParameters.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRetrieveThroughputParameters.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRetrieveThroughputParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedRetrieveThroughputParameters.withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedRetrieveThroughputParameters.innerProperties + = RetrieveThroughputProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRetrieveThroughputParameters; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputPropertiesResource.java new file mode 100644 index 000000000000..33cb10ab6a44 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputPropertiesResource.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Resource to retrieve throughput information for Cosmos DB resource. + */ +@Fluent +public final class RetrieveThroughputPropertiesResource + implements JsonSerializable { + /* + * Array of PhysicalPartitionId objects. + */ + private List physicalPartitionIds; + + /** + * Creates an instance of RetrieveThroughputPropertiesResource class. + */ + public RetrieveThroughputPropertiesResource() { + } + + /** + * Get the physicalPartitionIds property: Array of PhysicalPartitionId objects. + * + * @return the physicalPartitionIds value. + */ + public List physicalPartitionIds() { + return this.physicalPartitionIds; + } + + /** + * Set the physicalPartitionIds property: Array of PhysicalPartitionId objects. + * + * @param physicalPartitionIds the physicalPartitionIds value to set. + * @return the RetrieveThroughputPropertiesResource object itself. + */ + public RetrieveThroughputPropertiesResource + withPhysicalPartitionIds(List physicalPartitionIds) { + this.physicalPartitionIds = physicalPartitionIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (physicalPartitionIds() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property physicalPartitionIds in model RetrieveThroughputPropertiesResource")); + } else { + physicalPartitionIds().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RetrieveThroughputPropertiesResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("physicalPartitionIds", this.physicalPartitionIds, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RetrieveThroughputPropertiesResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RetrieveThroughputPropertiesResource 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 RetrieveThroughputPropertiesResource. + */ + public static RetrieveThroughputPropertiesResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RetrieveThroughputPropertiesResource deserializedRetrieveThroughputPropertiesResource + = new RetrieveThroughputPropertiesResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("physicalPartitionIds".equals(fieldName)) { + List physicalPartitionIds + = reader.readArray(reader1 -> PhysicalPartitionId.fromJson(reader1)); + deserializedRetrieveThroughputPropertiesResource.physicalPartitionIds = physicalPartitionIds; + } else { + reader.skipChildren(); + } + } + + return deserializedRetrieveThroughputPropertiesResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Severity.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Severity.java new file mode 100644 index 000000000000..d54dc14d1481 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Severity.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Severity of the issue. + */ +public final class Severity extends ExpandableStringEnum { + /** + * The issue is a warning and does not prevent the configuration from being applied. + */ + public static final Severity WARNING = fromString("Warning"); + + /** + * The issue is an error and prevents the configuration from being applied. + */ + public static final Severity ERROR = fromString("Error"); + + /** + * Creates a new instance of Severity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Severity() { + } + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * Gets known Severity values. + * + * @return known Severity values. + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeleteActionKind.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeleteActionKind.java new file mode 100644 index 000000000000..f7be353fbb53 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeleteActionKind.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of soft delete action to perform. + */ +public final class SoftDeleteActionKind extends ExpandableStringEnum { + /** + * Restores the soft-deleted resource to active/online state. + */ + public static final SoftDeleteActionKind RESTORE_SOFT_DELETED_RESOURCE = fromString("RestoreSoftDeletedResource"); + + /** + * Permanently deletes the soft-deleted resource. + */ + public static final SoftDeleteActionKind PERMANENT_DELETE_RESOURCE = fromString("PermanentDeleteResource"); + + /** + * Creates a new instance of SoftDeleteActionKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SoftDeleteActionKind() { + } + + /** + * Creates or finds a SoftDeleteActionKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding SoftDeleteActionKind. + */ + public static SoftDeleteActionKind fromString(String name) { + return fromString(name, SoftDeleteActionKind.class); + } + + /** + * Gets known SoftDeleteActionKind values. + * + * @return known SoftDeleteActionKind values. + */ + public static Collection values() { + return values(SoftDeleteActionKind.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeleteConfiguration.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeleteConfiguration.java new file mode 100644 index 000000000000..99b24cc211ef --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeleteConfiguration.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * Configuration for soft delete on the Cosmos DB account. + */ +@Fluent +public final class SoftDeleteConfiguration implements JsonSerializable { + /* + * Flag to indicate whether soft delete is enabled on the account. + */ + private Boolean softDeletionEnabled; + + /* + * Minimum number of minutes before a soft deleted resource can be permanently deleted. + */ + private Integer minMinutesBeforePermanentDeletionAllowed; + + /* + * Soft delete retention period in minutes for resources. + */ + private Integer softDeleteRetentionPeriodInMinutes; + + /** + * Creates an instance of SoftDeleteConfiguration class. + */ + public SoftDeleteConfiguration() { + } + + /** + * Get the softDeletionEnabled property: Flag to indicate whether soft delete is enabled on the account. + * + * @return the softDeletionEnabled value. + */ + public Boolean softDeletionEnabled() { + return this.softDeletionEnabled; + } + + /** + * Set the softDeletionEnabled property: Flag to indicate whether soft delete is enabled on the account. + * + * @param softDeletionEnabled the softDeletionEnabled value to set. + * @return the SoftDeleteConfiguration object itself. + */ + public SoftDeleteConfiguration withSoftDeletionEnabled(Boolean softDeletionEnabled) { + this.softDeletionEnabled = softDeletionEnabled; + return this; + } + + /** + * Get the minMinutesBeforePermanentDeletionAllowed property: Minimum number of minutes before a soft deleted + * resource can be permanently deleted. + * + * @return the minMinutesBeforePermanentDeletionAllowed value. + */ + public Integer minMinutesBeforePermanentDeletionAllowed() { + return this.minMinutesBeforePermanentDeletionAllowed; + } + + /** + * Set the minMinutesBeforePermanentDeletionAllowed property: Minimum number of minutes before a soft deleted + * resource can be permanently deleted. + * + * @param minMinutesBeforePermanentDeletionAllowed the minMinutesBeforePermanentDeletionAllowed value to set. + * @return the SoftDeleteConfiguration object itself. + */ + public SoftDeleteConfiguration + withMinMinutesBeforePermanentDeletionAllowed(Integer minMinutesBeforePermanentDeletionAllowed) { + this.minMinutesBeforePermanentDeletionAllowed = minMinutesBeforePermanentDeletionAllowed; + return this; + } + + /** + * Get the softDeleteRetentionPeriodInMinutes property: Soft delete retention period in minutes for resources. + * + * @return the softDeleteRetentionPeriodInMinutes value. + */ + public Integer softDeleteRetentionPeriodInMinutes() { + return this.softDeleteRetentionPeriodInMinutes; + } + + /** + * Set the softDeleteRetentionPeriodInMinutes property: Soft delete retention period in minutes for resources. + * + * @param softDeleteRetentionPeriodInMinutes the softDeleteRetentionPeriodInMinutes value to set. + * @return the SoftDeleteConfiguration object itself. + */ + public SoftDeleteConfiguration withSoftDeleteRetentionPeriodInMinutes(Integer softDeleteRetentionPeriodInMinutes) { + this.softDeleteRetentionPeriodInMinutes = softDeleteRetentionPeriodInMinutes; + 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("softDeletionEnabled", this.softDeletionEnabled); + jsonWriter.writeNumberField("minMinutesBeforePermanentDeletionAllowed", + this.minMinutesBeforePermanentDeletionAllowed); + jsonWriter.writeNumberField("softDeleteRetentionPeriodInMinutes", this.softDeleteRetentionPeriodInMinutes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftDeleteConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeleteConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SoftDeleteConfiguration. + */ + public static SoftDeleteConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeleteConfiguration deserializedSoftDeleteConfiguration = new SoftDeleteConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("softDeletionEnabled".equals(fieldName)) { + deserializedSoftDeleteConfiguration.softDeletionEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("minMinutesBeforePermanentDeletionAllowed".equals(fieldName)) { + deserializedSoftDeleteConfiguration.minMinutesBeforePermanentDeletionAllowed + = reader.getNullable(JsonReader::getInt); + } else if ("softDeleteRetentionPeriodInMinutes".equals(fieldName)) { + deserializedSoftDeleteConfiguration.softDeleteRetentionPeriodInMinutes + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeleteConfiguration; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedDatabaseAccountProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedDatabaseAccountProperties.java new file mode 100644 index 000000000000..58c093982d4c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedDatabaseAccountProperties.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of a soft-deleted database account. + */ +@Immutable +public final class SoftDeletedDatabaseAccountProperties + implements JsonSerializable { + /* + * The name of the database account. + */ + private String accountName; + + /* + * Metadata related to the soft deletion of the database account. + */ + private SoftDeletionMetadata softDeletionMetadata; + + /* + * The soft delete configuration for the database account. + */ + private SoftDeleteConfiguration softDeleteConfiguration; + + /* + * A subset of properties of the underlying database account resource. + */ + private SoftDeletedDatabaseAccountResource resource; + + /** + * Creates an instance of SoftDeletedDatabaseAccountProperties class. + */ + private SoftDeletedDatabaseAccountProperties() { + } + + /** + * Get the accountName property: The name of the database account. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Get the softDeletionMetadata property: Metadata related to the soft deletion of the database account. + * + * @return the softDeletionMetadata value. + */ + public SoftDeletionMetadata softDeletionMetadata() { + return this.softDeletionMetadata; + } + + /** + * Get the softDeleteConfiguration property: The soft delete configuration for the database account. + * + * @return the softDeleteConfiguration value. + */ + public SoftDeleteConfiguration softDeleteConfiguration() { + return this.softDeleteConfiguration; + } + + /** + * Get the resource property: A subset of properties of the underlying database account resource. + * + * @return the resource value. + */ + public SoftDeletedDatabaseAccountResource resource() { + return this.resource; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (softDeletionMetadata() != null) { + softDeletionMetadata().validate(); + } + if (softDeleteConfiguration() != null) { + softDeleteConfiguration().validate(); + } + if (resource() != null) { + resource().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountName", this.accountName); + jsonWriter.writeJsonField("softDeletionMetadata", this.softDeletionMetadata); + jsonWriter.writeJsonField("softDeleteConfiguration", this.softDeleteConfiguration); + jsonWriter.writeJsonField("resource", this.resource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftDeletedDatabaseAccountProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletedDatabaseAccountProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SoftDeletedDatabaseAccountProperties. + */ + public static SoftDeletedDatabaseAccountProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletedDatabaseAccountProperties deserializedSoftDeletedDatabaseAccountProperties + = new SoftDeletedDatabaseAccountProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountName".equals(fieldName)) { + deserializedSoftDeletedDatabaseAccountProperties.accountName = reader.getString(); + } else if ("softDeletionMetadata".equals(fieldName)) { + deserializedSoftDeletedDatabaseAccountProperties.softDeletionMetadata + = SoftDeletionMetadata.fromJson(reader); + } else if ("softDeleteConfiguration".equals(fieldName)) { + deserializedSoftDeletedDatabaseAccountProperties.softDeleteConfiguration + = SoftDeleteConfiguration.fromJson(reader); + } else if ("resource".equals(fieldName)) { + deserializedSoftDeletedDatabaseAccountProperties.resource + = SoftDeletedDatabaseAccountResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletedDatabaseAccountProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedDatabaseAccountResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedDatabaseAccountResource.java new file mode 100644 index 000000000000..571cbaf78b68 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedDatabaseAccountResource.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The database account resource information for a soft-deleted account. + */ +@Immutable +public final class SoftDeletedDatabaseAccountResource implements JsonSerializable { + /* + * An array that contains all of the locations enabled for the Cosmos DB account. + */ + private List locations; + + /* + * An array that contains the write location(s) for the Cosmos DB account. + */ + private List writeLocations; + + /* + * An array that contains the read locations enabled for the Cosmos DB account. + */ + private List readLocations; + + /** + * Creates an instance of SoftDeletedDatabaseAccountResource class. + */ + private SoftDeletedDatabaseAccountResource() { + } + + /** + * Get the locations property: An array that contains all of the locations enabled for the Cosmos DB account. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the writeLocations property: An array that contains the write location(s) for the Cosmos DB account. + * + * @return the writeLocations value. + */ + public List writeLocations() { + return this.writeLocations; + } + + /** + * Get the readLocations property: An array that contains the read locations enabled for the Cosmos DB account. + * + * @return the readLocations value. + */ + public List readLocations() { + return this.readLocations; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (locations() != null) { + locations().forEach(e -> e.validate()); + } + if (writeLocations() != null) { + writeLocations().forEach(e -> e.validate()); + } + if (readLocations() != null) { + readLocations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("locations", this.locations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("writeLocations", this.writeLocations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("readLocations", this.readLocations, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftDeletedDatabaseAccountResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletedDatabaseAccountResource if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SoftDeletedDatabaseAccountResource. + */ + public static SoftDeletedDatabaseAccountResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletedDatabaseAccountResource deserializedSoftDeletedDatabaseAccountResource + = new SoftDeletedDatabaseAccountResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("locations".equals(fieldName)) { + List locations = reader.readArray(reader1 -> Location.fromJson(reader1)); + deserializedSoftDeletedDatabaseAccountResource.locations = locations; + } else if ("writeLocations".equals(fieldName)) { + List writeLocations = reader.readArray(reader1 -> Location.fromJson(reader1)); + deserializedSoftDeletedDatabaseAccountResource.writeLocations = writeLocations; + } else if ("readLocations".equals(fieldName)) { + List readLocations = reader.readArray(reader1 -> Location.fromJson(reader1)); + deserializedSoftDeletedDatabaseAccountResource.readLocations = readLocations; + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletedDatabaseAccountResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlContainerProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlContainerProperties.java new file mode 100644 index 000000000000..025a4525f74c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlContainerProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of a soft-deleted SQL container. + */ +@Immutable +public final class SoftDeletedSqlContainerProperties implements JsonSerializable { + /* + * Metadata related to the soft deletion of the SQL container. + */ + private SoftDeletionMetadata softDeletionMetadata; + + /* + * The resource information for the soft-deleted SQL container. + */ + private SoftDeletedSqlContainerResource resource; + + /** + * Creates an instance of SoftDeletedSqlContainerProperties class. + */ + private SoftDeletedSqlContainerProperties() { + } + + /** + * Get the softDeletionMetadata property: Metadata related to the soft deletion of the SQL container. + * + * @return the softDeletionMetadata value. + */ + public SoftDeletionMetadata softDeletionMetadata() { + return this.softDeletionMetadata; + } + + /** + * Get the resource property: The resource information for the soft-deleted SQL container. + * + * @return the resource value. + */ + public SoftDeletedSqlContainerResource resource() { + return this.resource; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (softDeletionMetadata() != null) { + softDeletionMetadata().validate(); + } + if (resource() != null) { + resource().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("softDeletionMetadata", this.softDeletionMetadata); + jsonWriter.writeJsonField("resource", this.resource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftDeletedSqlContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletedSqlContainerProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SoftDeletedSqlContainerProperties. + */ + public static SoftDeletedSqlContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletedSqlContainerProperties deserializedSoftDeletedSqlContainerProperties + = new SoftDeletedSqlContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("softDeletionMetadata".equals(fieldName)) { + deserializedSoftDeletedSqlContainerProperties.softDeletionMetadata + = SoftDeletionMetadata.fromJson(reader); + } else if ("resource".equals(fieldName)) { + deserializedSoftDeletedSqlContainerProperties.resource + = SoftDeletedSqlContainerResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletedSqlContainerProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlContainerResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlContainerResource.java new file mode 100644 index 000000000000..761d598ca6e1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlContainerResource.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +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; + +/** + * Cosmos DB SQL container resource object. + */ +@Immutable +public final class SoftDeletedSqlContainerResource implements JsonSerializable { + /* + * Name of the Cosmos DB SQL container + */ + private String id; + + /* + * A system generated property. A unique identifier. + */ + private String rid; + + /* + * The configuration of the partition key to be used for partitioning data into multiple partitions + */ + private ContainerPartitionKey partitionKey; + + /* + * Default time to live + */ + private Integer defaultTtl; + + /** + * Creates an instance of SoftDeletedSqlContainerResource class. + */ + private SoftDeletedSqlContainerResource() { + } + + /** + * Get the id property: Name of the Cosmos DB SQL container. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the rid property: A system generated property. A unique identifier. + * + * @return the rid value. + */ + public String rid() { + return this.rid; + } + + /** + * Get the partitionKey property: The configuration of the partition key to be used for partitioning data into + * multiple partitions. + * + * @return the partitionKey value. + */ + public ContainerPartitionKey partitionKey() { + return this.partitionKey; + } + + /** + * Get the defaultTtl property: Default time to live. + * + * @return the defaultTtl value. + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property id in model SoftDeletedSqlContainerResource")); + } + if (partitionKey() != null) { + partitionKey().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SoftDeletedSqlContainerResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("partitionKey", this.partitionKey); + jsonWriter.writeNumberField("defaultTtl", this.defaultTtl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftDeletedSqlContainerResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletedSqlContainerResource 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 SoftDeletedSqlContainerResource. + */ + public static SoftDeletedSqlContainerResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletedSqlContainerResource deserializedSoftDeletedSqlContainerResource + = new SoftDeletedSqlContainerResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSoftDeletedSqlContainerResource.id = reader.getString(); + } else if ("_rid".equals(fieldName)) { + deserializedSoftDeletedSqlContainerResource.rid = reader.getString(); + } else if ("partitionKey".equals(fieldName)) { + deserializedSoftDeletedSqlContainerResource.partitionKey = ContainerPartitionKey.fromJson(reader); + } else if ("defaultTtl".equals(fieldName)) { + deserializedSoftDeletedSqlContainerResource.defaultTtl = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletedSqlContainerResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlDatabaseProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlDatabaseProperties.java new file mode 100644 index 000000000000..75ecedec4464 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlDatabaseProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of a soft-deleted SQL database. + */ +@Immutable +public final class SoftDeletedSqlDatabaseProperties implements JsonSerializable { + /* + * Metadata related to the soft deletion of the SQL database. + */ + private SoftDeletionMetadata softDeletionMetadata; + + /* + * The resource information for the soft-deleted SQL database. + */ + private SoftDeletedSqlDatabaseResource resource; + + /** + * Creates an instance of SoftDeletedSqlDatabaseProperties class. + */ + private SoftDeletedSqlDatabaseProperties() { + } + + /** + * Get the softDeletionMetadata property: Metadata related to the soft deletion of the SQL database. + * + * @return the softDeletionMetadata value. + */ + public SoftDeletionMetadata softDeletionMetadata() { + return this.softDeletionMetadata; + } + + /** + * Get the resource property: The resource information for the soft-deleted SQL database. + * + * @return the resource value. + */ + public SoftDeletedSqlDatabaseResource resource() { + return this.resource; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (softDeletionMetadata() != null) { + softDeletionMetadata().validate(); + } + if (resource() != null) { + resource().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("softDeletionMetadata", this.softDeletionMetadata); + jsonWriter.writeJsonField("resource", this.resource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftDeletedSqlDatabaseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletedSqlDatabaseProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SoftDeletedSqlDatabaseProperties. + */ + public static SoftDeletedSqlDatabaseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletedSqlDatabaseProperties deserializedSoftDeletedSqlDatabaseProperties + = new SoftDeletedSqlDatabaseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("softDeletionMetadata".equals(fieldName)) { + deserializedSoftDeletedSqlDatabaseProperties.softDeletionMetadata + = SoftDeletionMetadata.fromJson(reader); + } else if ("resource".equals(fieldName)) { + deserializedSoftDeletedSqlDatabaseProperties.resource + = SoftDeletedSqlDatabaseResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletedSqlDatabaseProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlDatabaseResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlDatabaseResource.java new file mode 100644 index 000000000000..8a5668f99324 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlDatabaseResource.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +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; + +/** + * Cosmos DB SQL database resource object. + */ +@Immutable +public final class SoftDeletedSqlDatabaseResource implements JsonSerializable { + /* + * Name of the Cosmos DB SQL database + */ + private String id; + + /* + * A system generated property. A unique identifier. + */ + private String rid; + + /** + * Creates an instance of SoftDeletedSqlDatabaseResource class. + */ + private SoftDeletedSqlDatabaseResource() { + } + + /** + * Get the id property: Name of the Cosmos DB SQL database. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the rid property: A system generated property. A unique identifier. + * + * @return the rid value. + */ + public String rid() { + return this.rid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property id in model SoftDeletedSqlDatabaseResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SoftDeletedSqlDatabaseResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftDeletedSqlDatabaseResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletedSqlDatabaseResource 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 SoftDeletedSqlDatabaseResource. + */ + public static SoftDeletedSqlDatabaseResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletedSqlDatabaseResource deserializedSoftDeletedSqlDatabaseResource + = new SoftDeletedSqlDatabaseResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSoftDeletedSqlDatabaseResource.id = reader.getString(); + } else if ("_rid".equals(fieldName)) { + deserializedSoftDeletedSqlDatabaseResource.rid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletedSqlDatabaseResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletionMetadata.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletionMetadata.java new file mode 100644 index 000000000000..5c4d54fa4a87 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletionMetadata.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Metadata about the soft deletion of a resource. + */ +@Immutable +public final class SoftDeletionMetadata implements JsonSerializable { + /* + * Indicates whether the resource is soft deleted. + */ + private Boolean isSoftDeleted; + + /* + * The timestamp when the soft deletion started. + */ + private Long softDeletionStartTimestamp; + + /* + * The timestamp when the soft-deleted resource will expire and be permanently deleted. + */ + private Long softDeletionResourceExpirationTimestamp; + + /** + * Creates an instance of SoftDeletionMetadata class. + */ + private SoftDeletionMetadata() { + } + + /** + * Get the isSoftDeleted property: Indicates whether the resource is soft deleted. + * + * @return the isSoftDeleted value. + */ + public Boolean isSoftDeleted() { + return this.isSoftDeleted; + } + + /** + * Get the softDeletionStartTimestamp property: The timestamp when the soft deletion started. + * + * @return the softDeletionStartTimestamp value. + */ + public Long softDeletionStartTimestamp() { + return this.softDeletionStartTimestamp; + } + + /** + * Get the softDeletionResourceExpirationTimestamp property: The timestamp when the soft-deleted resource will + * expire and be permanently deleted. + * + * @return the softDeletionResourceExpirationTimestamp value. + */ + public Long softDeletionResourceExpirationTimestamp() { + return this.softDeletionResourceExpirationTimestamp; + } + + /** + * 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("isSoftDeleted", this.isSoftDeleted); + jsonWriter.writeNumberField("softDeletionStartTimestamp", this.softDeletionStartTimestamp); + jsonWriter.writeNumberField("softDeletionResourceExpirationTimestamp", + this.softDeletionResourceExpirationTimestamp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftDeletionMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftDeletionMetadata if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SoftDeletionMetadata. + */ + public static SoftDeletionMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftDeletionMetadata deserializedSoftDeletionMetadata = new SoftDeletionMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isSoftDeleted".equals(fieldName)) { + deserializedSoftDeletionMetadata.isSoftDeleted = reader.getNullable(JsonReader::getBoolean); + } else if ("softDeletionStartTimestamp".equals(fieldName)) { + deserializedSoftDeletionMetadata.softDeletionStartTimestamp + = reader.getNullable(JsonReader::getLong); + } else if ("softDeletionResourceExpirationTimestamp".equals(fieldName)) { + deserializedSoftDeletionMetadata.softDeletionResourceExpirationTimestamp + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftDeletionMetadata; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesResource.java index e2b0d300bee2..093463a95764 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesResource.java @@ -96,6 +96,15 @@ public void validate() { if (restoreParameters() != null) { restoreParameters().validate(); } + if (materializedViewDefinition() != null) { + materializedViewDefinition().validate(); + } + if (materializedViews() != null) { + materializedViews().forEach(e -> e.validate()); + } + if (materializedViewsProperties() != null) { + materializedViewsProperties().validate(); + } if (computedProperties() != null) { computedProperties().forEach(e -> e.validate()); } @@ -105,6 +114,9 @@ public void validate() { if (fullTextPolicy() != null) { fullTextPolicy().validate(); } + if (dataMaskingPolicy() != null) { + dataMaskingPolicy().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(SqlContainerGetPropertiesResource.class); @@ -125,10 +137,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("analyticalStorageTtl", analyticalStorageTtl()); jsonWriter.writeJsonField("restoreParameters", restoreParameters()); jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); + jsonWriter.writeJsonField("materializedViewDefinition", materializedViewDefinition()); + jsonWriter.writeArrayField("materializedViews", materializedViews(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("materializedViewsProperties", materializedViewsProperties()); jsonWriter.writeArrayField("computedProperties", computedProperties(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("vectorEmbeddingPolicy", vectorEmbeddingPolicy()); jsonWriter.writeJsonField("fullTextPolicy", fullTextPolicy()); + jsonWriter.writeJsonField("dataMaskingPolicy", dataMaskingPolicy()); return jsonWriter.writeEndObject(); } @@ -176,6 +193,16 @@ public static SqlContainerGetPropertiesResource fromJson(JsonReader jsonReader) } else if ("createMode".equals(fieldName)) { deserializedSqlContainerGetPropertiesResource .withCreateMode(CreateMode.fromString(reader.getString())); + } else if ("materializedViewDefinition".equals(fieldName)) { + deserializedSqlContainerGetPropertiesResource + .withMaterializedViewDefinition(MaterializedViewDefinition.fromJson(reader)); + } else if ("materializedViews".equals(fieldName)) { + List materializedViews + = reader.readArray(reader1 -> MaterializedViewDetails.fromJson(reader1)); + deserializedSqlContainerGetPropertiesResource.withMaterializedViews(materializedViews); + } else if ("materializedViewsProperties".equals(fieldName)) { + deserializedSqlContainerGetPropertiesResource + .withMaterializedViewsProperties(MaterializedViewsProperties.fromJson(reader)); } else if ("computedProperties".equals(fieldName)) { List computedProperties = reader.readArray(reader1 -> ComputedProperty.fromJson(reader1)); @@ -185,6 +212,9 @@ public static SqlContainerGetPropertiesResource fromJson(JsonReader jsonReader) .withVectorEmbeddingPolicy(VectorEmbeddingPolicy.fromJson(reader)); } else if ("fullTextPolicy".equals(fieldName)) { deserializedSqlContainerGetPropertiesResource.withFullTextPolicy(FullTextPolicy.fromJson(reader)); + } else if ("dataMaskingPolicy".equals(fieldName)) { + deserializedSqlContainerGetPropertiesResource + .withDataMaskingPolicy(DataMaskingPolicy.fromJson(reader)); } else if ("_rid".equals(fieldName)) { deserializedSqlContainerGetPropertiesResource.rid = reader.getString(); } else if ("_ts".equals(fieldName)) { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerResource.java index c7964e2c259b..d22ab8a72d7f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerResource.java @@ -70,6 +70,22 @@ public class SqlContainerResource implements JsonSerializable materializedViews; + + /* + * Materialized Views Properties defined for source container. + */ + private MaterializedViewsProperties materializedViewsProperties; + /* * List of computed properties */ @@ -85,6 +101,11 @@ public class SqlContainerResource implements JsonSerializable materializedViews() { + return this.materializedViews; + } + + /** + * Set the materializedViews property: Materialized Views defined on the container. + * + * @param materializedViews the materializedViews value to set. + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withMaterializedViews(List materializedViews) { + this.materializedViews = materializedViews; + return this; + } + + /** + * Get the materializedViewsProperties property: Materialized Views Properties defined for source container. + * + * @return the materializedViewsProperties value. + */ + public MaterializedViewsProperties materializedViewsProperties() { + return this.materializedViewsProperties; + } + + /** + * Set the materializedViewsProperties property: Materialized Views Properties defined for source container. + * + * @param materializedViewsProperties the materializedViewsProperties value to set. + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource + withMaterializedViewsProperties(MaterializedViewsProperties materializedViewsProperties) { + this.materializedViewsProperties = materializedViewsProperties; + return this; + } + /** * Get the computedProperties property: List of computed properties. * @@ -357,6 +441,26 @@ public SqlContainerResource withFullTextPolicy(FullTextPolicy fullTextPolicy) { return this; } + /** + * Get the dataMaskingPolicy property: The Data Masking policy for the container. + * + * @return the dataMaskingPolicy value. + */ + public DataMaskingPolicy dataMaskingPolicy() { + return this.dataMaskingPolicy; + } + + /** + * Set the dataMaskingPolicy property: The Data Masking policy for the container. + * + * @param dataMaskingPolicy the dataMaskingPolicy value to set. + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withDataMaskingPolicy(DataMaskingPolicy dataMaskingPolicy) { + this.dataMaskingPolicy = dataMaskingPolicy; + return this; + } + /** * Validates the instance. * @@ -385,6 +489,15 @@ public void validate() { if (restoreParameters() != null) { restoreParameters().validate(); } + if (materializedViewDefinition() != null) { + materializedViewDefinition().validate(); + } + if (materializedViews() != null) { + materializedViews().forEach(e -> e.validate()); + } + if (materializedViewsProperties() != null) { + materializedViewsProperties().validate(); + } if (computedProperties() != null) { computedProperties().forEach(e -> e.validate()); } @@ -394,6 +507,9 @@ public void validate() { if (fullTextPolicy() != null) { fullTextPolicy().validate(); } + if (dataMaskingPolicy() != null) { + dataMaskingPolicy().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(SqlContainerResource.class); @@ -414,10 +530,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("analyticalStorageTtl", this.analyticalStorageTtl); jsonWriter.writeJsonField("restoreParameters", this.restoreParameters); jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); + jsonWriter.writeJsonField("materializedViewDefinition", this.materializedViewDefinition); + jsonWriter.writeArrayField("materializedViews", this.materializedViews, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("materializedViewsProperties", this.materializedViewsProperties); jsonWriter.writeArrayField("computedProperties", this.computedProperties, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("vectorEmbeddingPolicy", this.vectorEmbeddingPolicy); jsonWriter.writeJsonField("fullTextPolicy", this.fullTextPolicy); + jsonWriter.writeJsonField("dataMaskingPolicy", this.dataMaskingPolicy); return jsonWriter.writeEndObject(); } @@ -458,6 +579,16 @@ public static SqlContainerResource fromJson(JsonReader jsonReader) throws IOExce deserializedSqlContainerResource.restoreParameters = ResourceRestoreParameters.fromJson(reader); } else if ("createMode".equals(fieldName)) { deserializedSqlContainerResource.createMode = CreateMode.fromString(reader.getString()); + } else if ("materializedViewDefinition".equals(fieldName)) { + deserializedSqlContainerResource.materializedViewDefinition + = MaterializedViewDefinition.fromJson(reader); + } else if ("materializedViews".equals(fieldName)) { + List materializedViews + = reader.readArray(reader1 -> MaterializedViewDetails.fromJson(reader1)); + deserializedSqlContainerResource.materializedViews = materializedViews; + } else if ("materializedViewsProperties".equals(fieldName)) { + deserializedSqlContainerResource.materializedViewsProperties + = MaterializedViewsProperties.fromJson(reader); } else if ("computedProperties".equals(fieldName)) { List computedProperties = reader.readArray(reader1 -> ComputedProperty.fromJson(reader1)); @@ -466,6 +597,8 @@ public static SqlContainerResource fromJson(JsonReader jsonReader) throws IOExce deserializedSqlContainerResource.vectorEmbeddingPolicy = VectorEmbeddingPolicy.fromJson(reader); } else if ("fullTextPolicy".equals(fieldName)) { deserializedSqlContainerResource.fullTextPolicy = FullTextPolicy.fromJson(reader); + } else if ("dataMaskingPolicy".equals(fieldName)) { + deserializedSqlContainerResource.dataMaskingPolicy = DataMaskingPolicy.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SupportedActions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SupportedActions.java new file mode 100644 index 000000000000..617ae00ef485 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SupportedActions.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +/** + * Indicates whether what action to take for the Chaos Fault. + */ +public enum SupportedActions { + /** + * Enum value Enable. + */ + ENABLE("Enable"), + + /** + * Enum value Disable. + */ + DISABLE("Disable"); + + /** + * The actual serialized value for a SupportedActions instance. + */ + private final String value; + + SupportedActions(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SupportedActions instance. + * + * @param value the serialized value to parse. + * @return the parsed SupportedActions object, or null if unable to parse. + */ + public static SupportedActions fromString(String value) { + if (value == null) { + return null; + } + SupportedActions[] items = SupportedActions.values(); + for (SupportedActions item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputBucketResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputBucketResource.java new file mode 100644 index 000000000000..eabee2228d12 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputBucketResource.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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; + +/** + * Cosmos DB throughput bucket object. + */ +@Fluent +public final class ThroughputBucketResource implements JsonSerializable { + /* + * Represents the throughput bucket id + */ + private int id; + + /* + * Represents maximum percentage throughput that can be used by the bucket + */ + private int maxThroughputPercentage; + + /* + * Indicates whether this is the default throughput bucket + */ + private Boolean isDefaultBucket; + + /** + * Creates an instance of ThroughputBucketResource class. + */ + public ThroughputBucketResource() { + } + + /** + * Get the id property: Represents the throughput bucket id. + * + * @return the id value. + */ + public int id() { + return this.id; + } + + /** + * Set the id property: Represents the throughput bucket id. + * + * @param id the id value to set. + * @return the ThroughputBucketResource object itself. + */ + public ThroughputBucketResource withId(int id) { + this.id = id; + return this; + } + + /** + * Get the maxThroughputPercentage property: Represents maximum percentage throughput that can be used by the + * bucket. + * + * @return the maxThroughputPercentage value. + */ + public int maxThroughputPercentage() { + return this.maxThroughputPercentage; + } + + /** + * Set the maxThroughputPercentage property: Represents maximum percentage throughput that can be used by the + * bucket. + * + * @param maxThroughputPercentage the maxThroughputPercentage value to set. + * @return the ThroughputBucketResource object itself. + */ + public ThroughputBucketResource withMaxThroughputPercentage(int maxThroughputPercentage) { + this.maxThroughputPercentage = maxThroughputPercentage; + return this; + } + + /** + * Get the isDefaultBucket property: Indicates whether this is the default throughput bucket. + * + * @return the isDefaultBucket value. + */ + public Boolean isDefaultBucket() { + return this.isDefaultBucket; + } + + /** + * Set the isDefaultBucket property: Indicates whether this is the default throughput bucket. + * + * @param isDefaultBucket the isDefaultBucket value to set. + * @return the ThroughputBucketResource object itself. + */ + public ThroughputBucketResource withIsDefaultBucket(Boolean isDefaultBucket) { + this.isDefaultBucket = isDefaultBucket; + 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.writeIntField("id", this.id); + jsonWriter.writeIntField("maxThroughputPercentage", this.maxThroughputPercentage); + jsonWriter.writeBooleanField("isDefaultBucket", this.isDefaultBucket); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThroughputBucketResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputBucketResource 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 ThroughputBucketResource. + */ + public static ThroughputBucketResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputBucketResource deserializedThroughputBucketResource = new ThroughputBucketResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedThroughputBucketResource.id = reader.getInt(); + } else if ("maxThroughputPercentage".equals(fieldName)) { + deserializedThroughputBucketResource.maxThroughputPercentage = reader.getInt(); + } else if ("isDefaultBucket".equals(fieldName)) { + deserializedThroughputBucketResource.isDefaultBucket = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputBucketResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyType.java new file mode 100644 index 000000000000..4d62a4d263ba --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ThroughputPolicy to apply for throughput redistribution. + */ +public final class ThroughputPolicyType extends ExpandableStringEnum { + /** + * Static value none for ThroughputPolicyType. + */ + public static final ThroughputPolicyType NONE = fromString("none"); + + /** + * Static value equal for ThroughputPolicyType. + */ + public static final ThroughputPolicyType EQUAL = fromString("equal"); + + /** + * Static value custom for ThroughputPolicyType. + */ + public static final ThroughputPolicyType CUSTOM = fromString("custom"); + + /** + * Creates a new instance of ThroughputPolicyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ThroughputPolicyType() { + } + + /** + * Creates or finds a ThroughputPolicyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ThroughputPolicyType. + */ + public static ThroughputPolicyType fromString(String name) { + return fromString(name, ThroughputPolicyType.class); + } + + /** + * Gets known ThroughputPolicyType values. + * + * @return known ThroughputPolicyType values. + */ + public static Collection values() { + return values(ThroughputPolicyType.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPoolUpdate.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPoolUpdate.java new file mode 100644 index 000000000000..95714c4d4a4e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPoolUpdate.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.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.cosmos.fluent.models.ThroughputPoolProperties; +import java.io.IOException; + +/** + * Represents a throughput pool resource for updates. + */ +@Fluent +public final class ThroughputPoolUpdate implements JsonSerializable { + /* + * Properties of the throughput pool. + */ + private ThroughputPoolProperties innerProperties; + + /** + * Creates an instance of ThroughputPoolUpdate class. + */ + public ThroughputPoolUpdate() { + } + + /** + * Get the innerProperties property: Properties of the throughput pool. + * + * @return the innerProperties value. + */ + private ThroughputPoolProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: A provisioning state of the ThroughputPool. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: A provisioning state of the ThroughputPool. + * + * @param provisioningState the provisioningState value to set. + * @return the ThroughputPoolUpdate object itself. + */ + public ThroughputPoolUpdate withProvisioningState(Status provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new ThroughputPoolProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the maxThroughput property: Value for throughput to be shared among CosmosDB resources in the pool. + * + * @return the maxThroughput value. + */ + public Integer maxThroughput() { + return this.innerProperties() == null ? null : this.innerProperties().maxThroughput(); + } + + /** + * Set the maxThroughput property: Value for throughput to be shared among CosmosDB resources in the pool. + * + * @param maxThroughput the maxThroughput value to set. + * @return the ThroughputPoolUpdate object itself. + */ + public ThroughputPoolUpdate withMaxThroughput(Integer maxThroughput) { + if (this.innerProperties() == null) { + this.innerProperties = new ThroughputPoolProperties(); + } + this.innerProperties().withMaxThroughput(maxThroughput); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + 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 ThroughputPoolUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ThroughputPoolUpdate. + */ + public static ThroughputPoolUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolUpdate deserializedThroughputPoolUpdate = new ThroughputPoolUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedThroughputPoolUpdate.innerProperties = ThroughputPoolProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolUpdate; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsGetPropertiesResource.java index 47f2df22a4b3..0dcdcde8148b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsGetPropertiesResource.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * The ThroughputSettingsGetPropertiesResource model. @@ -136,6 +137,9 @@ public void validate() { if (autoscaleSettings() != null) { autoscaleSettings().validate(); } + if (throughputBuckets() != null) { + throughputBuckets().forEach(e -> e.validate()); + } } /** @@ -146,6 +150,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeNumberField("throughput", throughput()); jsonWriter.writeJsonField("autoscaleSettings", autoscaleSettings()); + jsonWriter.writeArrayField("throughputBuckets", throughputBuckets(), + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -180,6 +186,10 @@ public static ThroughputSettingsGetPropertiesResource fromJson(JsonReader jsonRe } else if ("softAllowedMaximumThroughput".equals(fieldName)) { deserializedThroughputSettingsGetPropertiesResource.softAllowedMaximumThroughput = reader.getString(); + } else if ("throughputBuckets".equals(fieldName)) { + List throughputBuckets + = reader.readArray(reader1 -> ThroughputBucketResource.fromJson(reader1)); + deserializedThroughputSettingsGetPropertiesResource.withThroughputBuckets(throughputBuckets); } else if ("_rid".equals(fieldName)) { deserializedThroughputSettingsGetPropertiesResource.rid = reader.getString(); } else if ("_ts".equals(fieldName)) { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsResource.java index d7fbc2d412a7..8dda4dd078ca 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsResource.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * Cosmos DB resource throughput object. Either throughput is required or autoscaleSettings is required, but not both. @@ -48,6 +49,11 @@ public class ThroughputSettingsResource implements JsonSerializable throughputBuckets; + /** * Creates an instance of ThroughputSettingsResource class. */ @@ -182,6 +188,26 @@ ThroughputSettingsResource withSoftAllowedMaximumThroughput(String softAllowedMa return this; } + /** + * Get the throughputBuckets property: Array of throughput bucket limits to be applied to the Cosmos DB container. + * + * @return the throughputBuckets value. + */ + public List throughputBuckets() { + return this.throughputBuckets; + } + + /** + * Set the throughputBuckets property: Array of throughput bucket limits to be applied to the Cosmos DB container. + * + * @param throughputBuckets the throughputBuckets value to set. + * @return the ThroughputSettingsResource object itself. + */ + public ThroughputSettingsResource withThroughputBuckets(List throughputBuckets) { + this.throughputBuckets = throughputBuckets; + return this; + } + /** * Validates the instance. * @@ -191,6 +217,9 @@ public void validate() { if (autoscaleSettings() != null) { autoscaleSettings().validate(); } + if (throughputBuckets() != null) { + throughputBuckets().forEach(e -> e.validate()); + } } /** @@ -201,6 +230,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeNumberField("throughput", this.throughput); jsonWriter.writeJsonField("autoscaleSettings", this.autoscaleSettings); + jsonWriter.writeArrayField("throughputBuckets", this.throughputBuckets, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -232,6 +263,10 @@ public static ThroughputSettingsResource fromJson(JsonReader jsonReader) throws deserializedThroughputSettingsResource.instantMaximumThroughput = reader.getString(); } else if ("softAllowedMaximumThroughput".equals(fieldName)) { deserializedThroughputSettingsResource.softAllowedMaximumThroughput = reader.getString(); + } else if ("throughputBuckets".equals(fieldName)) { + List throughputBuckets + = reader.readArray(reader1 -> ThroughputBucketResource.fromJson(reader1)); + deserializedThroughputSettingsResource.throughputBuckets = throughputBuckets; } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/azure-resourcemanager-cosmos_metadata.json b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/azure-resourcemanager-cosmos_metadata.json index a9ccb050d0ce..dfe0afd2f36b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/azure-resourcemanager-cosmos_metadata.json +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/azure-resourcemanager-cosmos_metadata.json @@ -1 +1 @@ -{"flavor":"azure","apiVersions":{"Microsoft.DocumentDB":"2026-03-15"},"crossLanguagePackageId":"Microsoft.DocumentDB","crossLanguageVersion":"ae0c42577776","generatedFiles":["src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraClustersClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraDataCentersClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionRegionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionRegionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CosmosDBManagementClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountRegionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspaceAccountsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspacesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/GremlinResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/LocationsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoMIResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/NotebookWorkspacesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdRegionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileSourceTargetsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileTargetsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentilesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableDatabaseAccountsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinDatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinGraphsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbCollectionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbDatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlContainersClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlDatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTableResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTablesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ServicesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/SqlResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/TableResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupInformationInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraClusterPublicStatusInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleAssignmentResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleAssignmentResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleDefinitionResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleDefinitionResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClusterResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandOutputInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataCenterResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListConnectionStringsResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListKeysResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListReadOnlyKeysResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleAssignmentResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleAssignmentResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleDefinitionResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleDefinitionResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/LocationGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MetricDefinitionInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MetricInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleAssignmentResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleAssignmentResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleDefinitionResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleDefinitionResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionResource.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionResource.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceConnectionInfoResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionMetricInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionUsageInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PercentileMetricInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinResourcesGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbResourcesGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlResourcesGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableResourcesGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ServiceResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentResource.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionResource.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleAssignmentResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleAssignmentResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleDefinitionResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleDefinitionResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/UsageInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/package-info.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraClustersClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraDataCentersClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionRegionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionRegionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountRegionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspaceAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspacesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/GremlinResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/LocationsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoDBResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoMIResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/NotebookWorkspacesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdRegionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileSourceTargetsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileTargetsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentilesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableDatabaseAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinDatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinGraphsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbCollectionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbDatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlContainersClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlDatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTableResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTablesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ServicesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/TableResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraKeyspaceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraTableListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ClientEncryptionKeysListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DatabaseAccountsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetspaceAccountListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetspaceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinDatabaseListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinGraphListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListClusters.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListDataCenters.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/LocationListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MetricDefinitionsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MetricListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoDBCollectionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoDBDatabaseListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoMIRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoMIRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoUserDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NotebookWorkspaceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PartitionMetricListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PartitionUsagesResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PercentileMetricListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PrivateEndpointConnectionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableDatabaseAccountsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinDatabasesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinGraphsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbCollectionsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbDatabasesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlContainersListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlDatabasesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableTableResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableTablesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ServiceResourceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlContainerListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlDatabaseListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlStoredProcedureListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlTriggerListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlUserDefinedFunctionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/UsagesResult.java","src/main/java/com/azure/resourcemanager/cosmos/models/AccountKeyMetadata.java","src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageConfiguration.java","src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageSchemaType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ApiProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ApiType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ArmProxyResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ArmResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethod.java","src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethodLdapProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/AutoReplicate.java","src/main/java/com/azure/resourcemanager/cosmos/models/AutoUpgradePolicyResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettings.java","src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettingsResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/AzureConnectionType.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationState.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyType.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupSchedule.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupStorageRedundancy.java","src/main/java/com/azure/resourcemanager/cosmos/models/Capability.java","src/main/java/com/azure/resourcemanager/cosmos/models/Capacity.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItem.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItemNode.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraError.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraPartitionKey.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraSchema.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/Certificate.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionIncludedPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClusterKey.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClusterResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/Column.java","src/main/java/com/azure/resourcemanager/cosmos/models/CommandPostBody.java","src/main/java/com/azure/resourcemanager/cosmos/models/CompositePath.java","src/main/java/com/azure/resourcemanager/cosmos/models/CompositePathSortOrder.java","src/main/java/com/azure/resourcemanager/cosmos/models/ComputedProperty.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionError.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionState.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConnectorOffer.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConsistencyPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContainerPartitionKey.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousBackupInformation.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousBackupRestoreLocation.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousModeBackupPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousModeProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousTier.java","src/main/java/com/azure/resourcemanager/cosmos/models/CorsPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/CreateMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/CreateUpdateOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataCenterResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferRegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataType.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountConnectionString.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountKeysMetadata.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountOfferType.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountRegenerateKeyParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseRestoreResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/DedicatedGatewayType.java","src/main/java/com/azure/resourcemanager/cosmos/models/DefaultConsistencyLevel.java","src/main/java/com/azure/resourcemanager/cosmos/models/DefaultPriorityLevel.java","src/main/java/com/azure/resourcemanager/cosmos/models/DistanceFunction.java","src/main/java/com/azure/resourcemanager/cosmos/models/ExcludedPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicies.java","src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetResourceUpdate.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceAccountPropertiesGlobalDatabaseAccountProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesFleetspaceApiKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesServiceTier.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesThroughputPoolConfiguration.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceUpdate.java","src/main/java/com/azure/resourcemanager/cosmos/models/FullTextIndexPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeRegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseRestoreResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/IncludedPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/IndexKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/Indexes.java","src/main/java/com/azure/resourcemanager/cosmos/models/IndexingMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/IndexingPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/IpAddressOrRange.java","src/main/java/com/azure/resourcemanager/cosmos/models/KeyKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/KeyWrapMetadata.java","src/main/java/com/azure/resourcemanager/cosmos/models/Kind.java","src/main/java/com/azure/resourcemanager/cosmos/models/Location.java","src/main/java/com/azure/resourcemanager/cosmos/models/LocationProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraProvisioningState.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraReaperStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraResourceIdentityType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentityUserAssignedIdentities.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderRegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/MetricAvailability.java","src/main/java/com/azure/resourcemanager/cosmos/models/MetricName.java","src/main/java/com/azure/resourcemanager/cosmos/models/MetricValue.java","src/main/java/com/azure/resourcemanager/cosmos/models/MinimalTlsVersion.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoIndex.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoIndexKeys.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoIndexOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionType.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoUserDefinitionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/NetworkAclBypass.java","src/main/java/com/azure/resourcemanager/cosmos/models/NodeState.java","src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceName.java","src/main/java/com/azure/resourcemanager/cosmos/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/cosmos/models/OperationType.java","src/main/java/com/azure/resourcemanager/cosmos/models/OptionsResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/PartitionKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/PercentileMetricValue.java","src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeBackupPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/Permission.java","src/main/java/com/azure/resourcemanager/cosmos/models/PrimaryAggregationType.java","src/main/java/com/azure/resourcemanager/cosmos/models/PrivateEndpointProperty.java","src/main/java/com/azure/resourcemanager/cosmos/models/PrivateLinkServiceConnectionStateProperty.java","src/main/java/com/azure/resourcemanager/cosmos/models/Privilege.java","src/main/java/com/azure/resourcemanager/cosmos/models/PrivilegeResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/cosmos/models/RegionForOnlineOffline.java","src/main/java/com/azure/resourcemanager/cosmos/models/RegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ResourceIdentityType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ResourceRestoreParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinDatabasePropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinGraphPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableLocationResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbCollectionPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbDatabasePropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResourceContainer.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResourceDatabase.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTablePropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestoreMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParametersBase.java","src/main/java/com/azure/resourcemanager/cosmos/models/Role.java","src/main/java/com/azure/resourcemanager/cosmos/models/RoleDefinitionType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ScheduledEventStrategy.java","src/main/java/com/azure/resourcemanager/cosmos/models/SeedNode.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServerVersion.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceSize.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceType.java","src/main/java/com/azure/resourcemanager/cosmos/models/SpatialSpec.java","src/main/java/com/azure/resourcemanager/cosmos/models/SpatialType.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDedicatedGatewayRegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDedicatedGatewayServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDedicatedGatewayServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleAssignmentCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleDefinitionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/Status.java","src/main/java/com/azure/resourcemanager/cosmos/models/TableCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/TableResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/TriggerOperation.java","src/main/java/com/azure/resourcemanager/cosmos/models/TriggerType.java","src/main/java/com/azure/resourcemanager/cosmos/models/Type.java","src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKey.java","src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKeyPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/UnitType.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorDataType.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbedding.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbeddingPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndex.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndexType.java","src/main/java/com/azure/resourcemanager/cosmos/models/VirtualNetworkRule.java","src/main/java/com/azure/resourcemanager/cosmos/models/package-info.java","src/main/java/com/azure/resourcemanager/cosmos/package-info.java"]} \ No newline at end of file +{"flavor":"azure","apiVersions":{"Microsoft.DocumentDB":"2026-04-01-preview"},"crossLanguagePackageId":"Microsoft.DocumentDB","crossLanguageVersion":"f8868ace270b","generatedFiles":["src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraClustersClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraDataCentersClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ChaosFaultsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionRegionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionRegionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CopyJobsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CosmosDBManagementClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/DataTransferJobsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountRegionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetAnalyticsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspaceAccountsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspacesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/GarnetClustersClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/GraphResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/GremlinResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/LocationsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoMIResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/NetworkSecurityPerimeterConfigurationsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/NotebookWorkspacesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdRegionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileSourceTargetsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileTargetsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentilesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableDatabaseAccountsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinDatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinGraphsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbCollectionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbDatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlContainersClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlDatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTableResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTablesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ServicesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedDatabaseAccountsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedSqlContainersClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/SoftDeletedSqlDatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/SqlResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/TableResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsOperationsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsOperationsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupInformationInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraClusterPublicStatusInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleAssignmentResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleAssignmentResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleDefinitionResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleDefinitionResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClusterResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandOutputInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandPublicResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CopyJobGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataCenterResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListConnectionStringsResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListKeysResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListReadOnlyKeysResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GarnetClusterResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleAssignmentResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleAssignmentResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleDefinitionResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleDefinitionResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/LocationGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MetricDefinitionInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MetricInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleAssignmentResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleAssignmentResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleDefinitionResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleDefinitionResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionResource.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionResource.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NetworkSecurityPerimeterConfigurationInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceConnectionInfoResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionMetricInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionUsageInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PercentileMetricInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionStorageInfoCollectionInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RedistributeThroughputProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinResourcesGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbResourcesGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlResourcesGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableResourcesGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RetrieveThroughputProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ServiceResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedDatabaseAccountGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedDatabaseAccountsListResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlContainerGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlContainersListResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlDatabaseGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SoftDeletedSqlDatabasesListResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentResource.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionResource.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleAssignmentResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleAssignmentResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleDefinitionResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleDefinitionResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/UsageInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/package-info.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraClustersClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraDataCentersClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ChaosFaultsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionRegionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionRegionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CopyJobsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/DataTransferJobsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountRegionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetAnalyticsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspaceAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspacesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/GarnetClustersClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/GraphResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/GremlinResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/LocationsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoDBResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoMIResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/NotebookWorkspacesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdRegionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileSourceTargetsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileTargetsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentilesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableDatabaseAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinDatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinGraphsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbCollectionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbDatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlContainersClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlDatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTableResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTablesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ServicesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedDatabaseAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedSqlContainersClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/SoftDeletedSqlDatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/TableResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraKeyspaceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraTableListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraViewListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ChaosFaultListResponse.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ClientEncryptionKeysListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CopyJobFeedResults.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DataTransferJobFeedResults.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DatabaseAccountsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetAnalyticsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetspaceAccountListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetspaceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GraphResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinDatabaseListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinGraphListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListBackups.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListClusters.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListCommands.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListDataCenters.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListGarnetClusters.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/LocationListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MetricDefinitionsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MetricListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoDBCollectionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoDBDatabaseListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoMIRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoMIRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoUserDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NetworkSecurityPerimeterConfigurationListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NotebookWorkspaceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PartitionMetricListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PartitionUsagesResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PercentileMetricListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PrivateEndpointConnectionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableDatabaseAccountsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinDatabasesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinGraphsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbCollectionsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbDatabasesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlContainersListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlDatabasesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableTableResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableTablesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ServiceResourceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlContainerListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlDatabaseListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlStoredProcedureListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlTriggerListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlUserDefinedFunctionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolAccountsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/UsagesResult.java","src/main/java/com/azure/resourcemanager/cosmos/models/AccessRule.java","src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleDirection.java","src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/AccessRulePropertiesSubscription.java","src/main/java/com/azure/resourcemanager/cosmos/models/AccountKeyMetadata.java","src/main/java/com/azure/resourcemanager/cosmos/models/AllocationState.java","src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageConfiguration.java","src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageSchemaType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ApiProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ApiType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ArmProxyResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ArmResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethod.java","src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethodLdapProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/AutoReplicate.java","src/main/java/com/azure/resourcemanager/cosmos/models/AutoUpgradePolicyResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettings.java","src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettingsResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobContainer.java","src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobDataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobSourceSinkDetails.java","src/main/java/com/azure/resourcemanager/cosmos/models/AzureConnectionType.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationState.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyType.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupSchedule.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupState.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupStorageRedundancy.java","src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/BaseCosmosDataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/Capability.java","src/main/java/com/azure/resourcemanager/cosmos/models/Capacity.java","src/main/java/com/azure/resourcemanager/cosmos/models/CapacityMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeChangeTransitionState.java","src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeTransitionStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItem.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItemNode.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraError.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraPartitionKey.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraSchema.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/Certificate.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionIncludedPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClusterKey.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClusterResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClusterType.java","src/main/java/com/azure/resourcemanager/cosmos/models/Column.java","src/main/java/com/azure/resourcemanager/cosmos/models/CommandAsyncPostBody.java","src/main/java/com/azure/resourcemanager/cosmos/models/CommandPostBody.java","src/main/java/com/azure/resourcemanager/cosmos/models/CommandStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/CompositePath.java","src/main/java/com/azure/resourcemanager/cosmos/models/CompositePathSortOrder.java","src/main/java/com/azure/resourcemanager/cosmos/models/ComputedProperty.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionError.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionState.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConnectorOffer.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConsistencyPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContainerPartitionKey.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousBackupInformation.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousBackupRestoreLocation.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousModeBackupPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousModeProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousTier.java","src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobType.java","src/main/java/com/azure/resourcemanager/cosmos/models/CorsPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosCassandraDataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBCassandraTable.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoCollection.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoVCoreCollection.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBNoSqlContainer.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBSourceSinkDetails.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoDataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoVCoreDataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosSqlDataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/CreateJobRequest.java","src/main/java/com/azure/resourcemanager/cosmos/models/CreateMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/CreateUpdateOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataCenterResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyExcludedPathsItem.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyIncludedPathsItem.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferComponent.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferJobMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferRegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataType.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountConnectionString.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountKeysMetadata.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountOfferType.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountRegenerateKeyParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseRestoreResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/DedicatedGatewayType.java","src/main/java/com/azure/resourcemanager/cosmos/models/DefaultConsistencyLevel.java","src/main/java/com/azure/resourcemanager/cosmos/models/DefaultPriorityLevel.java","src/main/java/com/azure/resourcemanager/cosmos/models/DiagnosticLogSettings.java","src/main/java/com/azure/resourcemanager/cosmos/models/DistanceFunction.java","src/main/java/com/azure/resourcemanager/cosmos/models/EnableFullTextQuery.java","src/main/java/com/azure/resourcemanager/cosmos/models/ExcludedPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicies.java","src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetAnalyticsPropertiesStorageLocationType.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetResourceUpdate.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceAccountPropertiesGlobalDatabaseAccountProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesFleetspaceApiKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesServiceTier.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesThroughputPoolConfiguration.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceUpdate.java","src/main/java/com/azure/resourcemanager/cosmos/models/FullTextIndexPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/GarnetAuthenticationType.java","src/main/java/com/azure/resourcemanager/cosmos/models/GarnetCacheProvisioningState.java","src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatch.java","src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatchProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePropertiesEndPointsItem.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeRegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseRestoreResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/IncludedPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/IndexKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/Indexes.java","src/main/java/com/azure/resourcemanager/cosmos/models/IndexingMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/IndexingPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/IpAddressOrRange.java","src/main/java/com/azure/resourcemanager/cosmos/models/IssueType.java","src/main/java/com/azure/resourcemanager/cosmos/models/KeyKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/KeyWrapMetadata.java","src/main/java/com/azure/resourcemanager/cosmos/models/Kind.java","src/main/java/com/azure/resourcemanager/cosmos/models/Location.java","src/main/java/com/azure/resourcemanager/cosmos/models/LocationProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraProvisioningState.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraReaperStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraResourceIdentityType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentityUserAssignedIdentities.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDefinition.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDetails.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderRegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/MergeParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MetricAvailability.java","src/main/java/com/azure/resourcemanager/cosmos/models/MetricName.java","src/main/java/com/azure/resourcemanager/cosmos/models/MetricValue.java","src/main/java/com/azure/resourcemanager/cosmos/models/MinimalTlsVersion.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoIndex.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoIndexKeys.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoIndexOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionType.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoUserDefinitionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoVCoreSourceSinkDetails.java","src/main/java/com/azure/resourcemanager/cosmos/models/NetworkAclBypass.java","src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeter.java","src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProvisioningState.java","src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityProfile.java","src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/NodeState.java","src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceName.java","src/main/java/com/azure/resourcemanager/cosmos/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/cosmos/models/OperationType.java","src/main/java/com/azure/resourcemanager/cosmos/models/OptionsResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/PartitionKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/PercentileMetricValue.java","src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeBackupPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/Permission.java","src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionId.java","src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionStorageInfo.java","src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResultPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/PrimaryAggregationType.java","src/main/java/com/azure/resourcemanager/cosmos/models/PrivateEndpointProperty.java","src/main/java/com/azure/resourcemanager/cosmos/models/PrivateLinkServiceConnectionStateProperty.java","src/main/java/com/azure/resourcemanager/cosmos/models/Privilege.java","src/main/java/com/azure/resourcemanager/cosmos/models/PrivilegeResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssue.java","src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssueProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RegionForOnlineOffline.java","src/main/java/com/azure/resourcemanager/cosmos/models/RegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociation.java","src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociationAccessMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/ResourceIdentityType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ResourceRestoreParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinDatabasePropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinGraphPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableLocationResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbCollectionPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbDatabasePropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResourceContainer.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResourceDatabase.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTablePropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestoreMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParametersBase.java","src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/Role.java","src/main/java/com/azure/resourcemanager/cosmos/models/RoleDefinitionType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ScheduledEventStrategy.java","src/main/java/com/azure/resourcemanager/cosmos/models/SeedNode.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServerVersion.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceSize.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceType.java","src/main/java/com/azure/resourcemanager/cosmos/models/Severity.java","src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeleteActionKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeleteConfiguration.java","src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedDatabaseAccountProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedDatabaseAccountResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlContainerProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlContainerResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlDatabaseProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletedSqlDatabaseResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SoftDeletionMetadata.java","src/main/java/com/azure/resourcemanager/cosmos/models/SpatialSpec.java","src/main/java/com/azure/resourcemanager/cosmos/models/SpatialType.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDedicatedGatewayRegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDedicatedGatewayServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDedicatedGatewayServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleAssignmentCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleDefinitionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/Status.java","src/main/java/com/azure/resourcemanager/cosmos/models/SupportedActions.java","src/main/java/com/azure/resourcemanager/cosmos/models/TableCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/TableResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputBucketResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPoolUpdate.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/TriggerOperation.java","src/main/java/com/azure/resourcemanager/cosmos/models/TriggerType.java","src/main/java/com/azure/resourcemanager/cosmos/models/Type.java","src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKey.java","src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKeyPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/UnitType.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorDataType.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbedding.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbeddingPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndex.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndexType.java","src/main/java/com/azure/resourcemanager/cosmos/models/VirtualNetworkRule.java","src/main/java/com/azure/resourcemanager/cosmos/models/package-info.java","src/main/java/com/azure/resourcemanager/cosmos/package-info.java"]} \ No newline at end of file diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cosmos/proxy-config.json b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cosmos/proxy-config.json index 5b975228acac..1c51c4d08571 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cosmos/proxy-config.json +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cosmos/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.cosmos.implementation.CassandraClustersClientImpl$CassandraClustersService"],["com.azure.resourcemanager.cosmos.implementation.CassandraDataCentersClientImpl$CassandraDataCentersService"],["com.azure.resourcemanager.cosmos.implementation.CassandraResourcesClientImpl$CassandraResourcesService"],["com.azure.resourcemanager.cosmos.implementation.CollectionPartitionRegionsClientImpl$CollectionPartitionRegionsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionPartitionsClientImpl$CollectionPartitionsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionRegionsClientImpl$CollectionRegionsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionsClientImpl$CollectionsService"],["com.azure.resourcemanager.cosmos.implementation.DatabaseAccountRegionsClientImpl$DatabaseAccountRegionsService"],["com.azure.resourcemanager.cosmos.implementation.DatabaseAccountsClientImpl$DatabaseAccountsService"],["com.azure.resourcemanager.cosmos.implementation.DatabasesClientImpl$DatabasesService"],["com.azure.resourcemanager.cosmos.implementation.FleetsClientImpl$FleetsService"],["com.azure.resourcemanager.cosmos.implementation.FleetspaceAccountsClientImpl$FleetspaceAccountsService"],["com.azure.resourcemanager.cosmos.implementation.FleetspacesClientImpl$FleetspacesService"],["com.azure.resourcemanager.cosmos.implementation.GremlinResourcesClientImpl$GremlinResourcesService"],["com.azure.resourcemanager.cosmos.implementation.LocationsClientImpl$LocationsService"],["com.azure.resourcemanager.cosmos.implementation.MongoDBResourcesClientImpl$MongoDBResourcesService"],["com.azure.resourcemanager.cosmos.implementation.MongoMIResourcesClientImpl$MongoMIResourcesService"],["com.azure.resourcemanager.cosmos.implementation.NotebookWorkspacesClientImpl$NotebookWorkspacesService"],["com.azure.resourcemanager.cosmos.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.cosmos.implementation.PartitionKeyRangeIdRegionsClientImpl$PartitionKeyRangeIdRegionsService"],["com.azure.resourcemanager.cosmos.implementation.PartitionKeyRangeIdsClientImpl$PartitionKeyRangeIdsService"],["com.azure.resourcemanager.cosmos.implementation.PercentileSourceTargetsClientImpl$PercentileSourceTargetsService"],["com.azure.resourcemanager.cosmos.implementation.PercentileTargetsClientImpl$PercentileTargetsService"],["com.azure.resourcemanager.cosmos.implementation.PercentilesClientImpl$PercentilesService"],["com.azure.resourcemanager.cosmos.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.cosmos.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableDatabaseAccountsClientImpl$RestorableDatabaseAccountsService"],["com.azure.resourcemanager.cosmos.implementation.RestorableGremlinDatabasesClientImpl$RestorableGremlinDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableGremlinGraphsClientImpl$RestorableGremlinGraphsService"],["com.azure.resourcemanager.cosmos.implementation.RestorableGremlinResourcesClientImpl$RestorableGremlinResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableMongodbCollectionsClientImpl$RestorableMongodbCollectionsService"],["com.azure.resourcemanager.cosmos.implementation.RestorableMongodbDatabasesClientImpl$RestorableMongodbDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableMongodbResourcesClientImpl$RestorableMongodbResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableSqlContainersClientImpl$RestorableSqlContainersService"],["com.azure.resourcemanager.cosmos.implementation.RestorableSqlDatabasesClientImpl$RestorableSqlDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableSqlResourcesClientImpl$RestorableSqlResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableTableResourcesClientImpl$RestorableTableResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableTablesClientImpl$RestorableTablesService"],["com.azure.resourcemanager.cosmos.implementation.ServicesClientImpl$ServicesService"],["com.azure.resourcemanager.cosmos.implementation.SqlResourcesClientImpl$SqlResourcesService"],["com.azure.resourcemanager.cosmos.implementation.TableResourcesClientImpl$TableResourcesService"]] \ No newline at end of file +[["com.azure.resourcemanager.cosmos.implementation.CassandraClustersClientImpl$CassandraClustersService"],["com.azure.resourcemanager.cosmos.implementation.CassandraDataCentersClientImpl$CassandraDataCentersService"],["com.azure.resourcemanager.cosmos.implementation.CassandraResourcesClientImpl$CassandraResourcesService"],["com.azure.resourcemanager.cosmos.implementation.ChaosFaultsClientImpl$ChaosFaultsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionPartitionRegionsClientImpl$CollectionPartitionRegionsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionPartitionsClientImpl$CollectionPartitionsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionRegionsClientImpl$CollectionRegionsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionsClientImpl$CollectionsService"],["com.azure.resourcemanager.cosmos.implementation.CopyJobsClientImpl$CopyJobsService"],["com.azure.resourcemanager.cosmos.implementation.DataTransferJobsClientImpl$DataTransferJobsService"],["com.azure.resourcemanager.cosmos.implementation.DatabaseAccountRegionsClientImpl$DatabaseAccountRegionsService"],["com.azure.resourcemanager.cosmos.implementation.DatabaseAccountsClientImpl$DatabaseAccountsService"],["com.azure.resourcemanager.cosmos.implementation.DatabasesClientImpl$DatabasesService"],["com.azure.resourcemanager.cosmos.implementation.FleetAnalyticsClientImpl$FleetAnalyticsService"],["com.azure.resourcemanager.cosmos.implementation.FleetsClientImpl$FleetsService"],["com.azure.resourcemanager.cosmos.implementation.FleetspaceAccountsClientImpl$FleetspaceAccountsService"],["com.azure.resourcemanager.cosmos.implementation.FleetspacesClientImpl$FleetspacesService"],["com.azure.resourcemanager.cosmos.implementation.GarnetClustersClientImpl$GarnetClustersService"],["com.azure.resourcemanager.cosmos.implementation.GraphResourcesClientImpl$GraphResourcesService"],["com.azure.resourcemanager.cosmos.implementation.GremlinResourcesClientImpl$GremlinResourcesService"],["com.azure.resourcemanager.cosmos.implementation.LocationsClientImpl$LocationsService"],["com.azure.resourcemanager.cosmos.implementation.MongoDBResourcesClientImpl$MongoDBResourcesService"],["com.azure.resourcemanager.cosmos.implementation.MongoMIResourcesClientImpl$MongoMIResourcesService"],["com.azure.resourcemanager.cosmos.implementation.NetworkSecurityPerimeterConfigurationsClientImpl$NetworkSecurityPerimeterConfigurationsService"],["com.azure.resourcemanager.cosmos.implementation.NotebookWorkspacesClientImpl$NotebookWorkspacesService"],["com.azure.resourcemanager.cosmos.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.cosmos.implementation.PartitionKeyRangeIdRegionsClientImpl$PartitionKeyRangeIdRegionsService"],["com.azure.resourcemanager.cosmos.implementation.PartitionKeyRangeIdsClientImpl$PartitionKeyRangeIdsService"],["com.azure.resourcemanager.cosmos.implementation.PercentileSourceTargetsClientImpl$PercentileSourceTargetsService"],["com.azure.resourcemanager.cosmos.implementation.PercentileTargetsClientImpl$PercentileTargetsService"],["com.azure.resourcemanager.cosmos.implementation.PercentilesClientImpl$PercentilesService"],["com.azure.resourcemanager.cosmos.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.cosmos.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableDatabaseAccountsClientImpl$RestorableDatabaseAccountsService"],["com.azure.resourcemanager.cosmos.implementation.RestorableGremlinDatabasesClientImpl$RestorableGremlinDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableGremlinGraphsClientImpl$RestorableGremlinGraphsService"],["com.azure.resourcemanager.cosmos.implementation.RestorableGremlinResourcesClientImpl$RestorableGremlinResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableMongodbCollectionsClientImpl$RestorableMongodbCollectionsService"],["com.azure.resourcemanager.cosmos.implementation.RestorableMongodbDatabasesClientImpl$RestorableMongodbDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableMongodbResourcesClientImpl$RestorableMongodbResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableSqlContainersClientImpl$RestorableSqlContainersService"],["com.azure.resourcemanager.cosmos.implementation.RestorableSqlDatabasesClientImpl$RestorableSqlDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableSqlResourcesClientImpl$RestorableSqlResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableTableResourcesClientImpl$RestorableTableResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableTablesClientImpl$RestorableTablesService"],["com.azure.resourcemanager.cosmos.implementation.ServicesClientImpl$ServicesService"],["com.azure.resourcemanager.cosmos.implementation.SoftDeletedDatabaseAccountsClientImpl$SoftDeletedDatabaseAccountsService"],["com.azure.resourcemanager.cosmos.implementation.SoftDeletedSqlContainersClientImpl$SoftDeletedSqlContainersService"],["com.azure.resourcemanager.cosmos.implementation.SoftDeletedSqlDatabasesClientImpl$SoftDeletedSqlDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.SqlResourcesClientImpl$SqlResourcesService"],["com.azure.resourcemanager.cosmos.implementation.TableResourcesClientImpl$TableResourcesService"],["com.azure.resourcemanager.cosmos.implementation.ThroughputPoolAccountsClientImpl$ThroughputPoolAccountsService"],["com.azure.resourcemanager.cosmos.implementation.ThroughputPoolAccountsOperationsClientImpl$ThroughputPoolAccountsOperationsService"],["com.azure.resourcemanager.cosmos.implementation.ThroughputPoolsClientImpl$ThroughputPoolsService"],["com.azure.resourcemanager.cosmos.implementation.ThroughputPoolsOperationsClientImpl$ThroughputPoolsOperationsService"]] \ No newline at end of file diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersCreateUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersCreateUpdateSamples.java index 3fb8a0c9ffa8..0293bbdb8337 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersCreateUpdateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersCreateUpdateSamples.java @@ -18,7 +18,7 @@ */ public final class CassandraClustersCreateUpdateSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraClusterCreate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraClusterCreate.json */ /** * Sample code: CosmosDBManagedCassandraClusterCreate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeallocateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeallocateSamples.java index 3de917b4c940..149f2cbea673 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeallocateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeallocateSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraClustersDeallocateSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraClusterDeallocate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraClusterDeallocate.json */ /** * Sample code: CosmosDBManagedCassandraClusterDeallocate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeleteSamples.java index ae4d3615ab17..68fc25d9d77d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeleteSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraClustersDeleteSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraClusterDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraClusterDelete.json */ /** * Sample code: CosmosDBManagedCassandraClusterDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetBackupSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetBackupSamples.java new file mode 100644 index 000000000000..9730d5641025 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetBackupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CassandraClusters GetBackup. + */ +public final class CassandraClustersGetBackupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraBackup.json + */ + /** + * Sample code: CosmosDBManagedCassandraBackup. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBManagedCassandraBackup(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCassandraClusters() + .getBackupWithResponse("cassandra-prod-rg", "cassandra-prod", "1611250348", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetByResourceGroupSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetByResourceGroupSamples.java index d143fb1dfe46..708b8b7ac8f1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetByResourceGroupSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraClustersGetByResourceGroupSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraClusterGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraClusterGet.json */ /** * Sample code: CosmosDBManagedCassandraClusterGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetCommandAsyncResourceSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetCommandAsyncResourceSamples.java new file mode 100644 index 000000000000..69b1057ec6f4 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetCommandAsyncResourceSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CassandraClusters GetCommandAsyncResource. + */ +public final class CassandraClustersGetCommandAsyncResourceSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraCommandResult.json + */ + /** + * Sample code: CosmosDBManagedCassandraCommandResult. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBManagedCassandraCommandResult(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCassandraClusters() + .getCommandAsyncResourceWithResponse("cassandra-prod-rg", "cassandra-prod", + "318653d0-3da5-4814-b8f6-429f2af0b2a4", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersInvokeCommandAsyncResourceSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersInvokeCommandAsyncResourceSamples.java new file mode 100644 index 000000000000..b5cb0d1e3255 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersInvokeCommandAsyncResourceSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.cosmos.models.CommandAsyncPostBody; +import java.io.IOException; + +/** + * Samples for CassandraClusters InvokeCommandAsyncResource. + */ +public final class CassandraClustersInvokeCommandAsyncResourceSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraCommandAsync.json + */ + /** + * Sample code: CosmosDBManagedCassandraCommandAsync. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBManagedCassandraCommandAsync(com.azure.resourcemanager.cosmos.CosmosManager manager) + throws IOException { + manager.serviceClient() + .getCassandraClusters() + .invokeCommandAsyncResource("cassandra-prod-rg", "cassandra-prod", + new CommandAsyncPostBody().withCommand("nodetool") + .withArguments(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"status\":\"\"}", Object.class, SerializerEncoding.JSON)) + .withHost("10.0.1.12"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersInvokeCommandSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersInvokeCommandSamples.java index d129b4bfab3e..7c4790ce1271 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersInvokeCommandSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersInvokeCommandSamples.java @@ -5,13 +5,15 @@ package com.azure.resourcemanager.cosmos.generated; import com.azure.resourcemanager.cosmos.models.CommandPostBody; +import java.util.HashMap; +import java.util.Map; /** * Samples for CassandraClusters InvokeCommand. */ public final class CassandraClustersInvokeCommandSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraCommand.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraCommand.json */ /** * Sample code: CosmosDBManagedCassandraCommand. @@ -22,7 +24,19 @@ public static void cosmosDBManagedCassandraCommand(com.azure.resourcemanager.cos manager.serviceClient() .getCassandraClusters() .invokeCommand("cassandra-prod-rg", "cassandra-prod", - new CommandPostBody().withCommand("nodetool status").withHost("10.0.1.12"), + new CommandPostBody().withCommand("nodetool").withArguments(mapOf("status", "")).withHost("10.0.1.12"), com.azure.core.util.Context.NONE); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListBackupsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListBackupsSamples.java new file mode 100644 index 000000000000..f08ab5a64540 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListBackupsSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CassandraClusters ListBackups. + */ +public final class CassandraClustersListBackupsSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraBackupsList.json + */ + /** + * Sample code: CosmosDBManagedCassandraBackupsList. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBManagedCassandraBackupsList(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCassandraClusters() + .listBackups("cassandra-prod-rg", "cassandra-prod", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListByResourceGroupSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListByResourceGroupSamples.java index be6ef5747c17..d4f195f780e7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListByResourceGroupSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraClustersListByResourceGroupSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraClusterListByResourceGroup.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraClusterListByResourceGroup.json */ /** * Sample code: CosmosDBManagedCassandraClusterListByResourceGroup. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListCommandSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListCommandSamples.java new file mode 100644 index 000000000000..0eeab92ff17c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListCommandSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CassandraClusters ListCommand. + */ +public final class CassandraClustersListCommandSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraListCommand.json + */ + /** + * Sample code: CosmosDBManagedCassandraListCommand. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBManagedCassandraListCommand(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCassandraClusters() + .listCommand("cassandra-prod-rg", "cassandra-prod", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListSamples.java index 083ca1bb32c9..c6eed4dd286f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraClustersListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraClusterListBySubscription.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraClusterListBySubscription.json */ /** * Sample code: CosmosDBManagedCassandraClusterListBySubscription. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStartSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStartSamples.java index 842cb26bc6e8..184bf26a723a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStartSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStartSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraClustersStartSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraClusterStart.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraClusterStart.json */ /** * Sample code: CosmosDBManagedCassandraClusterStart. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStatusSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStatusSamples.java index 66d566deacaa..14306152d91e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStatusSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStatusSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraClustersStatusSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraStatus.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraStatus.json */ /** * Sample code: CosmosDBManagedCassandraStatus. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersUpdateSamples.java index 3cb96c34fd3f..009b870fa31c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersUpdateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersUpdateSamples.java @@ -18,7 +18,7 @@ */ public final class CassandraClustersUpdateSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraClusterPatch.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraClusterPatch.json */ /** * Sample code: CosmosDBManagedCassandraClusterPatch. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersCreateUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersCreateUpdateSamples.java index 54e89434d35e..e85a5badedac 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersCreateUpdateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersCreateUpdateSamples.java @@ -12,7 +12,7 @@ */ public final class CassandraDataCentersCreateUpdateSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraDataCenterCreate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraDataCenterCreate.json */ /** * Sample code: CosmosDBManagedCassandraDataCenterCreate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersDeleteSamples.java index 15a64a422cd3..4dca3589d765 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersDeleteSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraDataCentersDeleteSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraDataCenterDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraDataCenterDelete.json */ /** * Sample code: CosmosDBManagedCassandraDataCenterDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersGetSamples.java index 97c85171c1f1..239113c053d5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersGetSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersGetSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraDataCentersGetSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraDataCenterGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraDataCenterGet.json */ /** * Sample code: CosmosDBManagedCassandraDataCenterGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersListSamples.java index 4e47a4d50010..e12d43d0c600 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersListSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraDataCentersListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraDataCenterList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraDataCenterList.json */ /** * Sample code: CosmosDBManagedCassandraDataCenterList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersUpdateSamples.java index 27a0390fd1f1..8203c77da1af 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersUpdateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersUpdateSamples.java @@ -12,7 +12,7 @@ */ public final class CassandraDataCentersUpdateSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBManagedCassandraDataCenterPatch.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBManagedCassandraDataCenterPatch.json */ /** * Sample code: CosmosDBManagedCassandraDataCenterUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraKeyspaceSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraKeyspaceSamples.java index c1d4025414a7..ff43e3a7d8ae 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraKeyspaceSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraKeyspaceSamples.java @@ -15,7 +15,7 @@ */ public final class CassandraResourcesCreateUpdateCassandraKeyspaceSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraKeyspaceCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraKeyspaceCreateUpdate.json */ /** * Sample code: CosmosDBCassandraKeyspaceCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraRoleAssignmentSamples.java index d9352f379f13..6bb96aec01ea 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraRoleAssignmentSamples.java @@ -11,7 +11,7 @@ */ public final class CassandraResourcesCreateUpdateCassandraRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/cassandrarbac/CosmosDBCassandraRoleAssignmentCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/cassandrarbac/CosmosDBCassandraRoleAssignmentCreateUpdate.json */ /** * Sample code: CosmosDBCassandraRoleAssignmentCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraRoleDefinitionSamples.java index 21d9c8e50bab..6ce91d07efa4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraRoleDefinitionSamples.java @@ -14,7 +14,7 @@ */ public final class CassandraResourcesCreateUpdateCassandraRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/cassandrarbac/CosmosDBCassandraRoleDefinitionCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/cassandrarbac/CosmosDBCassandraRoleDefinitionCreateUpdate.json */ /** * Sample code: CosmosDBCassandraRoleDefinitionCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraTableSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraTableSamples.java index 0167aa706a93..4dce3d7a3eb0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraTableSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraTableSamples.java @@ -20,7 +20,7 @@ */ public final class CassandraResourcesCreateUpdateCassandraTableSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraTableCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraTableCreateUpdate.json */ /** * Sample code: CosmosDBCassandraTableCreateUpdate. @@ -38,7 +38,8 @@ public static void cosmosDBCassandraTableCreateUpdate(com.azure.resourcemanager. .withSchema(new CassandraSchema() .withColumns(Arrays.asList(new Column().withName("columnA").withType("Ascii"))) .withPartitionKeys(Arrays.asList(new CassandraPartitionKey().withName("columnA"))) - .withClusterKeys(Arrays.asList(new ClusterKey().withName("columnA").withOrderBy("Asc"))))) + .withClusterKeys(Arrays.asList(new ClusterKey().withName("columnA").withOrderBy("Asc")))) + .withAnalyticalStorageTtl(500)) .withOptions(new CreateUpdateOptions()), com.azure.core.util.Context.NONE); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraViewSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraViewSamples.java new file mode 100644 index 000000000000..6d0f39f8b9f8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraViewSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.CassandraViewCreateUpdateParameters; +import com.azure.resourcemanager.cosmos.models.CassandraViewResource; +import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CassandraResources CreateUpdateCassandraView. + */ +public final class CassandraResourcesCreateUpdateCassandraViewSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraViewCreateUpdate.json + */ + /** + * Sample code: CosmosDBCassandraViewCreateUpdate. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCassandraViewCreateUpdate(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCassandraResources() + .createUpdateCassandraView("rg1", "ddb1", "keyspacename", "viewname", + new CassandraViewCreateUpdateParameters().withTags(mapOf()) + .withResource(new CassandraViewResource().withId("viewname") + .withViewDefinition( + "SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)")) + .withOptions(new CreateUpdateOptions()), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraKeyspaceSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraKeyspaceSamples.java index 00e82a384488..31f323a88373 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraKeyspaceSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraKeyspaceSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesDeleteCassandraKeyspaceSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraKeyspaceDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraKeyspaceDelete.json */ /** * Sample code: CosmosDBCassandraKeyspaceDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraRoleAssignmentSamples.java index 88ae90e0f3c5..fed7bf644f8c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraRoleAssignmentSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesDeleteCassandraRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/cassandrarbac/CosmosDBCassandraRoleAssignmentDelete.json + * x-ms-original-file: 2026-04-01-preview/cassandrarbac/CosmosDBCassandraRoleAssignmentDelete.json */ /** * Sample code: CosmosDBCassandraRoleAssignmentDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraRoleDefinitionSamples.java index a4241f318d7b..d94d35e693ea 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraRoleDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesDeleteCassandraRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/cassandrarbac/CosmosDBCassandraRoleDefinitionDelete.json + * x-ms-original-file: 2026-04-01-preview/cassandrarbac/CosmosDBCassandraRoleDefinitionDelete.json */ /** * Sample code: CosmosDBCassandraRoleDefinitionDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraTableSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraTableSamples.java index ffb4cb5dc7bf..61a18d72cfcd 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraTableSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraTableSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesDeleteCassandraTableSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraTableDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraTableDelete.json */ /** * Sample code: CosmosDBCassandraTableDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraViewSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraViewSamples.java new file mode 100644 index 000000000000..b1d39c0db270 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraViewSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CassandraResources DeleteCassandraView. + */ +public final class CassandraResourcesDeleteCassandraViewSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraViewDelete.json + */ + /** + * Sample code: CosmosDBCassandraViewDelete. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCassandraViewDelete(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCassandraResources() + .deleteCassandraView("rg1", "ddb1", "keyspacename", "viewname", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceSamples.java index c7add683a93b..6d89f7bd0caf 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesGetCassandraKeyspaceSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraKeyspaceGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraKeyspaceGet.json */ /** * Sample code: CosmosDBCassandraKeyspaceGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceThroughputSamples.java index e35027f0f37b..a60b0f5b91d3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesGetCassandraKeyspaceThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraKeyspaceThroughputGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraKeyspaceThroughputGet.json */ /** * Sample code: CosmosDBCassandraKeyspaceThroughputGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraRoleAssignmentSamples.java index 3c03d6d632a7..47457cedd517 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraRoleAssignmentSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesGetCassandraRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/cassandrarbac/CosmosDBCassandraRoleAssignmentGet.json + * x-ms-original-file: 2026-04-01-preview/cassandrarbac/CosmosDBCassandraRoleAssignmentGet.json */ /** * Sample code: CosmosDBCassandraRoleAssignmentGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraRoleDefinitionSamples.java index f8a8fee6f50d..c4ce58ad13cf 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraRoleDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesGetCassandraRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/cassandrarbac/CosmosDBCassandraRoleDefinitionGet.json + * x-ms-original-file: 2026-04-01-preview/cassandrarbac/CosmosDBCassandraRoleDefinitionGet.json */ /** * Sample code: CosmosDBCassandraRoleDefinitionGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableSamples.java index 89b9d0512034..c065b5a8c0ca 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesGetCassandraTableSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraTableGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraTableGet.json */ /** * Sample code: CosmosDBCassandraTableGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableThroughputSamples.java index d78c5605f45c..ed54e52c97a0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesGetCassandraTableThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraTableThroughputGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraTableThroughputGet.json */ /** * Sample code: CosmosDBCassandraTableThroughputGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraViewSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraViewSamples.java new file mode 100644 index 000000000000..0f21bf2e4225 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraViewSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CassandraResources GetCassandraView. + */ +public final class CassandraResourcesGetCassandraViewSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraViewGet.json + */ + /** + * Sample code: CosmosDBCassandraViewGet. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCassandraViewGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCassandraResources() + .getCassandraViewWithResponse("rg1", "ddb1", "keyspacename", "viewname", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraViewThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraViewThroughputSamples.java new file mode 100644 index 000000000000..87da4aa106aa --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraViewThroughputSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CassandraResources GetCassandraViewThroughput. + */ +public final class CassandraResourcesGetCassandraViewThroughputSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraViewThroughputGet.json + */ + /** + * Sample code: CosmosDBCassandraViewThroughputGet. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCassandraViewThroughputGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCassandraResources() + .getCassandraViewThroughputWithResponse("rg1", "ddb1", "keyspacename", "viewname", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraKeyspacesSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraKeyspacesSamples.java index 9905ec3ecd37..f2576182a52f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraKeyspacesSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraKeyspacesSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesListCassandraKeyspacesSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraKeyspaceList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraKeyspaceList.json */ /** * Sample code: CosmosDBCassandraKeyspaceList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraRoleAssignmentsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraRoleAssignmentsSamples.java index 662cfa1c240c..3042d206c42d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraRoleAssignmentsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraRoleAssignmentsSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesListCassandraRoleAssignmentsSamples { /* - * x-ms-original-file: 2026-03-15/cassandrarbac/CosmosDBCassandraRoleAssignmentList.json + * x-ms-original-file: 2026-04-01-preview/cassandrarbac/CosmosDBCassandraRoleAssignmentList.json */ /** * Sample code: CosmosDBCassandraRoleAssignmentList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraRoleDefinitionsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraRoleDefinitionsSamples.java index 8c6fb50a3441..c20e28f16e68 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraRoleDefinitionsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraRoleDefinitionsSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesListCassandraRoleDefinitionsSamples { /* - * x-ms-original-file: 2026-03-15/cassandrarbac/CosmosDBCassandraRoleDefinitionList.json + * x-ms-original-file: 2026-04-01-preview/cassandrarbac/CosmosDBCassandraRoleDefinitionList.json */ /** * Sample code: CosmosDBCassandraRoleDefinitionList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraTablesSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraTablesSamples.java index 37fc06fec96e..6da14544fa5d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraTablesSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraTablesSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesListCassandraTablesSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraTableList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraTableList.json */ /** * Sample code: CosmosDBCassandraTableList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraViewsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraViewsSamples.java new file mode 100644 index 000000000000..476b71b580ac --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraViewsSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CassandraResources ListCassandraViews. + */ +public final class CassandraResourcesListCassandraViewsSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraViewList.json + */ + /** + * Sample code: CosmosDBCassandraViewList. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCassandraViewList(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCassandraResources() + .listCassandraViews("rgName", "ddb1", "keyspacename", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToAutoscaleSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToAutoscaleSamples.java index 4a7956863d0a..3866a9ee8837 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToAutoscaleSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToAutoscaleSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesMigrateCassandraKeyspaceToAutoscaleSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraKeyspaceMigrateToAutoscale.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraKeyspaceMigrateToAutoscale.json */ /** * Sample code: CosmosDBCassandraKeyspaceMigrateToAutoscale. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToManualThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToManualThroughputSamples.java index 02ae840a230d..edd978bfd6a3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToManualThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToManualThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesMigrateCassandraKeyspaceToManualThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json */ /** * Sample code: CosmosDBCassandraKeyspaceMigrateToManualThroughput. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToAutoscaleSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToAutoscaleSamples.java index 1c65823d4db4..5f6ee984a0bf 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToAutoscaleSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToAutoscaleSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesMigrateCassandraTableToAutoscaleSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraTableMigrateToAutoscale.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraTableMigrateToAutoscale.json */ /** * Sample code: CosmosDBCassandraTableMigrateToAutoscale. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToManualThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToManualThroughputSamples.java index 50a6d839339d..2ab1fc02e410 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToManualThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToManualThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class CassandraResourcesMigrateCassandraTableToManualThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraTableMigrateToManualThroughput.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraTableMigrateToManualThroughput.json */ /** * Sample code: CosmosDBCassandraTableMigrateToManualThroughput. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraViewToAutoscaleSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraViewToAutoscaleSamples.java new file mode 100644 index 000000000000..655cbb228002 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraViewToAutoscaleSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CassandraResources MigrateCassandraViewToAutoscale. + */ +public final class CassandraResourcesMigrateCassandraViewToAutoscaleSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraViewMigrateToAutoscale.json + */ + /** + * Sample code: CosmosDBCassandraViewMigrateToAutoscale. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCassandraViewMigrateToAutoscale(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCassandraResources() + .migrateCassandraViewToAutoscale("rg1", "ddb1", "keyspacename", "viewname", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraViewToManualThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraViewToManualThroughputSamples.java new file mode 100644 index 000000000000..e3c456cdd3ab --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraViewToManualThroughputSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CassandraResources MigrateCassandraViewToManualThroughput. + */ +public final class CassandraResourcesMigrateCassandraViewToManualThroughputSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraViewMigrateToManualThroughput.json + */ + /** + * Sample code: CosmosDBCassandraViewMigrateToManualThroughput. + * + * @param manager Entry point to CosmosManager. + */ + public static void + cosmosDBCassandraViewMigrateToManualThroughput(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCassandraResources() + .migrateCassandraViewToManualThroughput("rg1", "ddb1", "keyspacename", "viewname", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraKeyspaceThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraKeyspaceThroughputSamples.java index 1dcf553da35f..c83079fd3681 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraKeyspaceThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraKeyspaceThroughputSamples.java @@ -14,7 +14,7 @@ */ public final class CassandraResourcesUpdateCassandraKeyspaceThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraKeyspaceThroughputUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraKeyspaceThroughputUpdate.json */ /** * Sample code: CosmosDBCassandraKeyspaceThroughputUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraTableThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraTableThroughputSamples.java index f96438de76db..07b479847346 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraTableThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraTableThroughputSamples.java @@ -14,7 +14,7 @@ */ public final class CassandraResourcesUpdateCassandraTableThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCassandraTableThroughputUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraTableThroughputUpdate.json */ /** * Sample code: CosmosDBCassandraTableThroughputUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraViewThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraViewThroughputSamples.java new file mode 100644 index 000000000000..2a7f3ea6a6e8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraViewThroughputSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource; +import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CassandraResources UpdateCassandraViewThroughput. + */ +public final class CassandraResourcesUpdateCassandraViewThroughputSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBCassandraViewThroughputUpdate.json + */ + /** + * Sample code: CosmosDBCassandraViewThroughputUpdate. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCassandraViewThroughputUpdate(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCassandraResources() + .updateCassandraViewThroughput("rg1", "ddb1", "keyspacename", "viewname", + new ThroughputSettingsUpdateParameters().withTags(mapOf()) + .withResource(new ThroughputSettingsResource().withThroughput(400)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultEnableDisableSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultEnableDisableSamples.java new file mode 100644 index 000000000000..9f906449095a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultEnableDisableSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.fluent.models.ChaosFaultResourceInner; +import com.azure.resourcemanager.cosmos.models.SupportedActions; + +/** + * Samples for ChaosFault EnableDisable. + */ +public final class ChaosFaultEnableDisableSamples { + /* + * x-ms-original-file: 2026-04-01-preview/ChaosFaultEnableDisable.json + */ + /** + * Sample code: ChaosFaultEnableDisable. + * + * @param manager Entry point to CosmosManager. + */ + public static void chaosFaultEnableDisable(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getChaosFaults() + .enableDisable("myResourceGroupName", "myAccountName", "ServiceUnavailability", + new ChaosFaultResourceInner().withAction(SupportedActions.ENABLE) + .withRegion("EastUS") + .withDatabaseName("testDatabase") + .withContainerName("testCollection"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultGetSamples.java new file mode 100644 index 000000000000..1acb19dc01a5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for ChaosFault Get. + */ +public final class ChaosFaultGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/ChaosFaultGet.json + */ + /** + * Sample code: ChaosFaultGet. + * + * @param manager Entry point to CosmosManager. + */ + public static void chaosFaultGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getChaosFaults() + .getWithResponse("rg1", "ddb1", "ServiceUnavailability", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultListSamples.java new file mode 100644 index 000000000000..1f14379611e0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for ChaosFault List. + */ +public final class ChaosFaultListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/ChaosFaultList.json + */ + /** + * Sample code: ChaosFaultList. + * + * @param manager Entry point to CosmosManager. + */ + public static void chaosFaultList(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient().getChaosFaults().list("rg1", "ddb1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricDefinitionsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricDefinitionsSamples.java index 0dbd642ea4a5..58f0a3128985 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricDefinitionsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricDefinitionsSamples.java @@ -9,7 +9,7 @@ */ public final class CollectionListMetricDefinitionsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCollectionGetMetricDefinitions.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCollectionGetMetricDefinitions.json */ /** * Sample code: CosmosDBCollectionGetMetricDefinitions. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricsSamples.java index c9b4adee55d7..cfea073ababe 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricsSamples.java @@ -9,7 +9,7 @@ */ public final class CollectionListMetricsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCollectionGetMetrics.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCollectionGetMetrics.json */ /** * Sample code: CosmosDBCollectionGetMetrics. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListUsagesSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListUsagesSamples.java index 040d8179c419..48c8c0a6fc1e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListUsagesSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListUsagesSamples.java @@ -9,7 +9,7 @@ */ public final class CollectionListUsagesSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCollectionGetUsages.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCollectionGetUsages.json */ /** * Sample code: CosmosDBCollectionGetUsages. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListMetricsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListMetricsSamples.java index bdc1eb3b783f..4d901b047619 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListMetricsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListMetricsSamples.java @@ -9,14 +9,14 @@ */ public final class CollectionPartitionListMetricsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCollectionPartitionGetMetrics.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCollectionPartitionGetMetrics.json */ /** - * Sample code: CosmosDBCollectionPartitionGetMetrics. + * Sample code: CosmosDBDatabaseAccountRegionGetMetrics. * * @param manager Entry point to CosmosManager. */ - public static void cosmosDBCollectionPartitionGetMetrics(com.azure.resourcemanager.cosmos.CosmosManager manager) { + public static void cosmosDBDatabaseAccountRegionGetMetrics(com.azure.resourcemanager.cosmos.CosmosManager manager) { manager.serviceClient() .getCollectionPartitions() .listMetrics("rg1", "ddb1", "databaseRid", "collectionRid", diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListUsagesSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListUsagesSamples.java index cf867535548c..2464c1d24802 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListUsagesSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListUsagesSamples.java @@ -9,14 +9,14 @@ */ public final class CollectionPartitionListUsagesSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCollectionPartitionGetUsages.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCollectionPartitionGetUsages.json */ /** - * Sample code: CosmosDBCollectionPartitionGetUsages. + * Sample code: CosmosDBCollectionGetUsages. * * @param manager Entry point to CosmosManager. */ - public static void cosmosDBCollectionPartitionGetUsages(com.azure.resourcemanager.cosmos.CosmosManager manager) { + public static void cosmosDBCollectionGetUsages(com.azure.resourcemanager.cosmos.CosmosManager manager) { manager.serviceClient() .getCollectionPartitions() .listUsages("rg1", "ddb1", "databaseRid", "collectionRid", "name.value eq 'Partition Storage'", diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionRegionListMetricsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionRegionListMetricsSamples.java index a705f0cc1615..5df0b715448d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionRegionListMetricsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionRegionListMetricsSamples.java @@ -9,15 +9,14 @@ */ public final class CollectionPartitionRegionListMetricsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBCollectionPartitionRegionGetMetrics.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBCollectionPartitionRegionGetMetrics.json */ /** - * Sample code: CosmosDBCollectionPartitionRegionGetMetrics. + * Sample code: CosmosDBDatabaseAccountRegionGetMetrics. * * @param manager Entry point to CosmosManager. */ - public static void - cosmosDBCollectionPartitionRegionGetMetrics(com.azure.resourcemanager.cosmos.CosmosManager manager) { + public static void cosmosDBDatabaseAccountRegionGetMetrics(com.azure.resourcemanager.cosmos.CosmosManager manager) { manager.serviceClient() .getCollectionPartitionRegions() .listMetrics("rg1", "ddb1", "North Europe", "databaseRid", "collectionRid", diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionRegionListMetricsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionRegionListMetricsSamples.java index 1598ddbe1064..52f305ea0e61 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionRegionListMetricsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionRegionListMetricsSamples.java @@ -9,7 +9,7 @@ */ public final class CollectionRegionListMetricsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRegionCollectionGetMetrics.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRegionCollectionGetMetrics.json */ /** * Sample code: CosmosDBRegionCollectionGetMetrics. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsCancelSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsCancelSamples.java new file mode 100644 index 000000000000..a7786a2c2acc --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsCancelSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CopyJobs Cancel. + */ +public final class CopyJobsCancelSamples { + /* + * x-ms-original-file: 2026-04-01-preview/copy-jobs/CosmosDBCopyJobCancel.json + */ + /** + * Sample code: CosmosDBCopyJobCancel. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCopyJobCancel(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient().getCopyJobs().cancelWithResponse("rg1", "ddb1", "j1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsCompleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsCompleteSamples.java new file mode 100644 index 000000000000..5a9ac2a23b76 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsCompleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CopyJobs Complete. + */ +public final class CopyJobsCompleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/copy-jobs/CosmosDBCopyJobComplete.json + */ + /** + * Sample code: CosmosDBCopyJobComplete. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCopyJobComplete(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCopyJobs() + .completeWithResponse("rg1", "ddb1", "j1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsCreateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsCreateSamples.java new file mode 100644 index 000000000000..e08bf11b350b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsCreateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.fluent.models.CopyJobGetResultsInner; +import com.azure.resourcemanager.cosmos.models.CopyJobMode; +import com.azure.resourcemanager.cosmos.models.CopyJobProperties; +import com.azure.resourcemanager.cosmos.models.CosmosDBNoSqlContainer; +import com.azure.resourcemanager.cosmos.models.NoSqlRUToNoSqlRUCopyJobProperties; +import com.azure.resourcemanager.cosmos.models.NoSqlRUToNoSqlRUCopyJobTask; +import java.util.Arrays; + +/** + * Samples for CopyJobs Create. + */ +public final class CopyJobsCreateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/copy-jobs/CosmosDBCopyJobCreate.json + */ + /** + * Sample code: CosmosDBCopyJobCreate. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCopyJobCreate(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getCopyJobs() + .createWithResponse("rg1", "ddb1", "j1", new CopyJobGetResultsInner().withProperties(new CopyJobProperties() + .withJobProperties(new NoSqlRUToNoSqlRUCopyJobProperties().withTasks(Arrays.asList( + new NoSqlRUToNoSqlRUCopyJobTask() + .withSource(new CosmosDBNoSqlContainer().withDatabaseName("sourceDb1") + .withContainerName("sourceTable1")) + .withDestination( + new CosmosDBNoSqlContainer().withDatabaseName("destDB1").withContainerName("destTable1")), + new NoSqlRUToNoSqlRUCopyJobTask() + .withSource(new CosmosDBNoSqlContainer().withDatabaseName("sourceDb2") + .withContainerName("sourceTable2")) + .withDestination( + new CosmosDBNoSqlContainer().withDatabaseName("destDB2").withContainerName("destTable2"))))) + .withMode(CopyJobMode.OFFLINE)), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsGetSamples.java new file mode 100644 index 000000000000..21d40a8e4c99 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CopyJobs Get. + */ +public final class CopyJobsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/copy-jobs/CosmosDBCopyJobGet.json + */ + /** + * Sample code: CosmosDBCopyJobGet. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCopyJobGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient().getCopyJobs().getWithResponse("rg1", "ddb1", "j1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsListByDatabaseAccountSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsListByDatabaseAccountSamples.java new file mode 100644 index 000000000000..f1fb4719c986 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsListByDatabaseAccountSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CopyJobs ListByDatabaseAccount. + */ +public final class CopyJobsListByDatabaseAccountSamples { + /* + * x-ms-original-file: 2026-04-01-preview/copy-jobs/CosmosDBCopyJobFeed.json + */ + /** + * Sample code: CosmosDBCopyJobFeed. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCopyJobFeed(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient().getCopyJobs().listByDatabaseAccount("rg1", "ddb1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsPauseSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsPauseSamples.java new file mode 100644 index 000000000000..829a2f6be55a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsPauseSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CopyJobs Pause. + */ +public final class CopyJobsPauseSamples { + /* + * x-ms-original-file: 2026-04-01-preview/copy-jobs/CosmosDBCopyJobPause.json + */ + /** + * Sample code: CosmosDBCopyJobPause. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCopyJobPause(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient().getCopyJobs().pauseWithResponse("rg1", "ddb1", "j1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsResumeSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsResumeSamples.java new file mode 100644 index 000000000000..51acbe7abc9d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/CopyJobsResumeSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for CopyJobs Resume. + */ +public final class CopyJobsResumeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/copy-jobs/CosmosDBCopyJobResume.json + */ + /** + * Sample code: CosmosDBCopyJobResume. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBCopyJobResume(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient().getCopyJobs().resumeWithResponse("rg1", "ddb1", "j1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsCancelSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsCancelSamples.java new file mode 100644 index 000000000000..c7572f530634 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsCancelSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for DataTransferJobs Cancel. + */ +public final class DataTransferJobsCancelSamples { + /* + * x-ms-original-file: 2026-04-01-preview/data-transfer-service/CosmosDBDataTransferJobCancel.json + */ + /** + * Sample code: CosmosDBDataTransferJobCancel. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBDataTransferJobCancel(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getDataTransferJobs() + .cancelWithResponse("rg1", "ddb1", "j1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsCompleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsCompleteSamples.java new file mode 100644 index 000000000000..0d072ac28384 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsCompleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for DataTransferJobs Complete. + */ +public final class DataTransferJobsCompleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/data-transfer-service/CosmosDBDataTransferJobComplete.json + */ + /** + * Sample code: CosmosDBDataTransferJobComplete. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBDataTransferJobComplete(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getDataTransferJobs() + .completeWithResponse("rg1", "ddb1", "j1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsCreateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsCreateSamples.java new file mode 100644 index 000000000000..42c1500e812f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsCreateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.fluent.models.DataTransferJobProperties; +import com.azure.resourcemanager.cosmos.models.AzureBlobDataTransferDataSourceSink; +import com.azure.resourcemanager.cosmos.models.CosmosCassandraDataTransferDataSourceSink; +import com.azure.resourcemanager.cosmos.models.CreateJobRequest; + +/** + * Samples for DataTransferJobs Create. + */ +public final class DataTransferJobsCreateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/data-transfer-service/CosmosDBDataTransferJobCreate.json + */ + /** + * Sample code: CosmosDBDataTransferJobCreate. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBDataTransferJobCreate(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getDataTransferJobs() + .createWithResponse("rg1", "ddb1", "j1", + new CreateJobRequest().withProperties(new DataTransferJobProperties() + .withSource(new CosmosCassandraDataTransferDataSourceSink().withKeyspaceName("fakeTokenPlaceholder") + .withTableName("table")) + .withDestination(new AzureBlobDataTransferDataSourceSink().withContainerName("blob_container") + .withEndpointUrl("https://blob.windows.net"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsGetSamples.java new file mode 100644 index 000000000000..8768faad2d77 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for DataTransferJobs Get. + */ +public final class DataTransferJobsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/data-transfer-service/CosmosDBDataTransferJobGet.json + */ + /** + * Sample code: CosmosDBDataTransferJobGet. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBDataTransferJobGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getDataTransferJobs() + .getWithResponse("rg1", "ddb1", "j1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsListByDatabaseAccountSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsListByDatabaseAccountSamples.java new file mode 100644 index 000000000000..697001b31c92 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsListByDatabaseAccountSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for DataTransferJobs ListByDatabaseAccount. + */ +public final class DataTransferJobsListByDatabaseAccountSamples { + /* + * x-ms-original-file: 2026-04-01-preview/data-transfer-service/CosmosDBDataTransferJobFeed.json + */ + /** + * Sample code: CosmosDBDataTransferJobFeed. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBDataTransferJobFeed(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getDataTransferJobs() + .listByDatabaseAccount("rg1", "ddb1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsPauseSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsPauseSamples.java new file mode 100644 index 000000000000..da920fcb2e4c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsPauseSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for DataTransferJobs Pause. + */ +public final class DataTransferJobsPauseSamples { + /* + * x-ms-original-file: 2026-04-01-preview/data-transfer-service/CosmosDBDataTransferJobPause.json + */ + /** + * Sample code: CosmosDBDataTransferJobPause. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBDataTransferJobPause(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getDataTransferJobs() + .pauseWithResponse("rg1", "ddb1", "j1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsResumeSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsResumeSamples.java new file mode 100644 index 000000000000..d87d0f43a22b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DataTransferJobsResumeSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for DataTransferJobs Resume. + */ +public final class DataTransferJobsResumeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/data-transfer-service/CosmosDBDataTransferJobResume.json + */ + /** + * Sample code: CosmosDBDataTransferJobResume. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBDataTransferJobResume(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getDataTransferJobs() + .resumeWithResponse("rg1", "ddb1", "j1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountRegionListMetricsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountRegionListMetricsSamples.java index ab5535776381..0e80e98b008d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountRegionListMetricsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountRegionListMetricsSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountRegionListMetricsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountRegionGetMetrics.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountRegionGetMetrics.json */ /** * Sample code: CosmosDBDatabaseAccountRegionGetMetrics. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCheckNameExistsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCheckNameExistsSamples.java index 69ead8a60ac3..10b6bf0687f1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCheckNameExistsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCheckNameExistsSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountsCheckNameExistsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountCheckNameExists.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountCheckNameExists.json */ /** * Sample code: CosmosDBDatabaseAccountCheckNameExists. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCreateOrUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCreateOrUpdateSamples.java index 1bac145ac6ac..eb489f2dcde4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCreateOrUpdateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCreateOrUpdateSamples.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.cosmos.models.ApiProperties; import com.azure.resourcemanager.cosmos.models.BackupStorageRedundancy; import com.azure.resourcemanager.cosmos.models.Capacity; +import com.azure.resourcemanager.cosmos.models.CapacityMode; import com.azure.resourcemanager.cosmos.models.ConsistencyPolicy; import com.azure.resourcemanager.cosmos.models.ContinuousModeBackupPolicy; import com.azure.resourcemanager.cosmos.models.ContinuousModeProperties; @@ -44,7 +45,7 @@ */ public final class DatabaseAccountsCreateOrUpdateSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestoreDatabaseAccountCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestoreDatabaseAccountCreateUpdate.json */ /** * Sample code: CosmosDBRestoreDatabaseAccountCreateUpdate.json. @@ -75,7 +76,7 @@ public final class DatabaseAccountsCreateOrUpdateSamples { .withRestoreParameters(new RestoreParameters().withRestoreWithTtlDisabled(false) .withRestoreMode(RestoreMode.POINT_IN_TIME) .withRestoreSource( - "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc") + "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc") .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-03-11T22:05:09Z")) .withDatabasesToRestore(Arrays.asList( new DatabaseRestoreResource().withDatabaseName("db1") @@ -83,12 +84,13 @@ public final class DatabaseAccountsCreateOrUpdateSamples { new DatabaseRestoreResource().withDatabaseName("db2") .withCollectionNames(Arrays.asList("collection3", "collection4")))) .withSourceBackupLocation("westus")) + .withEnableMaterializedViews(false) .withMinimalTlsVersion(MinimalTlsVersion.TLS) .withEnforceHierarchicalPartitionKeyIdLastLevel(false), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountCreateMax.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountCreateMax.json */ /** * Sample code: CosmosDBDatabaseAccountCreateMax. @@ -138,16 +140,19 @@ public static void cosmosDBDatabaseAccountCreateMax(com.azure.resourcemanager.co .withNetworkAclBypassResourceIds(Arrays.asList( "/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName")) .withCapacity(new Capacity().withTotalThroughputLimit(2000)) + .withCapacityMode(CapacityMode.PROVISIONED) + .withEnableMaterializedViews(false) .withEnableBurstCapacity(true) .withMinimalTlsVersion(MinimalTlsVersion.TLS12) .withEnablePriorityBasedExecution(true) .withDefaultPriorityLevel(DefaultPriorityLevel.LOW) .withEnablePerRegionPerPartitionAutoscale(true) + .withEnableAllVersionsAndDeletesChangeFeed(false) .withEnforceHierarchicalPartitionKeyIdLastLevel(false), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountCreateMin.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountCreateMin.json */ /** * Sample code: CosmosDBDatabaseAccountCreateMin. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsDeleteSamples.java index e3f74b1ad57a..130ef1eaec28 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsDeleteSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountsDeleteSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountDelete.json */ /** * Sample code: CosmosDBDatabaseAccountDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsFailoverPriorityChangeSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsFailoverPriorityChangeSamples.java index 4bade63e3c6b..4140786f8f7c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsFailoverPriorityChangeSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsFailoverPriorityChangeSamples.java @@ -13,7 +13,7 @@ */ public final class DatabaseAccountsFailoverPriorityChangeSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountFailoverPriorityChange.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountFailoverPriorityChange.json */ /** * Sample code: CosmosDBDatabaseAccountFailoverPriorityChange. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetByResourceGroupSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetByResourceGroupSamples.java index 8d163982ef02..46ce709eb45f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetByResourceGroupSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountsGetByResourceGroupSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountGet.json */ /** * Sample code: CosmosDBDatabaseAccountGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetReadOnlyKeysSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetReadOnlyKeysSamples.java index bf24d83021f0..733ac1d09a21 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetReadOnlyKeysSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetReadOnlyKeysSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountsGetReadOnlyKeysSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountListReadOnlyKeys_GetReadOnlyKeys.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountListReadOnlyKeys_GetReadOnlyKeys.json */ /** * Sample code: CosmosDBDatabaseAccountListReadOnlyKeys. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListByResourceGroupSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListByResourceGroupSamples.java index fc9bcad4b516..b3b8283d12b6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListByResourceGroupSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountsListByResourceGroupSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountListByResourceGroup.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountListByResourceGroup.json */ /** * Sample code: CosmosDBDatabaseAccountListByResourceGroup. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListConnectionStringsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListConnectionStringsSamples.java index f62c9f387172..a87253c16404 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListConnectionStringsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListConnectionStringsSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountsListConnectionStringsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountListConnectionStrings.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountListConnectionStrings.json */ /** * Sample code: CosmosDBDatabaseAccountListConnectionStrings. @@ -24,7 +24,7 @@ public final class DatabaseAccountsListConnectionStringsSamples { } /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountListConnectionStringsMongo.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountListConnectionStringsMongo.json */ /** * Sample code: CosmosDBDatabaseAccountListConnectionStringsMongo. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListKeysSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListKeysSamples.java index 039940b761eb..13fda2aded2a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListKeysSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListKeysSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountsListKeysSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountListKeys.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountListKeys.json */ /** * Sample code: CosmosDBDatabaseAccountListKeys. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricDefinitionsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricDefinitionsSamples.java index 29d6902a8ff3..08ffc2940eb7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricDefinitionsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricDefinitionsSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountsListMetricDefinitionsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountGetMetricDefinitions.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountGetMetricDefinitions.json */ /** * Sample code: CosmosDBDatabaseAccountGetMetricDefinitions. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricsSamples.java index 4da4320f03cc..c7b633bdcfe4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricsSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountsListMetricsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountGetMetrics.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountGetMetrics.json */ /** * Sample code: CosmosDBDatabaseAccountGetMetrics. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListReadOnlyKeysSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListReadOnlyKeysSamples.java index 91789cbbac3d..537e05e3958c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListReadOnlyKeysSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListReadOnlyKeysSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountsListReadOnlyKeysSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountListReadOnlyKeys.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountListReadOnlyKeys.json */ /** * Sample code: CosmosDBDatabaseAccountListReadOnlyKeys. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListSamples.java index c617fbd89c02..32cb168ab6e9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountsListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountList.json */ /** * Sample code: CosmosDBDatabaseAccountList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListUsagesSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListUsagesSamples.java index a141193d67e9..27fa526454d0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListUsagesSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListUsagesSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseAccountsListUsagesSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountGetUsages.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountGetUsages.json */ /** * Sample code: CosmosDBDatabaseAccountGetUsages. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOfflineRegionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOfflineRegionSamples.java index a8122925ff74..82ae7ae90d68 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOfflineRegionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOfflineRegionSamples.java @@ -11,7 +11,7 @@ */ public final class DatabaseAccountsOfflineRegionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountOfflineRegion.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountOfflineRegion.json */ /** * Sample code: CosmosDBDatabaseAccountOfflineRegion. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOnlineRegionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOnlineRegionSamples.java index 7b60baa36d5c..288d4147fcf0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOnlineRegionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOnlineRegionSamples.java @@ -11,7 +11,7 @@ */ public final class DatabaseAccountsOnlineRegionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountOnlineRegion.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountOnlineRegion.json */ /** * Sample code: CosmosDBDatabaseAccountOnlineRegion. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsRegenerateKeySamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsRegenerateKeySamples.java index faee1529b835..025ead2b76b2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsRegenerateKeySamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsRegenerateKeySamples.java @@ -12,7 +12,7 @@ */ public final class DatabaseAccountsRegenerateKeySamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountRegenerateKey.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountRegenerateKey.json */ /** * Sample code: CosmosDBDatabaseAccountRegenerateKey. @@ -22,7 +22,7 @@ public final class DatabaseAccountsRegenerateKeySamples { public static void cosmosDBDatabaseAccountRegenerateKey(com.azure.resourcemanager.cosmos.CosmosManager manager) { manager.serviceClient() .getDatabaseAccounts() - .regenerateKey("rg1", "ddb1", new DatabaseAccountRegenerateKeyParameters().withKeyKind(KeyKind.PRIMARY), - com.azure.core.util.Context.NONE); + .regenerateKey("rg1", "ddb1", new DatabaseAccountRegenerateKeyParameters().withKeyKind(KeyKind.PRIMARY) + .withSkipAccountKeysLastUsageCheck(false), com.azure.core.util.Context.NONE); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsUpdateSamples.java index 21666c7dce73..55a9655715ca 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsUpdateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsUpdateSamples.java @@ -8,10 +8,13 @@ import com.azure.resourcemanager.cosmos.models.AnalyticalStorageSchemaType; import com.azure.resourcemanager.cosmos.models.BackupStorageRedundancy; import com.azure.resourcemanager.cosmos.models.Capacity; +import com.azure.resourcemanager.cosmos.models.CapacityMode; import com.azure.resourcemanager.cosmos.models.ConsistencyPolicy; import com.azure.resourcemanager.cosmos.models.DatabaseAccountUpdateParameters; import com.azure.resourcemanager.cosmos.models.DefaultConsistencyLevel; import com.azure.resourcemanager.cosmos.models.DefaultPriorityLevel; +import com.azure.resourcemanager.cosmos.models.DiagnosticLogSettings; +import com.azure.resourcemanager.cosmos.models.EnableFullTextQuery; import com.azure.resourcemanager.cosmos.models.IpAddressOrRange; import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentityUserAssignedIdentities; @@ -30,7 +33,7 @@ */ public final class DatabaseAccountsUpdateSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseAccountPatch.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseAccountPatch.json */ /** * Sample code: CosmosDBDatabaseAccountPatch. @@ -64,11 +67,14 @@ public static void cosmosDBDatabaseAccountPatch(com.azure.resourcemanager.cosmos .withBackupPolicy(new PeriodicModeBackupPolicy() .withPeriodicModeProperties(new PeriodicModeProperties().withBackupIntervalInMinutes(240) .withBackupRetentionIntervalInHours(720) - .withBackupStorageRedundancy(BackupStorageRedundancy.LOCAL))) + .withBackupStorageRedundancy(BackupStorageRedundancy.GEO))) .withNetworkAclBypass(NetworkAclBypass.AZURE_SERVICES) .withNetworkAclBypassResourceIds(Arrays.asList( "/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName")) + .withDiagnosticLogSettings( + new DiagnosticLogSettings().withEnableFullTextQuery(EnableFullTextQuery.TRUE)) .withCapacity(new Capacity().withTotalThroughputLimit(2000)) + .withCapacityMode(CapacityMode.PROVISIONED) .withEnablePartitionMerge(true) .withEnableBurstCapacity(true) .withMinimalTlsVersion(MinimalTlsVersion.TLS) diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricDefinitionsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricDefinitionsSamples.java index 2ff7422718f9..b9c40abe63f7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricDefinitionsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricDefinitionsSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseListMetricDefinitionsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseGetMetricDefinitions.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseGetMetricDefinitions.json */ /** * Sample code: CosmosDBDatabaseGetMetricDefinitions. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricsSamples.java index dae570331dd7..d884c1f234fe 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricsSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseListMetricsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseGetMetrics.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseGetMetrics.json */ /** * Sample code: CosmosDBDatabaseGetMetrics. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListUsagesSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListUsagesSamples.java index c4996a89a283..490deb1e68e1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListUsagesSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListUsagesSamples.java @@ -9,7 +9,7 @@ */ public final class DatabaseListUsagesSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDatabaseGetUsages.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDatabaseGetUsages.json */ /** * Sample code: CosmosDBDatabaseGetUsages. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsCreateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsCreateSamples.java new file mode 100644 index 000000000000..e1a5644e0b71 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsCreateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.fluent.models.FleetAnalyticsResourceInner; +import com.azure.resourcemanager.cosmos.models.FleetAnalyticsPropertiesStorageLocationType; + +/** + * Samples for FleetAnalytics Create. + */ +public final class FleetAnalyticsCreateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetAnalyticsCreate.json + */ + /** + * Sample code: CosmosDB FleetAnalytics Create. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBFleetAnalyticsCreate(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getFleetAnalytics() + .createWithResponse("rg1", "fleet1", "storageAccount", new FleetAnalyticsResourceInner() + .withStorageLocationType(FleetAnalyticsPropertiesStorageLocationType.STORAGE_ACCOUNT) + .withStorageLocationUri( + "/subscriptions/d1eb41bc-1b7f-4404-bd2a-868c222852d/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/testStorageAccount1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsDeleteSamples.java new file mode 100644 index 000000000000..852bf287385c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for FleetAnalytics Delete. + */ +public final class FleetAnalyticsDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetAnalyticsDelete.json + */ + /** + * Sample code: CosmosDB FleetAnalytics Delete. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBFleetAnalyticsDelete(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getFleetAnalytics() + .delete("rg1", "fleet1", "storageAccount", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsGetSamples.java new file mode 100644 index 000000000000..e1d7e03e7d96 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for FleetAnalytics Get. + */ +public final class FleetAnalyticsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetAnalyticsGet.json + */ + /** + * Sample code: CosmosDB FleetAnalytics Get. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBFleetAnalyticsGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getFleetAnalytics() + .getWithResponse("rg1", "fleet1", "storageAccount", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsListSamples.java new file mode 100644 index 000000000000..c44bf1a962d5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for FleetAnalytics List. + */ +public final class FleetAnalyticsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetAnalyticsList.json + */ + /** + * Sample code: CosmosDB FleetAnalytics List. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBFleetAnalyticsList(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient().getFleetAnalytics().list("rg1", "fleet1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetCreateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetCreateSamples.java index 49a21cd10c84..64abbe59b400 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetCreateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetCreateSamples.java @@ -13,7 +13,7 @@ */ public final class FleetCreateSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetCreate.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetCreate.json */ /** * Sample code: CosmosDB Fleet Create. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetDeleteSamples.java index a1ac57224730..a85528dcf195 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetDeleteSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class FleetDeleteSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetDelete.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetDelete.json */ /** * Sample code: CosmosDB Fleet Delete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetGetByResourceGroupSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetGetByResourceGroupSamples.java index dd18f3d11c2e..fc4715841502 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetGetByResourceGroupSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class FleetGetByResourceGroupSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetGet.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetGet.json */ /** * Sample code: CosmosDB Fleet Get. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetListByResourceGroupSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetListByResourceGroupSamples.java index 6dca317b2fa4..5034c55809c8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetListByResourceGroupSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetListByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class FleetListByResourceGroupSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetList_ListByResourceGroup.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetList_ListByResourceGroup.json */ /** * Sample code: CosmosDB Fleet List by Resource Group. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetListSamples.java index 0af16f18b271..5cb087617db3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetListSamples.java @@ -9,7 +9,7 @@ */ public final class FleetListSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetList.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetList.json */ /** * Sample code: CosmosDB Fleet List by subscription. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetUpdateSamples.java index 31aeaa893a4f..5369e6dfecd4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetUpdateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetUpdateSamples.java @@ -11,7 +11,7 @@ */ public final class FleetUpdateSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetUpdate.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetUpdate.json */ /** * Sample code: CosmosDB Fleet Update. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountCreateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountCreateSamples.java index 2565e695e72e..ad245c481753 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountCreateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountCreateSamples.java @@ -12,7 +12,7 @@ */ public final class FleetspaceAccountCreateSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetspaceAccountCreate.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetspaceAccountCreate.json */ /** * Sample code: CosmosDB FleetspaceAccount Create. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountDeleteSamples.java index 9253c7c49348..b2669c4ed290 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountDeleteSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class FleetspaceAccountDeleteSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetspaceAccountDelete.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetspaceAccountDelete.json */ /** * Sample code: CosmosDB FleetspaceAccount Delete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountGetSamples.java index 2cf7311ffd31..f850eda31c75 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountGetSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountGetSamples.java @@ -9,7 +9,7 @@ */ public final class FleetspaceAccountGetSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetspaceAccountGet.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetspaceAccountGet.json */ /** * Sample code: CosmosDB FleetspaceAccount Get. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountListSamples.java index 2037ca1bd500..1e37283b8dff 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountListSamples.java @@ -9,7 +9,7 @@ */ public final class FleetspaceAccountListSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetspaceAccountList.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetspaceAccountList.json */ /** * Sample code: CosmosDB FleetspaceAccount List. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceCreateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceCreateSamples.java index 169fd480a04d..6ad3b78edae0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceCreateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceCreateSamples.java @@ -15,7 +15,7 @@ */ public final class FleetspaceCreateSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetspaceCreate.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetspaceCreate.json */ /** * Sample code: CosmosDB Fleetspace Create. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceDeleteSamples.java index 5eb531faec78..4bf8cce1a189 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceDeleteSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class FleetspaceDeleteSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetspaceDelete.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetspaceDelete.json */ /** * Sample code: CosmosDB Fleetspace Delete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceGetSamples.java index 827b74e6a002..2ad0faeeba57 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceGetSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceGetSamples.java @@ -9,7 +9,7 @@ */ public final class FleetspaceGetSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetspaceGet.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetspaceGet.json */ /** * Sample code: CosmosDB Fleetspace Get. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceListSamples.java index 833c1f7742a3..636904f19a28 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceListSamples.java @@ -9,7 +9,7 @@ */ public final class FleetspaceListSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetspaceList.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetspaceList.json */ /** * Sample code: CosmosDB Fleetspace List. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceUpdateSamples.java index bf2d029fdc21..7caf9d5e74e1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceUpdateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/FleetspaceUpdateSamples.java @@ -7,14 +7,13 @@ import com.azure.resourcemanager.cosmos.models.FleetspacePropertiesFleetspaceApiKind; import com.azure.resourcemanager.cosmos.models.FleetspacePropertiesThroughputPoolConfiguration; import com.azure.resourcemanager.cosmos.models.FleetspaceUpdate; -import java.util.Arrays; /** * Samples for Fleetspace Update. */ public final class FleetspaceUpdateSamples { /* - * x-ms-original-file: 2026-03-15/fleet/CosmosDBFleetspaceUpdate.json + * x-ms-original-file: 2026-04-01-preview/fleet/CosmosDBFleetspaceUpdate.json */ /** * Sample code: CosmosDB Fleetspace Update. @@ -26,10 +25,9 @@ public static void cosmosDBFleetspaceUpdate(com.azure.resourcemanager.cosmos.Cos .getFleetspaces() .update("rg1", "fleet1", "fleetspace1", new FleetspaceUpdate().withFleetspaceApiKind(FleetspacePropertiesFleetspaceApiKind.NO_SQL) - .withDataRegions(Arrays.asList("westus2")) .withThroughputPoolConfiguration( - new FleetspacePropertiesThroughputPoolConfiguration().withMinThroughput(3000) - .withMaxThroughput(4000)), + new FleetspacePropertiesThroughputPoolConfiguration().withMinThroughput(100000) + .withMaxThroughput(1000000)), com.azure.core.util.Context.NONE); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersCreateUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersCreateUpdateSamples.java new file mode 100644 index 000000000000..8082e97a2df8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersCreateUpdateSamples.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.fluent.models.GarnetClusterResourceInner; +import com.azure.resourcemanager.cosmos.models.GarnetAuthenticationType; +import com.azure.resourcemanager.cosmos.models.GarnetClusterResourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for GarnetClusters CreateUpdate. + */ +public final class GarnetClustersCreateUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBGarnetClusterCreate.json + */ + /** + * Sample code: CosmosDBGarnetClusterCreate. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBGarnetClusterCreate(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getGarnetClusters() + .createUpdate("garnet-prod-rg", "garnet-prod", new GarnetClusterResourceInner().withLocation("West US") + .withTags(mapOf()) + .withProperties(new GarnetClusterResourceProperties().withSubnetId( + "/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management") + .withReplicationFactor(2) + .withShardCount(4) + .withNodeSku("Standard_DS13_v2") + .withAuthenticationMethod(GarnetAuthenticationType.ENTRA) + .withPersistence(true)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersDeleteSamples.java new file mode 100644 index 000000000000..aab0ff3c9aaa --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for GarnetClusters Delete. + */ +public final class GarnetClustersDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBGarnetClusterDelete.json + */ + /** + * Sample code: CosmosDBGarnetClusterDelete. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBGarnetClusterDelete(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getGarnetClusters() + .delete("garnet-prod-rg", "garnet-prod", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersGetByResourceGroupSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..13075b2b7b56 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for GarnetClusters GetByResourceGroup. + */ +public final class GarnetClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBGarnetClusterGet.json + */ + /** + * Sample code: CosmosDBGarnetClusterGet. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBGarnetClusterGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getGarnetClusters() + .getByResourceGroupWithResponse("garnet-prod-rg", "garnet-prod", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersListByResourceGroupSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersListByResourceGroupSamples.java new file mode 100644 index 000000000000..9645132889ba --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for GarnetClusters ListByResourceGroup. + */ +public final class GarnetClustersListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBGarnetClusterListByResourceGroup.json + */ + /** + * Sample code: CosmosDBGarnetClusterListByResourceGroup. + * + * @param manager Entry point to CosmosManager. + */ + public static void + cosmosDBGarnetClusterListByResourceGroup(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getGarnetClusters() + .listByResourceGroup("garnet-prod-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersListSamples.java new file mode 100644 index 000000000000..7ecf1f0ee5d9 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for GarnetClusters List. + */ +public final class GarnetClustersListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBGarnetClusterListBySubscription.json + */ + /** + * Sample code: CosmosDBGarnetClusterListBySubscription. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBGarnetClusterListBySubscription(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient().getGarnetClusters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersUpdateSamples.java new file mode 100644 index 000000000000..b7cd983947da --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GarnetClustersUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.ClusterType; +import com.azure.resourcemanager.cosmos.models.GarnetAuthenticationType; +import com.azure.resourcemanager.cosmos.models.GarnetClusterResourcePatch; +import com.azure.resourcemanager.cosmos.models.GarnetClusterResourcePatchProperties; + +/** + * Samples for GarnetClusters Update. + */ +public final class GarnetClustersUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBGarnetClusterPatch.json + */ + /** + * Sample code: CosmosDBGarnetClusterPatch. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBGarnetClusterPatch(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getGarnetClusters() + .update("garnet-prod-rg", "garnet-prod", + new GarnetClusterResourcePatch() + .withProperties(new GarnetClusterResourcePatchProperties().withClusterType(ClusterType.PRODUCTION) + .withAuthenticationMethod(GarnetAuthenticationType.ENTRA) + .withPersistence(true)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesCreateUpdateGraphSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesCreateUpdateGraphSamples.java new file mode 100644 index 000000000000..71203d2df578 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesCreateUpdateGraphSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; +import com.azure.resourcemanager.cosmos.models.GraphResource; +import com.azure.resourcemanager.cosmos.models.GraphResourceCreateUpdateParameters; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for GraphResources CreateUpdateGraph. + */ +public final class GraphResourcesCreateUpdateGraphSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBGraphResourceCreateUpdate.json + */ + /** + * Sample code: CosmosDBGraphCreateUpdate. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBGraphCreateUpdate(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getGraphResources() + .createUpdateGraph("rg1", "ddb1", "graphName", + new GraphResourceCreateUpdateParameters().withLocation("West US") + .withTags(mapOf()) + .withResource(new GraphResource().withId("graphName")) + .withOptions(new CreateUpdateOptions()), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesDeleteGraphResourceSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesDeleteGraphResourceSamples.java new file mode 100644 index 000000000000..c8765f782781 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesDeleteGraphResourceSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for GraphResources DeleteGraphResource. + */ +public final class GraphResourcesDeleteGraphResourceSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBGraphResourceDelete.json + */ + /** + * Sample code: CosmosDBSqlDatabaseDelete. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSqlDatabaseDelete(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getGraphResources() + .deleteGraphResource("rg1", "ddb1", "graphName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesGetGraphSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesGetGraphSamples.java new file mode 100644 index 000000000000..497733f91d78 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesGetGraphSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for GraphResources GetGraph. + */ +public final class GraphResourcesGetGraphSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBGraphResourceGet.json + */ + /** + * Sample code: CosmosDBSqlDatabaseGet. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSqlDatabaseGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getGraphResources() + .getGraphWithResponse("rg1", "ddb1", "graphName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesListGraphsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesListGraphsSamples.java new file mode 100644 index 000000000000..690723959e65 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesListGraphsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for GraphResources ListGraphs. + */ +public final class GraphResourcesListGraphsSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBGraphResourceList.json + */ + /** + * Sample code: CosmosDBSqlDatabaseList. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSqlDatabaseList(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient().getGraphResources().listGraphs("rgName", "ddb1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinDatabaseSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinDatabaseSamples.java index b8c3e5ba86a6..50416a93ad78 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinDatabaseSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinDatabaseSamples.java @@ -15,7 +15,7 @@ */ public final class GremlinResourcesCreateUpdateGremlinDatabaseSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinDatabaseCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinDatabaseCreateUpdate.json */ /** * Sample code: CosmosDBGremlinDatabaseCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinGraphSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinGraphSamples.java index 0c4cc825b3cc..5efe8a134816 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinGraphSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinGraphSamples.java @@ -28,7 +28,7 @@ */ public final class GremlinResourcesCreateUpdateGremlinGraphSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinGraphCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinGraphCreateUpdate.json */ /** * Sample code: CosmosDBGremlinGraphCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinRoleAssignmentSamples.java index 20dc8767213c..37fb31a80654 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinRoleAssignmentSamples.java @@ -11,7 +11,7 @@ */ public final class GremlinResourcesCreateUpdateGremlinRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/gremlinrbac/CosmosDBGremlinRoleAssignmentCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/gremlinrbac/CosmosDBGremlinRoleAssignmentCreateUpdate.json */ /** * Sample code: CosmosDBGremlinRoleAssignmentCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinRoleDefinitionSamples.java index ba0333aa81f0..0bbf91ee30aa 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinRoleDefinitionSamples.java @@ -14,7 +14,7 @@ */ public final class GremlinResourcesCreateUpdateGremlinRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/gremlinrbac/CosmosDBGremlinRoleDefinitionCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/gremlinrbac/CosmosDBGremlinRoleDefinitionCreateUpdate.json */ /** * Sample code: CosmosDBGremlinRoleDefinitionCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinDatabaseSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinDatabaseSamples.java index 523b5db96fea..b684079f5058 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinDatabaseSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinDatabaseSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesDeleteGremlinDatabaseSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinDatabaseDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinDatabaseDelete.json */ /** * Sample code: CosmosDBGremlinDatabaseDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinGraphSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinGraphSamples.java index a39209b3941f..6eb087aab7c1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinGraphSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinGraphSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesDeleteGremlinGraphSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinGraphDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinGraphDelete.json */ /** * Sample code: CosmosDBGremlinGraphDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinRoleAssignmentSamples.java index 964f35ff9db9..1c53274d9b4d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinRoleAssignmentSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesDeleteGremlinRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/gremlinrbac/CosmosDBGremlinRoleAssignmentDelete.json + * x-ms-original-file: 2026-04-01-preview/gremlinrbac/CosmosDBGremlinRoleAssignmentDelete.json */ /** * Sample code: CosmosDBGremlinRoleAssignmentDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinRoleDefinitionSamples.java index 0c4f75aab0f8..9e0f464cd320 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinRoleDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesDeleteGremlinRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/gremlinrbac/CosmosDBGremlinRoleDefinitionDelete.json + * x-ms-original-file: 2026-04-01-preview/gremlinrbac/CosmosDBGremlinRoleDefinitionDelete.json */ /** * Sample code: CosmosDBGremlinRoleDefinitionDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseSamples.java index a68d9b50a9df..f54c5ba1ddc2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesGetGremlinDatabaseSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinDatabaseGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinDatabaseGet.json */ /** * Sample code: CosmosDBGremlinDatabaseGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseThroughputSamples.java index 4777a46c0608..9975614d9d4b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesGetGremlinDatabaseThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinDatabaseThroughputGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinDatabaseThroughputGet.json */ /** * Sample code: CosmosDBGremlinDatabaseThroughputGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphSamples.java index d03988044d06..a036254bd820 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesGetGremlinGraphSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinGraphGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinGraphGet.json */ /** * Sample code: CosmosDBGremlinGraphGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphThroughputSamples.java index 29913a4e461a..2ff6d747a86e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesGetGremlinGraphThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinGraphThroughputGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinGraphThroughputGet.json */ /** * Sample code: CosmosDBGremlinGraphThroughputGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinRoleAssignmentSamples.java index d73d6c2dbc0d..1cdeba542829 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinRoleAssignmentSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesGetGremlinRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/gremlinrbac/CosmosDBGremlinRoleAssignmentGet.json + * x-ms-original-file: 2026-04-01-preview/gremlinrbac/CosmosDBGremlinRoleAssignmentGet.json */ /** * Sample code: CosmosDBGremlinRoleAssignmentGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinRoleDefinitionSamples.java index ba321fa41e51..37ee9944795b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinRoleDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesGetGremlinRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/gremlinrbac/CosmosDBGremlinRoleDefinitionGet.json + * x-ms-original-file: 2026-04-01-preview/gremlinrbac/CosmosDBGremlinRoleDefinitionGet.json */ /** * Sample code: CosmosDBGremlinRoleDefinitionGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinDatabasesSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinDatabasesSamples.java index 7894935b7ebd..1caf30b7eaca 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinDatabasesSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinDatabasesSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesListGremlinDatabasesSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinDatabaseList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinDatabaseList.json */ /** * Sample code: CosmosDBGremlinDatabaseList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinGraphsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinGraphsSamples.java index 93d11c628923..b505acf62553 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinGraphsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinGraphsSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesListGremlinGraphsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinGraphList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinGraphList.json */ /** * Sample code: CosmosDBGremlinGraphList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinRoleAssignmentsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinRoleAssignmentsSamples.java index a219d923ace7..bfeac55a6c17 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinRoleAssignmentsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinRoleAssignmentsSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesListGremlinRoleAssignmentsSamples { /* - * x-ms-original-file: 2026-03-15/gremlinrbac/CosmosDBGremlinRoleAssignmentList.json + * x-ms-original-file: 2026-04-01-preview/gremlinrbac/CosmosDBGremlinRoleAssignmentList.json */ /** * Sample code: CosmosDBGremlinRoleAssignmentList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinRoleDefinitionsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinRoleDefinitionsSamples.java index 94e6bc36f467..d8d799fcb30f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinRoleDefinitionsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinRoleDefinitionsSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesListGremlinRoleDefinitionsSamples { /* - * x-ms-original-file: 2026-03-15/gremlinrbac/CosmosDBGremlinRoleDefinitionList.json + * x-ms-original-file: 2026-04-01-preview/gremlinrbac/CosmosDBGremlinRoleDefinitionList.json */ /** * Sample code: CosmosDBGremlinRoleDefinitionList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToAutoscaleSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToAutoscaleSamples.java index 96efc1069f2b..0a81ba5da35c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToAutoscaleSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToAutoscaleSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesMigrateGremlinDatabaseToAutoscaleSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinDatabaseMigrateToAutoscale.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinDatabaseMigrateToAutoscale.json */ /** * Sample code: CosmosDBGremlinDatabaseMigrateToAutoscale. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToManualThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToManualThroughputSamples.java index baad58bd622f..b8f3316ba409 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToManualThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToManualThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesMigrateGremlinDatabaseToManualThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinDatabaseMigrateToManualThroughput.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinDatabaseMigrateToManualThroughput.json */ /** * Sample code: CosmosDBGremlinDatabaseMigrateToManualThroughput. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToAutoscaleSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToAutoscaleSamples.java index 78d8e25f7c33..51617403e577 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToAutoscaleSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToAutoscaleSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesMigrateGremlinGraphToAutoscaleSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinGraphMigrateToAutoscale.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinGraphMigrateToAutoscale.json */ /** * Sample code: CosmosDBGremlinGraphMigrateToAutoscale. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToManualThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToManualThroughputSamples.java index c57a194a75ee..64377831f29b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToManualThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToManualThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class GremlinResourcesMigrateGremlinGraphToManualThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinGraphMigrateToManualThroughput.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinGraphMigrateToManualThroughput.json */ /** * Sample code: CosmosDBGremlinGraphMigrateToManualThroughput. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesRetrieveContinuousBackupInformationSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesRetrieveContinuousBackupInformationSamples.java index 4e9b44f16da8..57259d5daf13 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesRetrieveContinuousBackupInformationSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesRetrieveContinuousBackupInformationSamples.java @@ -11,7 +11,7 @@ */ public final class GremlinResourcesRetrieveContinuousBackupInformationSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinGraphBackupInformation.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinGraphBackupInformation.json */ /** * Sample code: CosmosDBGremlinGraphBackupInformation. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinDatabaseThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinDatabaseThroughputSamples.java index f03a41562b2d..d02256641871 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinDatabaseThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinDatabaseThroughputSamples.java @@ -14,7 +14,7 @@ */ public final class GremlinResourcesUpdateGremlinDatabaseThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinDatabaseThroughputUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinDatabaseThroughputUpdate.json */ /** * Sample code: CosmosDBGremlinDatabaseThroughputUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinGraphThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinGraphThroughputSamples.java index 358064ea776b..732f4a989cb6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinGraphThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinGraphThroughputSamples.java @@ -14,7 +14,7 @@ */ public final class GremlinResourcesUpdateGremlinGraphThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBGremlinGraphThroughputUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGremlinGraphThroughputUpdate.json */ /** * Sample code: CosmosDBGremlinGraphThroughputUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsGetSamples.java index 9037830e5325..c2ce92a2dd0a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsGetSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsGetSamples.java @@ -9,7 +9,7 @@ */ public final class LocationsGetSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBLocationGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBLocationGet.json */ /** * Sample code: CosmosDBLocationGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsListSamples.java index 96f984bafa1b..f16681fab4f2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsListSamples.java @@ -9,7 +9,7 @@ */ public final class LocationsListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBLocationList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBLocationList.json */ /** * Sample code: CosmosDBLocationList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBCollectionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBCollectionSamples.java index cb584da57ce6..a61143184d04 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBCollectionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBCollectionSamples.java @@ -4,12 +4,15 @@ package com.azure.resourcemanager.cosmos.generated; +import com.azure.resourcemanager.cosmos.models.CreateMode; import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; import com.azure.resourcemanager.cosmos.models.MongoDBCollectionCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.MongoDBCollectionResource; import com.azure.resourcemanager.cosmos.models.MongoIndex; import com.azure.resourcemanager.cosmos.models.MongoIndexKeys; import com.azure.resourcemanager.cosmos.models.MongoIndexOptions; +import com.azure.resourcemanager.cosmos.models.ResourceRestoreParameters; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -19,7 +22,31 @@ */ public final class MongoDBResourcesCreateUpdateMongoDBCollectionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBCollectionCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionRestore.json + */ + /** + * Sample code: CosmosDBMongoDBCollectionRestore. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBMongoDBCollectionRestore(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getMongoDBResources() + .createUpdateMongoDBCollection("rg1", "ddb1", "databaseName", "collectionName", + new MongoDBCollectionCreateUpdateParameters().withLocation("West US") + .withTags(mapOf()) + .withResource(new MongoDBCollectionResource().withId("collectionName") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource( + "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2022-07-20T18:28:00Z")) + .withRestoreWithTtlDisabled(false)) + .withCreateMode(CreateMode.RESTORE)) + .withOptions(new CreateUpdateOptions()), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionCreateUpdate.json */ /** * Sample code: CosmosDBMongoDBCollectionCreateUpdate. @@ -37,7 +64,8 @@ public static void cosmosDBMongoDBCollectionCreateUpdate(com.azure.resourcemanag .withIndexes(Arrays.asList( new MongoIndex().withKey(new MongoIndexKeys().withKeys(Arrays.asList("_ts"))) .withOptions(new MongoIndexOptions().withExpireAfterSeconds(100).withUnique(true)), - new MongoIndex().withKey(new MongoIndexKeys().withKeys(Arrays.asList("_id")))))) + new MongoIndex().withKey(new MongoIndexKeys().withKeys(Arrays.asList("_id"))))) + .withAnalyticalStorageTtl(500)) .withOptions(new CreateUpdateOptions()), com.azure.core.util.Context.NONE); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBDatabaseSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBDatabaseSamples.java index 9ecb5c82005c..a1c152d46890 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBDatabaseSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBDatabaseSamples.java @@ -4,9 +4,12 @@ package com.azure.resourcemanager.cosmos.generated; +import com.azure.resourcemanager.cosmos.models.CreateMode; import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; import com.azure.resourcemanager.cosmos.models.MongoDBDatabaseCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.MongoDBDatabaseResource; +import com.azure.resourcemanager.cosmos.models.ResourceRestoreParameters; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -15,7 +18,7 @@ */ public final class MongoDBResourcesCreateUpdateMongoDBDatabaseSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBDatabaseCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBDatabaseCreateUpdate.json */ /** * Sample code: CosmosDBMongoDBDatabaseCreateUpdate. @@ -33,6 +36,29 @@ public static void cosmosDBMongoDBDatabaseCreateUpdate(com.azure.resourcemanager com.azure.core.util.Context.NONE); } + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBDatabaseRestore.json + */ + /** + * Sample code: CosmosDBMongoDBDatabaseRestore. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBMongoDBDatabaseRestore(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getMongoDBResources() + .createUpdateMongoDBDatabase("rg1", "ddb1", "databaseName", new MongoDBDatabaseCreateUpdateParameters() + .withLocation("West US") + .withTags(mapOf()) + .withResource(new MongoDBDatabaseResource().withId("databaseName") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource( + "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2022-07-20T18:28:00Z")) + .withRestoreWithTtlDisabled(false)) + .withCreateMode(CreateMode.RESTORE)) + .withOptions(new CreateUpdateOptions()), com.azure.core.util.Context.NONE); + } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoRoleDefinitionSamples.java index 3639e8a8d8b1..bb8f8fc781b1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoRoleDefinitionSamples.java @@ -15,7 +15,7 @@ */ public final class MongoDBResourcesCreateUpdateMongoRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBRoleDefinitionCreateUpdate.json */ /** * Sample code: CosmosDBMongoDBRoleDefinitionCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoUserDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoUserDefinitionSamples.java index 014f061bc1a3..f727387dde2d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoUserDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoUserDefinitionSamples.java @@ -13,7 +13,7 @@ */ public final class MongoDBResourcesCreateUpdateMongoUserDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBUserDefinitionCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBUserDefinitionCreateUpdate.json */ /** * Sample code: CosmosDBMongoDBUserDefinitionCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBCollectionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBCollectionSamples.java index afa4dc38c065..21d606fefe31 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBCollectionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBCollectionSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesDeleteMongoDBCollectionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBCollectionDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionDelete.json */ /** * Sample code: CosmosDBMongoDBCollectionDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBDatabaseSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBDatabaseSamples.java index 264262b1b2ab..977c3dc3a05c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBDatabaseSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBDatabaseSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesDeleteMongoDBDatabaseSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBDatabaseDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBDatabaseDelete.json */ /** * Sample code: CosmosDBMongoDBDatabaseDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoRoleDefinitionSamples.java index b03edae8b9a4..313b8c89895f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoRoleDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesDeleteMongoRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBRoleDefinitionDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBRoleDefinitionDelete.json */ /** * Sample code: CosmosDBMongoDBRoleDefinitionDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoUserDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoUserDefinitionSamples.java index 325bfc0650f9..58b71177a47f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoUserDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoUserDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesDeleteMongoUserDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBUserDefinitionDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBUserDefinitionDelete.json */ /** * Sample code: CosmosDBMongoDBUserDefinitionDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionSamples.java index 38db5fe46efb..6f82a3c37fce 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesGetMongoDBCollectionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBCollectionGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionGet.json */ /** * Sample code: CosmosDBMongoDBCollectionGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionThroughputSamples.java index 5df1f7bf16b6..74a8dad9d6ab 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesGetMongoDBCollectionThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBCollectionThroughputGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionThroughputGet.json */ /** * Sample code: CosmosDBMongoDBCollectionThroughputGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseSamples.java index c6dfd0e16928..26b8472ede89 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesGetMongoDBDatabaseSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBDatabaseGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBDatabaseGet.json */ /** * Sample code: CosmosDBMongoDBDatabaseGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseThroughputSamples.java index 1cd335dba5a7..9ab71d494028 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesGetMongoDBDatabaseThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBDatabaseThroughputGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBDatabaseThroughputGet.json */ /** * Sample code: CosmosDBMongoDBDatabaseThroughputGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoRoleDefinitionSamples.java index a568cb63a2a8..a55068f08165 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoRoleDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesGetMongoRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBRoleDefinitionGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBRoleDefinitionGet.json */ /** * Sample code: CosmosDBMongoRoleDefinitionGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoUserDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoUserDefinitionSamples.java index 10ee003985b2..1f415293c413 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoUserDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoUserDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesGetMongoUserDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBUserDefinitionGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBUserDefinitionGet.json */ /** * Sample code: CosmosDBMongoDBUserDefinitionGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBCollectionPartitionMergeSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBCollectionPartitionMergeSamples.java new file mode 100644 index 000000000000..5a61951d734d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBCollectionPartitionMergeSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.MergeParameters; + +/** + * Samples for MongoDBResources ListMongoDBCollectionPartitionMerge. + */ +public final class MongoDBResourcesListMongoDBCollectionPartitionMergeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionPartitionMerge.json + */ + /** + * Sample code: CosmosDBMongoDBCollectionPartitionMerge. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBMongoDBCollectionPartitionMerge(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getMongoDBResources() + .listMongoDBCollectionPartitionMerge("rgName", "ddb1", "databaseName", "collectionName", + new MergeParameters().withIsDryRun(false), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBCollectionsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBCollectionsSamples.java index 8bf57caf42f9..2ca93e395515 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBCollectionsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBCollectionsSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesListMongoDBCollectionsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBCollectionList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionList.json */ /** * Sample code: CosmosDBMongoDBCollectionList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBDatabasesSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBDatabasesSamples.java index 0eaab9a9b25a..b6be4cf38a8a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBDatabasesSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBDatabasesSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesListMongoDBDatabasesSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBDatabaseList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBDatabaseList.json */ /** * Sample code: CosmosDBMongoDBDatabaseList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoRoleDefinitionsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoRoleDefinitionsSamples.java index 9530b2ec40c1..bf3018d19287 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoRoleDefinitionsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoRoleDefinitionsSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesListMongoRoleDefinitionsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBRoleDefinitionList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBRoleDefinitionList.json */ /** * Sample code: CosmosDBMongoDBRoleDefinitionList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoUserDefinitionsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoUserDefinitionsSamples.java index 86f431764961..66060c7ebd71 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoUserDefinitionsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoUserDefinitionsSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesListMongoUserDefinitionsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBUserDefinitionList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBUserDefinitionList.json */ /** * Sample code: CosmosDBMongoDBUserDefinitionList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToAutoscaleSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToAutoscaleSamples.java index ebb7e020f4e0..7519a9da15cd 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToAutoscaleSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToAutoscaleSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesMigrateMongoDBCollectionToAutoscaleSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBCollectionMigrateToAutoscale.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionMigrateToAutoscale.json */ /** * Sample code: CosmosDBMongoDBCollectionMigrateToAutoscale. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToManualThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToManualThroughputSamples.java index 23c6f7ee91b0..9d4173255c77 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToManualThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToManualThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesMigrateMongoDBCollectionToManualThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBCollectionMigrateToManualThroughput.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionMigrateToManualThroughput.json */ /** * Sample code: CosmosDBMongoDBCollectionMigrateToManualThroughput. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleSamples.java index 38f7bc436b08..96013a06b383 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBDatabaseMigrateToAutoscale.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBDatabaseMigrateToAutoscale.json */ /** * Sample code: CosmosDBMongoDBDatabaseMigrateToAutoscale. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputSamples.java index e994f8774540..154c6bf26c8c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json */ /** * Sample code: CosmosDBMongoDBDatabaseMigrateToManualThroughput. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBContainerRedistributeThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBContainerRedistributeThroughputSamples.java new file mode 100644 index 000000000000..d84b835c4cc1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBContainerRedistributeThroughputSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoResource; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputPropertiesResource; +import com.azure.resourcemanager.cosmos.models.ThroughputPolicyType; +import java.util.Arrays; + +/** + * Samples for MongoDBResources MongoDBContainerRedistributeThroughput. + */ +public final class MongoDBResourcesMongoDBContainerRedistributeThroughputSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionRedistributeThroughput.json + */ + /** + * Sample code: CosmosDBMongoDBCollectionRedistributeThroughput. + * + * @param manager Entry point to CosmosManager. + */ + public static void + cosmosDBMongoDBCollectionRedistributeThroughput(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getMongoDBResources() + .mongoDBContainerRedistributeThroughput("rg1", "ddb1", "databaseName", "collectionName", + new RedistributeThroughputParameters().withResource(new RedistributeThroughputPropertiesResource() + .withThroughputPolicy(ThroughputPolicyType.CUSTOM) + .withTargetPhysicalPartitionThroughputInfo( + Arrays.asList(new PhysicalPartitionThroughputInfoResource().withId("0").withThroughput(5000.0D), + new PhysicalPartitionThroughputInfoResource().withId("1").withThroughput(5000.0D))) + .withSourcePhysicalPartitionThroughputInfo( + Arrays.asList(new PhysicalPartitionThroughputInfoResource().withId("2").withThroughput(5000.0D), + new PhysicalPartitionThroughputInfoResource().withId("3")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionSamples.java new file mode 100644 index 000000000000..a706b21a194b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionId; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputPropertiesResource; +import java.util.Arrays; + +/** + * Samples for MongoDBResources MongoDBContainerRetrieveThroughputDistribution. + */ +public final class MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json + */ + /** + * Sample code: CosmosDBMongoDBCollectionRetrieveThroughputDistribution. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBMongoDBCollectionRetrieveThroughputDistribution( + com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getMongoDBResources() + .mongoDBContainerRetrieveThroughputDistribution("rg1", "ddb1", "databaseName", "collectionName", + new RetrieveThroughputParameters() + .withResource(new RetrieveThroughputPropertiesResource().withPhysicalPartitionIds( + Arrays.asList(new PhysicalPartitionId().withId("0"), new PhysicalPartitionId().withId("1")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBDatabasePartitionMergeSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBDatabasePartitionMergeSamples.java new file mode 100644 index 000000000000..8655475c1075 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBDatabasePartitionMergeSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.MergeParameters; + +/** + * Samples for MongoDBResources MongoDBDatabasePartitionMerge. + */ +public final class MongoDBResourcesMongoDBDatabasePartitionMergeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBDatabasePartitionMerge.json + */ + /** + * Sample code: CosmosDBMongoDBDatabasePartitionMerge. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBMongoDBDatabasePartitionMerge(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getMongoDBResources() + .mongoDBDatabasePartitionMerge("rgName", "ddb1", "databaseName", new MergeParameters().withIsDryRun(false), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBDatabaseRedistributeThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBDatabaseRedistributeThroughputSamples.java new file mode 100644 index 000000000000..191cfe9d6ed1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBDatabaseRedistributeThroughputSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoResource; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputPropertiesResource; +import com.azure.resourcemanager.cosmos.models.ThroughputPolicyType; +import java.util.Arrays; + +/** + * Samples for MongoDBResources MongoDBDatabaseRedistributeThroughput. + */ +public final class MongoDBResourcesMongoDBDatabaseRedistributeThroughputSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBDatabaseRedistributeThroughput.json + */ + /** + * Sample code: CosmosDBMongoDBDatabaseRedistributeThroughput. + * + * @param manager Entry point to CosmosManager. + */ + public static void + cosmosDBMongoDBDatabaseRedistributeThroughput(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getMongoDBResources() + .mongoDBDatabaseRedistributeThroughput("rg1", "ddb1", "databaseName", + new RedistributeThroughputParameters().withResource(new RedistributeThroughputPropertiesResource() + .withThroughputPolicy(ThroughputPolicyType.CUSTOM) + .withTargetPhysicalPartitionThroughputInfo( + Arrays.asList(new PhysicalPartitionThroughputInfoResource().withId("0").withThroughput(5000.0D), + new PhysicalPartitionThroughputInfoResource().withId("1").withThroughput(5000.0D))) + .withSourcePhysicalPartitionThroughputInfo( + Arrays.asList(new PhysicalPartitionThroughputInfoResource().withId("2").withThroughput(5000.0D), + new PhysicalPartitionThroughputInfoResource().withId("3")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionSamples.java new file mode 100644 index 000000000000..a2a3a3039ef0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionId; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputPropertiesResource; +import java.util.Arrays; + +/** + * Samples for MongoDBResources MongoDBDatabaseRetrieveThroughputDistribution. + */ +public final class MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json + */ + /** + * Sample code: CosmosDBMongoDBDatabaseRetrieveThroughputDistribution. + * + * @param manager Entry point to CosmosManager. + */ + public static void + cosmosDBMongoDBDatabaseRetrieveThroughputDistribution(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getMongoDBResources() + .mongoDBDatabaseRetrieveThroughputDistribution("rg1", "ddb1", "databaseName", + new RetrieveThroughputParameters() + .withResource(new RetrieveThroughputPropertiesResource().withPhysicalPartitionIds( + Arrays.asList(new PhysicalPartitionId().withId("0"), new PhysicalPartitionId().withId("1")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesRetrieveContinuousBackupInformationSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesRetrieveContinuousBackupInformationSamples.java index bd3332fe0485..7cce0cfd8b99 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesRetrieveContinuousBackupInformationSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesRetrieveContinuousBackupInformationSamples.java @@ -11,7 +11,7 @@ */ public final class MongoDBResourcesRetrieveContinuousBackupInformationSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBCollectionBackupInformation.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionBackupInformation.json */ /** * Sample code: CosmosDBMongoDBCollectionBackupInformation. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBCollectionThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBCollectionThroughputSamples.java index cfa559ff9dc8..4747b101de01 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBCollectionThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBCollectionThroughputSamples.java @@ -14,7 +14,7 @@ */ public final class MongoDBResourcesUpdateMongoDBCollectionThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBCollectionThroughputUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBCollectionThroughputUpdate.json */ /** * Sample code: CosmosDBMongoDBCollectionThroughputUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBDatabaseThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBDatabaseThroughputSamples.java index 48660ba551df..b4499e04b2f8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBDatabaseThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBDatabaseThroughputSamples.java @@ -14,7 +14,7 @@ */ public final class MongoDBResourcesUpdateMongoDBDatabaseThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBMongoDBDatabaseThroughputUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMongoDBDatabaseThroughputUpdate.json */ /** * Sample code: CosmosDBMongoDBDatabaseThroughputUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesCreateUpdateMongoMIRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesCreateUpdateMongoMIRoleAssignmentSamples.java index 70147306f2a4..56ab43273641 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesCreateUpdateMongoMIRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesCreateUpdateMongoMIRoleAssignmentSamples.java @@ -11,7 +11,7 @@ */ public final class MongoMIResourcesCreateUpdateMongoMIRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/mongoMIrbac/CosmosDBMongoMIRoleAssignmentCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/mongoMIrbac/CosmosDBMongoMIRoleAssignmentCreateUpdate.json */ /** * Sample code: CosmosDBMongoMIRoleAssignmentCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesCreateUpdateMongoMIRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesCreateUpdateMongoMIRoleDefinitionSamples.java index 4bb3328243d1..5d68b2a367fc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesCreateUpdateMongoMIRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesCreateUpdateMongoMIRoleDefinitionSamples.java @@ -14,7 +14,7 @@ */ public final class MongoMIResourcesCreateUpdateMongoMIRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/mongoMIrbac/CosmosDBMongoMIRoleDefinitionCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/mongoMIrbac/CosmosDBMongoMIRoleDefinitionCreateUpdate.json */ /** * Sample code: CosmosDBMongoMIRoleDefinitionCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesDeleteMongoMIRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesDeleteMongoMIRoleAssignmentSamples.java index f8e30d591e1d..5cbaadeaba49 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesDeleteMongoMIRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesDeleteMongoMIRoleAssignmentSamples.java @@ -9,7 +9,7 @@ */ public final class MongoMIResourcesDeleteMongoMIRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/mongoMIrbac/CosmosDBMongoMIRoleAssignmentDelete.json + * x-ms-original-file: 2026-04-01-preview/mongoMIrbac/CosmosDBMongoMIRoleAssignmentDelete.json */ /** * Sample code: CosmosDBMongoMIRoleAssignmentDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesDeleteMongoMIRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesDeleteMongoMIRoleDefinitionSamples.java index ffce862d46d8..6c5998546176 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesDeleteMongoMIRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesDeleteMongoMIRoleDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class MongoMIResourcesDeleteMongoMIRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/mongoMIrbac/CosmosDBMongoMIRoleDefinitionDelete.json + * x-ms-original-file: 2026-04-01-preview/mongoMIrbac/CosmosDBMongoMIRoleDefinitionDelete.json */ /** * Sample code: CosmosDBMongoMIRoleDefinitionDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesGetMongoMIRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesGetMongoMIRoleAssignmentSamples.java index 4335c3ce23cc..f427ed9e9cc3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesGetMongoMIRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesGetMongoMIRoleAssignmentSamples.java @@ -9,7 +9,7 @@ */ public final class MongoMIResourcesGetMongoMIRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/mongoMIrbac/CosmosDBMongoMIRoleAssignmentGet.json + * x-ms-original-file: 2026-04-01-preview/mongoMIrbac/CosmosDBMongoMIRoleAssignmentGet.json */ /** * Sample code: CosmosDBMongoMIRoleAssignmentGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesGetMongoMIRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesGetMongoMIRoleDefinitionSamples.java index 532674d6346a..00c7b98f9296 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesGetMongoMIRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesGetMongoMIRoleDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class MongoMIResourcesGetMongoMIRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/mongoMIrbac/CosmosDBMongoMIRoleDefinitionGet.json + * x-ms-original-file: 2026-04-01-preview/mongoMIrbac/CosmosDBMongoMIRoleDefinitionGet.json */ /** * Sample code: CosmosDBMongoMIRoleDefinitionGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesListMongoMIRoleAssignmentsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesListMongoMIRoleAssignmentsSamples.java index 0ac898404516..0e124fbfed35 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesListMongoMIRoleAssignmentsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesListMongoMIRoleAssignmentsSamples.java @@ -9,7 +9,7 @@ */ public final class MongoMIResourcesListMongoMIRoleAssignmentsSamples { /* - * x-ms-original-file: 2026-03-15/mongoMIrbac/CosmosDBMongoMIRoleAssignmentList.json + * x-ms-original-file: 2026-04-01-preview/mongoMIrbac/CosmosDBMongoMIRoleAssignmentList.json */ /** * Sample code: CosmosDBMongoMIRoleAssignmentList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesListMongoMIRoleDefinitionsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesListMongoMIRoleDefinitionsSamples.java index 34c33af01f2c..9bc6c113360f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesListMongoMIRoleDefinitionsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoMIResourcesListMongoMIRoleDefinitionsSamples.java @@ -9,7 +9,7 @@ */ public final class MongoMIResourcesListMongoMIRoleDefinitionsSamples { /* - * x-ms-original-file: 2026-03-15/mongoMIrbac/CosmosDBMongoMIRoleDefinitionList.json + * x-ms-original-file: 2026-04-01-preview/mongoMIrbac/CosmosDBMongoMIRoleDefinitionList.json */ /** * Sample code: CosmosDBMongoMIRoleDefinitionList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java new file mode 100644 index 000000000000..b83c27495842 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for NetworkSecurityPerimeterConfigurations Get. + */ +public final class NetworkSecurityPerimeterConfigurationsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/NetworkSecurityPerimeterConfigurationGet.json + */ + /** + * Sample code: NamspaceNetworkSecurityPerimeterConfigurationList. + * + * @param manager Entry point to CosmosManager. + */ + public static void + namspaceNetworkSecurityPerimeterConfigurationList(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getNetworkSecurityPerimeterConfigurations() + .getWithResponse("res4410", "cosmosTest", "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationsListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationsListSamples.java new file mode 100644 index 000000000000..a23ad7670adc --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for NetworkSecurityPerimeterConfigurations List. + */ +public final class NetworkSecurityPerimeterConfigurationsListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/NetworkSecurityPerimeterConfigurationList.json + */ + /** + * Sample code: NamspaceNetworkSecurityPerimeterConfigurationList. + * + * @param manager Entry point to CosmosManager. + */ + public static void + namspaceNetworkSecurityPerimeterConfigurationList(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getNetworkSecurityPerimeterConfigurations() + .list("res4410", "cosmosTest", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java new file mode 100644 index 000000000000..174256c37f04 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for NetworkSecurityPerimeterConfigurations Reconcile. + */ +public final class NetworkSecurityPerimeterConfigurationsReconcileSamples { + /* + * x-ms-original-file: 2026-04-01-preview/NetworkSecurityPerimeterConfigurationReconcile.json + */ + /** + * Sample code: NetworkSecurityPerimeterConfigurationList. + * + * @param manager Entry point to CosmosManager. + */ + public static void + networkSecurityPerimeterConfigurationList(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getNetworkSecurityPerimeterConfigurations() + .reconcile("res4410", "sto8607", "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesCreateOrUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesCreateOrUpdateSamples.java index bb2d7c42f4c7..17a291f53f01 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesCreateOrUpdateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ */ public final class NotebookWorkspacesCreateOrUpdateSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBNotebookWorkspaceCreate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBNotebookWorkspaceCreate.json */ /** * Sample code: CosmosDBNotebookWorkspaceCreate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesDeleteSamples.java index 8384b0cb6d37..358920f861f8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesDeleteSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesDeleteSamples.java @@ -11,7 +11,7 @@ */ public final class NotebookWorkspacesDeleteSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBNotebookWorkspaceDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBNotebookWorkspaceDelete.json */ /** * Sample code: CosmosDBNotebookWorkspaceDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesGetSamples.java index 6483258e9de8..3ac147d2e174 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesGetSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesGetSamples.java @@ -11,7 +11,7 @@ */ public final class NotebookWorkspacesGetSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBNotebookWorkspaceGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBNotebookWorkspaceGet.json */ /** * Sample code: CosmosDBNotebookWorkspaceGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListByDatabaseAccountSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListByDatabaseAccountSamples.java index a23bc56ef704..37ef43ef4f30 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListByDatabaseAccountSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListByDatabaseAccountSamples.java @@ -9,7 +9,7 @@ */ public final class NotebookWorkspacesListByDatabaseAccountSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBNotebookWorkspaceList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBNotebookWorkspaceList.json */ /** * Sample code: CosmosDBNotebookWorkspaceList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListConnectionInfoSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListConnectionInfoSamples.java index 514ee2c482a1..c757a032ae39 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListConnectionInfoSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListConnectionInfoSamples.java @@ -11,7 +11,7 @@ */ public final class NotebookWorkspacesListConnectionInfoSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBNotebookWorkspaceListConnectionInfo.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBNotebookWorkspaceListConnectionInfo.json */ /** * Sample code: CosmosDBNotebookWorkspaceListConnectionInfo. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesRegenerateAuthTokenSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesRegenerateAuthTokenSamples.java index 32df4393ff1e..a0995f26b65a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesRegenerateAuthTokenSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesRegenerateAuthTokenSamples.java @@ -11,7 +11,7 @@ */ public final class NotebookWorkspacesRegenerateAuthTokenSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBNotebookWorkspaceRegenerateAuthToken.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBNotebookWorkspaceRegenerateAuthToken.json */ /** * Sample code: CosmosDBNotebookWorkspaceRegenerateAuthToken. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesStartSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesStartSamples.java index 7d3f43085bce..24946b3ebb49 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesStartSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesStartSamples.java @@ -11,7 +11,7 @@ */ public final class NotebookWorkspacesStartSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBNotebookWorkspaceStart.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBNotebookWorkspaceStart.json */ /** * Sample code: CosmosDBNotebookWorkspaceStart. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/OperationsListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/OperationsListSamples.java index 84fe1d5d68aa..c6c57545bf2d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/OperationsListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBOperationsList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBOperationsList.json */ /** * Sample code: CosmosDBOperationsList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdListMetricsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdListMetricsSamples.java index 7550022380f9..bb9ecc64f8bb 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdListMetricsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdListMetricsSamples.java @@ -9,7 +9,7 @@ */ public final class PartitionKeyRangeIdListMetricsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBPKeyRangeIdGetMetrics.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBPKeyRangeIdGetMetrics.json */ /** * Sample code: CosmosDBDatabaseAccountRegionGetMetrics. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdRegionListMetricsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdRegionListMetricsSamples.java index d777ec74f5c5..1cb07461779d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdRegionListMetricsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdRegionListMetricsSamples.java @@ -9,7 +9,7 @@ */ public final class PartitionKeyRangeIdRegionListMetricsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBPKeyRangeIdRegionGetMetrics.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBPKeyRangeIdRegionGetMetrics.json */ /** * Sample code: CosmosDBDatabaseAccountRegionGetMetrics. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileListMetricsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileListMetricsSamples.java index b735fd5642d5..1136fa5717cc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileListMetricsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileListMetricsSamples.java @@ -9,7 +9,7 @@ */ public final class PercentileListMetricsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBPercentileGetMetrics.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBPercentileGetMetrics.json */ /** * Sample code: CosmosDBDatabaseAccountRegionGetMetrics. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileSourceTargetListMetricsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileSourceTargetListMetricsSamples.java index 2d5d08b64a45..60c90f45d474 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileSourceTargetListMetricsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileSourceTargetListMetricsSamples.java @@ -9,7 +9,7 @@ */ public final class PercentileSourceTargetListMetricsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBPercentileSourceTargetGetMetrics.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBPercentileSourceTargetGetMetrics.json */ /** * Sample code: CosmosDBDatabaseAccountRegionGetMetrics. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileTargetListMetricsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileTargetListMetricsSamples.java index 804e1a788ccf..d6f0d4184f65 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileTargetListMetricsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileTargetListMetricsSamples.java @@ -9,7 +9,7 @@ */ public final class PercentileTargetListMetricsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBPercentileTargetGetMetrics.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBPercentileTargetGetMetrics.json */ /** * Sample code: CosmosDBDatabaseAccountRegionGetMetrics. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java index 4146e230957c..23e1b23e9135 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBPrivateEndpointConnectionUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBPrivateEndpointConnectionUpdate.json */ /** * Sample code: Approve or reject a private endpoint connection with a given name. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsDeleteSamples.java index bdba382183c6..ddd1ccfdf275 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBPrivateEndpointConnectionDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBPrivateEndpointConnectionDelete.json */ /** * Sample code: Deletes a private endpoint connection with a given name. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsGetSamples.java index 11dd99f25b75..b660d5f15ca1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsGetSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBPrivateEndpointConnectionGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBPrivateEndpointConnectionGet.json */ /** * Sample code: Gets private endpoint connection. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsListByDatabaseAccountSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsListByDatabaseAccountSamples.java index ee2de2616a8e..103ee382ef6a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsListByDatabaseAccountSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsListByDatabaseAccountSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateEndpointConnectionsListByDatabaseAccountSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBPrivateEndpointConnectionListGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBPrivateEndpointConnectionListGet.json */ /** * Sample code: Gets private endpoint connection. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesGetSamples.java index 8a4c9f861c17..de276b44cefb 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesGetSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesGetSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBPrivateLinkResourceGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBPrivateLinkResourceGet.json */ /** * Sample code: Gets private endpoint connection. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesListByDatabaseAccountSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesListByDatabaseAccountSamples.java index b7fa7045ffb6..06756cbef953 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesListByDatabaseAccountSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesListByDatabaseAccountSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateLinkResourcesListByDatabaseAccountSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBPrivateLinkResourceListGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBPrivateLinkResourceListGet.json */ /** * Sample code: Gets private endpoint connection. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsGetByLocationSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsGetByLocationSamples.java index 6e258a9e3bbe..610d01fe250a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsGetByLocationSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsGetByLocationSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableDatabaseAccountsGetByLocationSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableDatabaseAccountGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableDatabaseAccountGet.json */ /** * Sample code: CosmosDBRestorableDatabaseAccountGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListByLocationSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListByLocationSamples.java index 12ca4e4f4b1e..905a2d521697 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListByLocationSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListByLocationSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableDatabaseAccountsListByLocationSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableDatabaseAccountList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableDatabaseAccountList.json */ /** * Sample code: CosmosDBRestorableDatabaseAccountList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListSamples.java index c72fd1f3fb34..0e47da8513b8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableDatabaseAccountsListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableDatabaseAccountNoLocationList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableDatabaseAccountNoLocationList.json */ /** * Sample code: CosmosDBRestorableDatabaseAccountNoLocationList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasesListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasesListSamples.java index e4256730821a..21e51d8b59aa 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasesListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasesListSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableGremlinDatabasesListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableGremlinDatabaseList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableGremlinDatabaseList.json */ /** * Sample code: CosmosDBRestorableGremlinDatabaseList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphsListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphsListSamples.java index 97bc2cada814..d36b209b8845 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphsListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphsListSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableGremlinGraphsListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableGremlinGraphList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableGremlinGraphList.json */ /** * Sample code: CosmosDBRestorableGremlinGraphList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinResourcesListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinResourcesListSamples.java index 2f75582e756e..8be0be3efd36 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinResourcesListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinResourcesListSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableGremlinResourcesListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableGremlinResourceList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableGremlinResourceList.json */ /** * Sample code: CosmosDBRestorableGremlinResourceList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionsListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionsListSamples.java index bcfc14f03c53..8b7c40327f27 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionsListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionsListSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableMongodbCollectionsListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableMongodbCollectionList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableMongodbCollectionList.json */ /** * Sample code: CosmosDBRestorableMongodbCollectionList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasesListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasesListSamples.java index 1fae81bb2091..3a7fd26cf17a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasesListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasesListSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableMongodbDatabasesListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableMongodbDatabaseList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableMongodbDatabaseList.json */ /** * Sample code: CosmosDBRestorableMongodbDatabaseList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesListSamples.java index 1328c15cd281..3a45855f4e31 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesListSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableMongodbResourcesListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableMongodbResourceList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableMongodbResourceList.json */ /** * Sample code: CosmosDBRestorableMongodbResourceList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlContainersListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlContainersListSamples.java index 49f6e1a6219f..9100284cae8a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlContainersListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlContainersListSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableSqlContainersListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableSqlContainerList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableSqlContainerList.json */ /** * Sample code: CosmosDBRestorableSqlContainerList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasesListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasesListSamples.java index e0cdb3b3d997..3a13d197fc1c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasesListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasesListSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableSqlDatabasesListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableSqlDatabaseList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableSqlDatabaseList.json */ /** * Sample code: CosmosDBRestorableSqlDatabaseList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesListSamples.java index ff665753c473..01e3f2d49b0e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesListSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableSqlResourcesListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableSqlResourceList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableSqlResourceList.json */ /** * Sample code: CosmosDBRestorableSqlResourceList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableTableResourcesListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableTableResourcesListSamples.java index 9432d18739c4..ca364e39452e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableTableResourcesListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableTableResourcesListSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableTableResourcesListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableTableResourceList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableTableResourceList.json */ /** * Sample code: CosmosDBRestorableTableResourceList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableTablesListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableTablesListSamples.java index 3a3637899938..896cfff2147e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableTablesListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableTablesListSamples.java @@ -9,7 +9,7 @@ */ public final class RestorableTablesListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBRestorableTableList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBRestorableTableList.json */ /** * Sample code: CosmosDBRestorableTableList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceCreateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceCreateSamples.java index 971eba1d4126..47557973a24d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceCreateSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceCreateSamples.java @@ -17,7 +17,7 @@ */ public final class ServiceCreateSamples { /* - * x-ms-original-file: 2026-03-15/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + * x-ms-original-file: 2026-04-01-preview/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json */ /** * Sample code: SqlDedicatedGatewayServiceCreate. @@ -35,7 +35,7 @@ public static void sqlDedicatedGatewayServiceCreate(com.azure.resourcemanager.co } /* - * x-ms-original-file: 2026-03-15/CosmosDBDataTransferServiceCreate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDataTransferServiceCreate.json */ /** * Sample code: DataTransferServiceCreate. @@ -53,7 +53,7 @@ public static void dataTransferServiceCreate(com.azure.resourcemanager.cosmos.Co } /* - * x-ms-original-file: 2026-03-15/CosmosDBMaterializedViewsBuilderServiceCreate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMaterializedViewsBuilderServiceCreate.json */ /** * Sample code: MaterializedViewsBuilderServiceCreate. @@ -72,7 +72,7 @@ public static void materializedViewsBuilderServiceCreate(com.azure.resourcemanag } /* - * x-ms-original-file: 2026-03-15/CosmosDBGraphAPIComputeServiceCreate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGraphAPIComputeServiceCreate.json */ /** * Sample code: GraphAPIComputeServiceCreate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceDeleteSamples.java index 13d3120d0845..47d337547466 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceDeleteSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class ServiceDeleteSamples { /* - * x-ms-original-file: 2026-03-15/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json + * x-ms-original-file: 2026-04-01-preview/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json */ /** * Sample code: SqlDedicatedGatewayServiceDelete. @@ -23,7 +23,7 @@ public static void sqlDedicatedGatewayServiceDelete(com.azure.resourcemanager.co } /* - * x-ms-original-file: 2026-03-15/CosmosDBMaterializedViewsBuilderServiceDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMaterializedViewsBuilderServiceDelete.json */ /** * Sample code: MaterializedViewsBuilderServiceDelete. @@ -37,7 +37,7 @@ public static void materializedViewsBuilderServiceDelete(com.azure.resourcemanag } /* - * x-ms-original-file: 2026-03-15/CosmosDBDataTransferServiceDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDataTransferServiceDelete.json */ /** * Sample code: DataTransferServiceDelete. @@ -49,7 +49,7 @@ public static void dataTransferServiceDelete(com.azure.resourcemanager.cosmos.Co } /* - * x-ms-original-file: 2026-03-15/CosmosDBGraphAPIComputeServiceDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGraphAPIComputeServiceDelete.json */ /** * Sample code: GraphAPIComputeServiceDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceGetSamples.java index d95e96881922..dd7990392514 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceGetSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceGetSamples.java @@ -9,7 +9,7 @@ */ public final class ServiceGetSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBDataTransferServiceGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBDataTransferServiceGet.json */ /** * Sample code: DataTransferServiceGet. @@ -23,7 +23,7 @@ public static void dataTransferServiceGet(com.azure.resourcemanager.cosmos.Cosmo } /* - * x-ms-original-file: 2026-03-15/CosmosDBGraphAPIComputeServiceGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBGraphAPIComputeServiceGet.json */ /** * Sample code: GraphAPIComputeServiceGet. @@ -37,7 +37,7 @@ public static void graphAPIComputeServiceGet(com.azure.resourcemanager.cosmos.Co } /* - * x-ms-original-file: 2026-03-15/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + * x-ms-original-file: 2026-04-01-preview/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json */ /** * Sample code: SqlDedicatedGatewayServiceGet. @@ -51,7 +51,7 @@ public static void sqlDedicatedGatewayServiceGet(com.azure.resourcemanager.cosmo } /* - * x-ms-original-file: 2026-03-15/CosmosDBMaterializedViewsBuilderServiceGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBMaterializedViewsBuilderServiceGet.json */ /** * Sample code: MaterializedViewsBuilderServiceGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceListSamples.java index 6afb29a73b70..6b191e913439 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceListSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ServiceListSamples.java @@ -9,7 +9,7 @@ */ public final class ServiceListSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBServicesList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBServicesList.json */ /** * Sample code: CosmosDBServicesList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsGetSamples.java new file mode 100644 index 000000000000..0d8ef295293c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedDatabaseAccounts Get. + */ +public final class SoftDeletedDatabaseAccountsGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedDatabaseAccountGet.json + */ + /** + * Sample code: CosmosDBSoftDeletedDatabaseAccountGet. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSoftDeletedDatabaseAccountGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedDatabaseAccounts() + .getWithResponse("rg1", "West US", "softdeleted-cosmosdb-1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsListByLocationSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsListByLocationSamples.java new file mode 100644 index 000000000000..4f0e055fb3b4 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsListByLocationSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedDatabaseAccounts ListByLocation. + */ +public final class SoftDeletedDatabaseAccountsListByLocationSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedDatabaseAccountListByLocation.json + */ + /** + * Sample code: CosmosDBSoftDeletedDatabaseAccountListByLocation. + * + * @param manager Entry point to CosmosManager. + */ + public static void + cosmosDBSoftDeletedDatabaseAccountListByLocation(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedDatabaseAccounts() + .listByLocationWithResponse("West US", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsListByResourceGroupAndLocationSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsListByResourceGroupAndLocationSamples.java new file mode 100644 index 000000000000..85007e348114 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsListByResourceGroupAndLocationSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedDatabaseAccounts ListByResourceGroupAndLocation. + */ +public final class SoftDeletedDatabaseAccountsListByResourceGroupAndLocationSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedDatabaseAccountListByResourceGroupAndLocation.json + */ + /** + * Sample code: CosmosDBSoftDeletedDatabaseAccountListByResourceGroupAndLocation. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSoftDeletedDatabaseAccountListByResourceGroupAndLocation( + com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedDatabaseAccounts() + .listByResourceGroupAndLocationWithResponse("rg1", "West US", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsPurgeSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsPurgeSamples.java new file mode 100644 index 000000000000..cbdf53cc04b5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsPurgeSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedDatabaseAccounts Purge. + */ +public final class SoftDeletedDatabaseAccountsPurgeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedDatabaseAccountPurge.json + */ + /** + * Sample code: CosmosDBSoftDeletedDatabaseAccountPurge. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSoftDeletedDatabaseAccountPurge(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedDatabaseAccounts() + .purge("rg1", "West US", "softdeleted-cosmosdb-1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsRestoreSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsRestoreSamples.java new file mode 100644 index 000000000000..81974707d35a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsRestoreSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedDatabaseAccounts Restore. + */ +public final class SoftDeletedDatabaseAccountsRestoreSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedDatabaseAccountRestore.json + */ + /** + * Sample code: CosmosDBSoftDeletedDatabaseAccountRestore. + * + * @param manager Entry point to CosmosManager. + */ + public static void + cosmosDBSoftDeletedDatabaseAccountRestore(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedDatabaseAccounts() + .restore("rg2", "West US", "softdeleted-cosmosdb-2", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersGetSamples.java new file mode 100644 index 000000000000..9d318f293bfd --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedSqlContainers Get. + */ +public final class SoftDeletedSqlContainersGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedSqlContainerGet.json + */ + /** + * Sample code: CosmosDBSoftDeletedSqlContainerGet. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSoftDeletedSqlContainerGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedSqlContainers() + .getWithResponse("rg1", "West US", "softdeleted-cosmosdb-1", "MyDatabase", "MyContainer", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersListSamples.java new file mode 100644 index 000000000000..e364a41d7a91 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedSqlContainers List. + */ +public final class SoftDeletedSqlContainersListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedSqlContainerList.json + */ + /** + * Sample code: CosmosDBSoftDeletedSqlContainerList. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSoftDeletedSqlContainerList(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedSqlContainers() + .listWithResponse("rg1", "West US", "softdeleted-cosmosdb-1", "MyDatabase", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersPurgeSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersPurgeSamples.java new file mode 100644 index 000000000000..b2a0dc140d1c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersPurgeSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedSqlContainers Purge. + */ +public final class SoftDeletedSqlContainersPurgeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedSqlContainerPurge.json + */ + /** + * Sample code: CosmosDBSoftDeletedSqlContainerPurge. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSoftDeletedSqlContainerPurge(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedSqlContainers() + .purge("rg1", "West US", "softdeleted-cosmosdb-1", "MyDatabase", "MyContainer", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersRestoreSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersRestoreSamples.java new file mode 100644 index 000000000000..583f6d76330d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlContainersRestoreSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedSqlContainers Restore. + */ +public final class SoftDeletedSqlContainersRestoreSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedSqlContainerRestore.json + */ + /** + * Sample code: CosmosDBSoftDeletedSqlContainerRestore. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSoftDeletedSqlContainerRestore(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedSqlContainers() + .restore("rg1", "West US", "softdeleted-cosmosdb-1", "MyDatabase", "MyContainer", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesGetSamples.java new file mode 100644 index 000000000000..3be376a231f5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedSqlDatabases Get. + */ +public final class SoftDeletedSqlDatabasesGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedSqlDatabaseGet.json + */ + /** + * Sample code: CosmosDBSoftDeletedSqlDatabaseGet. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSoftDeletedSqlDatabaseGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedSqlDatabases() + .getWithResponse("rg1", "West US", "softdeleted-cosmosdb-1", "MyDatabase", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesListSamples.java new file mode 100644 index 000000000000..e6fed21fddf5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedSqlDatabases List. + */ +public final class SoftDeletedSqlDatabasesListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedSqlDatabaseList.json + */ + /** + * Sample code: CosmosDBSoftDeletedSqlDatabaseList. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSoftDeletedSqlDatabaseList(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedSqlDatabases() + .listWithResponse("rg1", "West US", "softdeleted-cosmosdb-1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesPurgeSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesPurgeSamples.java new file mode 100644 index 000000000000..5c0431f7652f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesPurgeSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedSqlDatabases Purge. + */ +public final class SoftDeletedSqlDatabasesPurgeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedSqlDatabasePurge.json + */ + /** + * Sample code: CosmosDBSoftDeletedSqlDatabasePurge. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSoftDeletedSqlDatabasePurge(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedSqlDatabases() + .purge("rg1", "West US", "softdeleted-cosmosdb-1", "MyDatabase", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesRestoreSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesRestoreSamples.java new file mode 100644 index 000000000000..5fd17a237e5e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesRestoreSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for SoftDeletedSqlDatabases Restore. + */ +public final class SoftDeletedSqlDatabasesRestoreSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSoftDeletedSqlDatabaseRestore.json + */ + /** + * Sample code: CosmosDBSoftDeletedSqlDatabaseRestore. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSoftDeletedSqlDatabaseRestore(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSoftDeletedSqlDatabases() + .restore("rg1", "West US", "ddb1", "softDeletedDatabase1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateClientEncryptionKeySamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateClientEncryptionKeySamples.java index 49af4a5257e3..0eb8c87cb58a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateClientEncryptionKeySamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateClientEncryptionKeySamples.java @@ -13,7 +13,7 @@ */ public final class SqlResourcesCreateUpdateClientEncryptionKeySamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlClientEncryptionKeyCreateUpdate.json */ /** * Sample code: CosmosDBClientEncryptionKeyCreateUpdate. @@ -24,14 +24,16 @@ public static void cosmosDBClientEncryptionKeyCreateUpdate(com.azure.resourceman manager.serviceClient() .getSqlResources() .createUpdateClientEncryptionKey("rgName", "accountName", "databaseName", "cekName", - new ClientEncryptionKeyCreateUpdateParameters() - .withResource(new ClientEncryptionKeyResource().withId("cekName") - .withEncryptionAlgorithm("AEAD_AES_256_CBC_HMAC_SHA256") - .withWrappedDataEncryptionKey("U3dhZ2dlciByb2Nrcw==".getBytes()) - .withKeyWrapMetadata(new KeyWrapMetadata().withName("customerManagedKey") - .withType("AzureKeyVault") - .withValue("AzureKeyVault Key URL") - .withAlgorithm("RSA-OAEP"))), + new ClientEncryptionKeyCreateUpdateParameters().withResource(new ClientEncryptionKeyResource() + .withId("cekName") + .withEncryptionAlgorithm("AEAD_AES_256_CBC_HMAC_SHA256") + .withWrappedDataEncryptionKey( + "VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU=" + .getBytes()) + .withKeyWrapMetadata(new KeyWrapMetadata().withName("customerManagedKey") + .withType("AzureKeyVault") + .withValue("AzureKeyVault Key URL") + .withAlgorithm("RSA-OAEP"))), com.azure.core.util.Context.NONE); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlContainerSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlContainerSamples.java index 01b5f642bf51..c1641ea66929 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlContainerSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlContainerSamples.java @@ -10,7 +10,11 @@ import com.azure.resourcemanager.cosmos.models.ConflictResolutionMode; import com.azure.resourcemanager.cosmos.models.ConflictResolutionPolicy; import com.azure.resourcemanager.cosmos.models.ContainerPartitionKey; +import com.azure.resourcemanager.cosmos.models.CreateMode; import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; +import com.azure.resourcemanager.cosmos.models.DataMaskingPolicy; +import com.azure.resourcemanager.cosmos.models.DataMaskingPolicyExcludedPathsItem; +import com.azure.resourcemanager.cosmos.models.DataMaskingPolicyIncludedPathsItem; import com.azure.resourcemanager.cosmos.models.DataType; import com.azure.resourcemanager.cosmos.models.DistanceFunction; import com.azure.resourcemanager.cosmos.models.FullTextIndexPath; @@ -21,7 +25,9 @@ import com.azure.resourcemanager.cosmos.models.Indexes; import com.azure.resourcemanager.cosmos.models.IndexingMode; import com.azure.resourcemanager.cosmos.models.IndexingPolicy; +import com.azure.resourcemanager.cosmos.models.MaterializedViewDefinition; import com.azure.resourcemanager.cosmos.models.PartitionKind; +import com.azure.resourcemanager.cosmos.models.ResourceRestoreParameters; import com.azure.resourcemanager.cosmos.models.SqlContainerCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.SqlContainerResource; import com.azure.resourcemanager.cosmos.models.UniqueKey; @@ -31,6 +37,7 @@ import com.azure.resourcemanager.cosmos.models.VectorEmbeddingPolicy; import com.azure.resourcemanager.cosmos.models.VectorIndex; import com.azure.resourcemanager.cosmos.models.VectorIndexType; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -40,7 +47,43 @@ */ public final class SqlResourcesCreateUpdateSqlContainerSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlContainerCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlMaterializedViewCreateUpdate.json + */ + /** + * Sample code: CosmosDBSqlMaterializedViewCreateUpdate. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSqlMaterializedViewCreateUpdate(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSqlResources() + .createUpdateSqlContainer("rg1", "ddb1", "databaseName", "mvContainerName", + new SqlContainerCreateUpdateParameters().withLocation("West US") + .withTags(mapOf()) + .withResource(new SqlContainerResource().withId("mvContainerName") + .withIndexingPolicy(new IndexingPolicy().withAutomatic(true) + .withIndexingMode(IndexingMode.CONSISTENT) + .withIncludedPaths(Arrays.asList(new IncludedPath().withPath("/*") + .withIndexes(Arrays.asList( + new Indexes().withDataType(DataType.STRING) + .withPrecision(-1) + .withKind(IndexKind.RANGE), + new Indexes().withDataType(DataType.NUMBER) + .withPrecision(-1) + .withKind(IndexKind.RANGE))))) + .withExcludedPaths(Arrays.asList())) + .withPartitionKey( + new ContainerPartitionKey().withPaths(Arrays.asList("/mvpk")).withKind(PartitionKind.HASH)) + .withMaterializedViewDefinition( + new MaterializedViewDefinition().withSourceCollectionId("sourceContainerName") + .withDefinition("select * from ROOT") + .withThroughputBucketForBuild(1))) + .withOptions(new CreateUpdateOptions()), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerCreateUpdate.json */ /** * Sample code: CosmosDBSqlContainerCreateUpdate. @@ -106,7 +149,40 @@ public static void cosmosDBSqlContainerCreateUpdate(com.azure.resourcemanager.co .withFullTextPaths( Arrays.asList(new FullTextPath().withPath("/ftPath1").withLanguage("en-US"), new FullTextPath().withPath("/ftPath2").withLanguage("fr-FR"), - new FullTextPath().withPath("/ftPath3").withLanguage("de-DE"))))) + new FullTextPath().withPath("/ftPath3").withLanguage("de-DE")))) + .withDataMaskingPolicy(new DataMaskingPolicy() + .withIncludedPaths(Arrays.asList(new DataMaskingPolicyIncludedPathsItem().withPath("/"), + new DataMaskingPolicyIncludedPathsItem().withPath("/contact/phones") + .withStrategy("MaskSubstring") + .withStartPosition(3) + .withLength(10))) + .withExcludedPaths( + Arrays.asList(new DataMaskingPolicyExcludedPathsItem().withPath("/id"))) + .withIsPolicyEnabled(true))) + .withOptions(new CreateUpdateOptions()), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerRestore.json + */ + /** + * Sample code: CosmosDBSqlContainerRestore. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSqlContainerRestore(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSqlResources() + .createUpdateSqlContainer("rg1", "ddb1", "databaseName", "containerName", + new SqlContainerCreateUpdateParameters().withLocation("West US") + .withTags(mapOf()) + .withResource(new SqlContainerResource().withId("containerName") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource( + "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2022-07-20T18:28:00Z")) + .withRestoreWithTtlDisabled(true)) + .withCreateMode(CreateMode.RESTORE)) .withOptions(new CreateUpdateOptions()), com.azure.core.util.Context.NONE); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlDatabaseSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlDatabaseSamples.java index 8bcdf8f20312..5fe3329aca35 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlDatabaseSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlDatabaseSamples.java @@ -4,9 +4,12 @@ package com.azure.resourcemanager.cosmos.generated; +import com.azure.resourcemanager.cosmos.models.CreateMode; import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; +import com.azure.resourcemanager.cosmos.models.ResourceRestoreParameters; import com.azure.resourcemanager.cosmos.models.SqlDatabaseCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.SqlDatabaseResource; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -15,7 +18,7 @@ */ public final class SqlResourcesCreateUpdateSqlDatabaseSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlDatabaseCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlDatabaseCreateUpdate.json */ /** * Sample code: CosmosDBSqlDatabaseCreateUpdate. @@ -33,6 +36,29 @@ public static void cosmosDBSqlDatabaseCreateUpdate(com.azure.resourcemanager.cos com.azure.core.util.Context.NONE); } + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlDatabaseRestore.json + */ + /** + * Sample code: CosmosDBSqlDatabaseRestore. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSqlDatabaseRestore(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSqlResources() + .createUpdateSqlDatabase("rg1", "ddb1", "databaseName", new SqlDatabaseCreateUpdateParameters() + .withLocation("West US") + .withTags(mapOf()) + .withResource(new SqlDatabaseResource().withId("databaseName") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource( + "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2022-07-20T18:28:00Z")) + .withRestoreWithTtlDisabled(true)) + .withCreateMode(CreateMode.RESTORE)) + .withOptions(new CreateUpdateOptions()), com.azure.core.util.Context.NONE); + } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleAssignmentSamples.java index 68a8ee3f9160..1f29bf7d03ad 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleAssignmentSamples.java @@ -11,7 +11,7 @@ */ public final class SqlResourcesCreateUpdateSqlRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlRoleAssignmentCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlRoleAssignmentCreateUpdate.json */ /** * Sample code: CosmosDBSqlRoleAssignmentCreateUpdate. @@ -23,9 +23,9 @@ public static void cosmosDBSqlRoleAssignmentCreateUpdate(com.azure.resourcemanag .getSqlResources() .createUpdateSqlRoleAssignment("myRoleAssignmentId", "myResourceGroupName", "myAccountName", new SqlRoleAssignmentCreateUpdateParameters().withRoleDefinitionId( - "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId") + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId") .withScope( - "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases") + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases") .withPrincipalId("myPrincipalId"), com.azure.core.util.Context.NONE); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleDefinitionSamples.java index 033c7345574f..80ad6a0cb008 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleDefinitionSamples.java @@ -14,7 +14,7 @@ */ public final class SqlResourcesCreateUpdateSqlRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlRoleDefinitionCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlRoleDefinitionCreateUpdate.json */ /** * Sample code: CosmosDBSqlRoleDefinitionCreateUpdate. @@ -28,8 +28,8 @@ public static void cosmosDBSqlRoleDefinitionCreateUpdate(com.azure.resourcemanag new SqlRoleDefinitionCreateUpdateParameters().withRoleName("myRoleName") .withType(RoleDefinitionType.CUSTOM_ROLE) .withAssignableScopes(Arrays.asList( - "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", - "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases")) + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases")) .withPermissions(Arrays.asList(new Permission() .withDataActions( Arrays.asList("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create", diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlStoredProcedureSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlStoredProcedureSamples.java index c16344a6a93e..e11b3bf4b1e4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlStoredProcedureSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlStoredProcedureSamples.java @@ -13,7 +13,7 @@ */ public final class SqlResourcesCreateUpdateSqlStoredProcedureSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlStoredProcedureCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlStoredProcedureCreateUpdate.json */ /** * Sample code: CosmosDBSqlStoredProcedureCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlTriggerSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlTriggerSamples.java index 6b9cee4136b1..d2a74ee91fb9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlTriggerSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlTriggerSamples.java @@ -15,7 +15,7 @@ */ public final class SqlResourcesCreateUpdateSqlTriggerSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlTriggerCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlTriggerCreateUpdate.json */ /** * Sample code: CosmosDBSqlTriggerCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlUserDefinedFunctionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlUserDefinedFunctionSamples.java index 6f0caeb2d971..583f53b9f95c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlUserDefinedFunctionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlUserDefinedFunctionSamples.java @@ -13,7 +13,7 @@ */ public final class SqlResourcesCreateUpdateSqlUserDefinedFunctionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlUserDefinedFunctionCreateUpdate.json */ /** * Sample code: CosmosDBSqlUserDefinedFunctionCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlContainerSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlContainerSamples.java index c190605d56b4..16d35772afa4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlContainerSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlContainerSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesDeleteSqlContainerSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlContainerDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerDelete.json */ /** * Sample code: CosmosDBSqlContainerDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlDatabaseSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlDatabaseSamples.java index 6b1edd6fee9e..4810794a4220 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlDatabaseSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlDatabaseSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesDeleteSqlDatabaseSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlDatabaseDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlDatabaseDelete.json */ /** * Sample code: CosmosDBSqlDatabaseDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleAssignmentSamples.java index d559f0985877..d58845ed6830 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleAssignmentSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesDeleteSqlRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlRoleAssignmentDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlRoleAssignmentDelete.json */ /** * Sample code: CosmosDBSqlRoleAssignmentDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleDefinitionSamples.java index c4a0c6e41ed5..37f80b6c5c11 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesDeleteSqlRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlRoleDefinitionDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlRoleDefinitionDelete.json */ /** * Sample code: CosmosDBSqlRoleDefinitionDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlStoredProcedureSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlStoredProcedureSamples.java index e16bb0447915..574d6bded07c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlStoredProcedureSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlStoredProcedureSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesDeleteSqlStoredProcedureSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlStoredProcedureDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlStoredProcedureDelete.json */ /** * Sample code: CosmosDBSqlStoredProcedureDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlTriggerSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlTriggerSamples.java index ae65c608b730..3739c22c8fac 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlTriggerSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlTriggerSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesDeleteSqlTriggerSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlTriggerDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlTriggerDelete.json */ /** * Sample code: CosmosDBSqlTriggerDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlUserDefinedFunctionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlUserDefinedFunctionSamples.java index 9cdcd287f276..d88a90d49280 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlUserDefinedFunctionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlUserDefinedFunctionSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesDeleteSqlUserDefinedFunctionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlUserDefinedFunctionDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlUserDefinedFunctionDelete.json */ /** * Sample code: CosmosDBSqlUserDefinedFunctionDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetClientEncryptionKeySamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetClientEncryptionKeySamples.java index 57343ac00d3f..ba61a6718b30 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetClientEncryptionKeySamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetClientEncryptionKeySamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesGetClientEncryptionKeySamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlClientEncryptionKeyGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlClientEncryptionKeyGet.json */ /** * Sample code: CosmosDBClientEncryptionKeyGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerSamples.java index e2254218986d..a11199d67ec2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesGetSqlContainerSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlContainerGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerGet.json */ /** * Sample code: CosmosDBSqlContainerGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerThroughputSamples.java index 3667414edccf..412332701a0e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesGetSqlContainerThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlContainerThroughputGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerThroughputGet.json */ /** * Sample code: CosmosDBSqlContainerThroughputGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseSamples.java index d1dbbd66c577..4471efbbd4e8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesGetSqlDatabaseSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlDatabaseGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlDatabaseGet.json */ /** * Sample code: CosmosDBSqlDatabaseGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseThroughputSamples.java index 7dea452d0809..9637b285dd0e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesGetSqlDatabaseThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlDatabaseThroughputGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlDatabaseThroughputGet.json */ /** * Sample code: CosmosDBSqlDatabaseThroughputGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleAssignmentSamples.java index a66ba9588c8e..71d6f496a2bf 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleAssignmentSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesGetSqlRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlRoleAssignmentGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlRoleAssignmentGet.json */ /** * Sample code: CosmosDBSqlRoleAssignmentGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleDefinitionSamples.java index afae01271ed0..50963eda9b49 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesGetSqlRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlRoleDefinitionGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlRoleDefinitionGet.json */ /** * Sample code: CosmosDBSqlRoleDefinitionGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlStoredProcedureSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlStoredProcedureSamples.java index eae49b8a816b..9c2d4ff4230a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlStoredProcedureSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlStoredProcedureSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesGetSqlStoredProcedureSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlStoredProcedureGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlStoredProcedureGet.json */ /** * Sample code: CosmosDBSqlStoredProcedureGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlTriggerSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlTriggerSamples.java index ba7f45642549..94e3de2795db 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlTriggerSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlTriggerSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesGetSqlTriggerSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlTriggerGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlTriggerGet.json */ /** * Sample code: CosmosDBSqlTriggerGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlUserDefinedFunctionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlUserDefinedFunctionSamples.java index 919ae28fa658..0b29d592e426 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlUserDefinedFunctionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlUserDefinedFunctionSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesGetSqlUserDefinedFunctionSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlUserDefinedFunctionGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlUserDefinedFunctionGet.json */ /** * Sample code: CosmosDBSqlUserDefinedFunctionGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListClientEncryptionKeysSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListClientEncryptionKeysSamples.java index 388d761fcf79..507638fc7996 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListClientEncryptionKeysSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListClientEncryptionKeysSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesListClientEncryptionKeysSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlClientEncryptionKeysList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlClientEncryptionKeysList.json */ /** * Sample code: CosmosDBClientEncryptionKeysList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlContainerPartitionMergeSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlContainerPartitionMergeSamples.java new file mode 100644 index 000000000000..8a57dbc865b8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlContainerPartitionMergeSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.MergeParameters; + +/** + * Samples for SqlResources ListSqlContainerPartitionMerge. + */ +public final class SqlResourcesListSqlContainerPartitionMergeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerPartitionMerge.json + */ + /** + * Sample code: CosmosDBSqlContainerPartitionMerge. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSqlContainerPartitionMerge(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSqlResources() + .listSqlContainerPartitionMerge("rgName", "ddb1", "databaseName", "containerName", + new MergeParameters().withIsDryRun(false), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlContainersSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlContainersSamples.java index 5b1080928777..9d99b9086211 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlContainersSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlContainersSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesListSqlContainersSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlContainerList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerList.json */ /** * Sample code: CosmosDBSqlContainerList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlDatabasesSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlDatabasesSamples.java index 33bff106d27f..ffbf0eb12153 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlDatabasesSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlDatabasesSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesListSqlDatabasesSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlDatabaseList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlDatabaseList.json */ /** * Sample code: CosmosDBSqlDatabaseList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleAssignmentsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleAssignmentsSamples.java index cdbefeb43417..bdc0ef57b2a7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleAssignmentsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleAssignmentsSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesListSqlRoleAssignmentsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlRoleAssignmentList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlRoleAssignmentList.json */ /** * Sample code: CosmosDBSqlRoleAssignmentList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleDefinitionsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleDefinitionsSamples.java index 1efdcf44486b..29ed8be6f2f5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleDefinitionsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleDefinitionsSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesListSqlRoleDefinitionsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlRoleDefinitionList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlRoleDefinitionList.json */ /** * Sample code: CosmosDBSqlRoleDefinitionList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlStoredProceduresSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlStoredProceduresSamples.java index 96bbf333339d..b5a397b5fcd7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlStoredProceduresSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlStoredProceduresSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesListSqlStoredProceduresSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlStoredProcedureList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlStoredProcedureList.json */ /** * Sample code: CosmosDBSqlStoredProcedureList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlTriggersSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlTriggersSamples.java index 649d2766291b..dd1812b05c8c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlTriggersSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlTriggersSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesListSqlTriggersSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlTriggerList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlTriggerList.json */ /** * Sample code: CosmosDBSqlTriggerList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlUserDefinedFunctionsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlUserDefinedFunctionsSamples.java index 8138d8f8650b..3ca82ce4e016 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlUserDefinedFunctionsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlUserDefinedFunctionsSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesListSqlUserDefinedFunctionsSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlUserDefinedFunctionList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlUserDefinedFunctionList.json */ /** * Sample code: CosmosDBSqlUserDefinedFunctionList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToAutoscaleSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToAutoscaleSamples.java index 00bf2ca344be..aa9e92f273a5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToAutoscaleSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToAutoscaleSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesMigrateSqlContainerToAutoscaleSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlContainerMigrateToAutoscale.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerMigrateToAutoscale.json */ /** * Sample code: CosmosDBSqlContainerMigrateToAutoscale. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToManualThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToManualThroughputSamples.java index a839bddeccf9..d26a1112d24e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToManualThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToManualThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesMigrateSqlContainerToManualThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlContainerMigrateToManualThroughput.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerMigrateToManualThroughput.json */ /** * Sample code: CosmosDBSqlContainerMigrateToManualThroughput. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToAutoscaleSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToAutoscaleSamples.java index b1d4de193c27..fde51272340b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToAutoscaleSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToAutoscaleSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesMigrateSqlDatabaseToAutoscaleSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlDatabaseMigrateToAutoscale.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlDatabaseMigrateToAutoscale.json */ /** * Sample code: CosmosDBSqlDatabaseMigrateToAutoscale. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToManualThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToManualThroughputSamples.java index d8ec5e522fa7..cf42ca96bc30 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToManualThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToManualThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class SqlResourcesMigrateSqlDatabaseToManualThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlDatabaseMigrateToManualThroughput.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlDatabaseMigrateToManualThroughput.json */ /** * Sample code: CosmosDBSqlDatabaseMigrateToManualThroughput. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesRetrieveContinuousBackupInformationSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesRetrieveContinuousBackupInformationSamples.java index 0ec7b400fbdc..dcc5c97d0166 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesRetrieveContinuousBackupInformationSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesRetrieveContinuousBackupInformationSamples.java @@ -11,7 +11,7 @@ */ public final class SqlResourcesRetrieveContinuousBackupInformationSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlContainerBackupInformation.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerBackupInformation.json */ /** * Sample code: CosmosDBSqlContainerBackupInformation. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlContainerRedistributeThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlContainerRedistributeThroughputSamples.java new file mode 100644 index 000000000000..a33ff4c2a0da --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlContainerRedistributeThroughputSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoResource; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputPropertiesResource; +import com.azure.resourcemanager.cosmos.models.ThroughputPolicyType; +import java.util.Arrays; + +/** + * Samples for SqlResources SqlContainerRedistributeThroughput. + */ +public final class SqlResourcesSqlContainerRedistributeThroughputSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerRedistributeThroughput.json + */ + /** + * Sample code: CosmosDBSqlContainerRedistributeThroughput. + * + * @param manager Entry point to CosmosManager. + */ + public static void + cosmosDBSqlContainerRedistributeThroughput(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSqlResources() + .sqlContainerRedistributeThroughput("rg1", "ddb1", "databaseName", "containerName", + new RedistributeThroughputParameters().withResource(new RedistributeThroughputPropertiesResource() + .withThroughputPolicy(ThroughputPolicyType.CUSTOM) + .withTargetPhysicalPartitionThroughputInfo( + Arrays.asList(new PhysicalPartitionThroughputInfoResource().withId("0").withThroughput(5000.0D), + new PhysicalPartitionThroughputInfoResource().withId("1").withThroughput(5000.0D))) + .withSourcePhysicalPartitionThroughputInfo( + Arrays.asList(new PhysicalPartitionThroughputInfoResource().withId("2").withThroughput(5000.0D), + new PhysicalPartitionThroughputInfoResource().withId("3")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlContainerRetrieveThroughputDistributionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlContainerRetrieveThroughputDistributionSamples.java new file mode 100644 index 000000000000..fcc1e0b29b7d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlContainerRetrieveThroughputDistributionSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionId; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputPropertiesResource; +import java.util.Arrays; + +/** + * Samples for SqlResources SqlContainerRetrieveThroughputDistribution. + */ +public final class SqlResourcesSqlContainerRetrieveThroughputDistributionSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerRetrieveThroughputDistribution.json + */ + /** + * Sample code: CosmosDBSqlContainerRetrieveThroughputDistribution. + * + * @param manager Entry point to CosmosManager. + */ + public static void + cosmosDBSqlContainerRetrieveThroughputDistribution(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSqlResources() + .sqlContainerRetrieveThroughputDistribution("rg1", "ddb1", "databaseName", "containerName", + new RetrieveThroughputParameters() + .withResource(new RetrieveThroughputPropertiesResource().withPhysicalPartitionIds( + Arrays.asList(new PhysicalPartitionId().withId("0"), new PhysicalPartitionId().withId("1")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlDatabasePartitionMergeSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlDatabasePartitionMergeSamples.java new file mode 100644 index 000000000000..d800c582270a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlDatabasePartitionMergeSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.MergeParameters; + +/** + * Samples for SqlResources SqlDatabasePartitionMerge. + */ +public final class SqlResourcesSqlDatabasePartitionMergeSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlDatabasePartitionMerge.json + */ + /** + * Sample code: CosmosDBSqlDatabasePartitionMerge. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBSqlDatabasePartitionMerge(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSqlResources() + .sqlDatabasePartitionMerge("rgName", "ddb1", "databaseName", new MergeParameters().withIsDryRun(false), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlDatabaseRedistributeThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlDatabaseRedistributeThroughputSamples.java new file mode 100644 index 000000000000..8c8a944e8cd0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlDatabaseRedistributeThroughputSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoResource; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputPropertiesResource; +import com.azure.resourcemanager.cosmos.models.ThroughputPolicyType; +import java.util.Arrays; + +/** + * Samples for SqlResources SqlDatabaseRedistributeThroughput. + */ +public final class SqlResourcesSqlDatabaseRedistributeThroughputSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlDatabaseRedistributeThroughput.json + */ + /** + * Sample code: CosmosDBSqlDatabaseRedistributeThroughput. + * + * @param manager Entry point to CosmosManager. + */ + public static void + cosmosDBSqlDatabaseRedistributeThroughput(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSqlResources() + .sqlDatabaseRedistributeThroughput("rg1", "ddb1", "databaseName", + new RedistributeThroughputParameters().withResource(new RedistributeThroughputPropertiesResource() + .withThroughputPolicy(ThroughputPolicyType.CUSTOM) + .withTargetPhysicalPartitionThroughputInfo( + Arrays.asList(new PhysicalPartitionThroughputInfoResource().withId("0").withThroughput(5000.0D), + new PhysicalPartitionThroughputInfoResource().withId("1").withThroughput(5000.0D))) + .withSourcePhysicalPartitionThroughputInfo( + Arrays.asList(new PhysicalPartitionThroughputInfoResource().withId("2").withThroughput(5000.0D), + new PhysicalPartitionThroughputInfoResource().withId("3")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlDatabaseRetrieveThroughputDistributionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlDatabaseRetrieveThroughputDistributionSamples.java new file mode 100644 index 000000000000..1ea9e0ba8554 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesSqlDatabaseRetrieveThroughputDistributionSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionId; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputPropertiesResource; +import java.util.Arrays; + +/** + * Samples for SqlResources SqlDatabaseRetrieveThroughputDistribution. + */ +public final class SqlResourcesSqlDatabaseRetrieveThroughputDistributionSamples { + /* + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json + */ + /** + * Sample code: CosmosDBSqlDatabaseRetrieveThroughputDistribution. + * + * @param manager Entry point to CosmosManager. + */ + public static void + cosmosDBSqlDatabaseRetrieveThroughputDistribution(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getSqlResources() + .sqlDatabaseRetrieveThroughputDistribution("rg1", "ddb1", "databaseName", + new RetrieveThroughputParameters() + .withResource(new RetrieveThroughputPropertiesResource().withPhysicalPartitionIds( + Arrays.asList(new PhysicalPartitionId().withId("0"), new PhysicalPartitionId().withId("1")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlContainerThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlContainerThroughputSamples.java index 38b331b6f739..9cb6b5f47677 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlContainerThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlContainerThroughputSamples.java @@ -14,7 +14,7 @@ */ public final class SqlResourcesUpdateSqlContainerThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlContainerThroughputUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlContainerThroughputUpdate.json */ /** * Sample code: CosmosDBSqlContainerThroughputUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlDatabaseThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlDatabaseThroughputSamples.java index cc31455e99dd..df316d925176 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlDatabaseThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlDatabaseThroughputSamples.java @@ -14,7 +14,7 @@ */ public final class SqlResourcesUpdateSqlDatabaseThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBSqlDatabaseThroughputUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBSqlDatabaseThroughputUpdate.json */ /** * Sample code: CosmosDBSqlDatabaseThroughputUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableRoleAssignmentSamples.java index da076c16d613..fe342911bad0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableRoleAssignmentSamples.java @@ -11,7 +11,7 @@ */ public final class TableResourcesCreateUpdateTableRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/tablerbac/CosmosDBTableRoleAssignmentCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/tablerbac/CosmosDBTableRoleAssignmentCreateUpdate.json */ /** * Sample code: CosmosDBTableRoleAssignmentCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableRoleDefinitionSamples.java index a15f0a409c17..a83ae5fd1c82 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableRoleDefinitionSamples.java @@ -14,7 +14,7 @@ */ public final class TableResourcesCreateUpdateTableRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/tablerbac/CosmosDBTableRoleDefinitionCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/tablerbac/CosmosDBTableRoleDefinitionCreateUpdate.json */ /** * Sample code: CosmosDBTableRoleDefinitionCreateUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableSamples.java index 0475295b5b9f..a14efe43b6f4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableSamples.java @@ -15,7 +15,7 @@ */ public final class TableResourcesCreateUpdateTableSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBTableCreateUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBTableCreateUpdate.json */ /** * Sample code: CosmosDBTableReplace. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableRoleAssignmentSamples.java index f3238af1026a..0e5582774ea2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableRoleAssignmentSamples.java @@ -9,7 +9,7 @@ */ public final class TableResourcesDeleteTableRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/tablerbac/CosmosDBTableRoleAssignmentDelete.json + * x-ms-original-file: 2026-04-01-preview/tablerbac/CosmosDBTableRoleAssignmentDelete.json */ /** * Sample code: CosmosDBTableRoleAssignmentDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableRoleDefinitionSamples.java index 35fadc66cc5f..9042863fda69 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableRoleDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class TableResourcesDeleteTableRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/tablerbac/CosmosDBTableRoleDefinitionDelete.json + * x-ms-original-file: 2026-04-01-preview/tablerbac/CosmosDBTableRoleDefinitionDelete.json */ /** * Sample code: CosmosDBTableRoleDefinitionDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableSamples.java index 3913930d0b02..9104da670dc9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableSamples.java @@ -9,7 +9,7 @@ */ public final class TableResourcesDeleteTableSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBTableDelete.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBTableDelete.json */ /** * Sample code: CosmosDBTableDelete. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableRoleAssignmentSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableRoleAssignmentSamples.java index 4fdc51422347..69ed5bf06a57 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableRoleAssignmentSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableRoleAssignmentSamples.java @@ -9,7 +9,7 @@ */ public final class TableResourcesGetTableRoleAssignmentSamples { /* - * x-ms-original-file: 2026-03-15/tablerbac/CosmosDBTableRoleAssignmentGet.json + * x-ms-original-file: 2026-04-01-preview/tablerbac/CosmosDBTableRoleAssignmentGet.json */ /** * Sample code: CosmosDBTableRoleAssignmentGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableRoleDefinitionSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableRoleDefinitionSamples.java index 29ed9988b466..0132bfd6d7b1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableRoleDefinitionSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableRoleDefinitionSamples.java @@ -9,7 +9,7 @@ */ public final class TableResourcesGetTableRoleDefinitionSamples { /* - * x-ms-original-file: 2026-03-15/tablerbac/CosmosDBTableRoleDefinitionGet.json + * x-ms-original-file: 2026-04-01-preview/tablerbac/CosmosDBTableRoleDefinitionGet.json */ /** * Sample code: CosmosDBTableRoleDefinitionGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableSamples.java index a322fbd20f8c..64a10a3e701a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableSamples.java @@ -9,7 +9,7 @@ */ public final class TableResourcesGetTableSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBTableGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBTableGet.json */ /** * Sample code: CosmosDBTableGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableThroughputSamples.java index 64f9fec087c9..1d5d7469635a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class TableResourcesGetTableThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBTableThroughputGet.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBTableThroughputGet.json */ /** * Sample code: CosmosDBTableThroughputGet. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTableRoleAssignmentsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTableRoleAssignmentsSamples.java index 469fe99c677e..2047c1944adb 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTableRoleAssignmentsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTableRoleAssignmentsSamples.java @@ -9,7 +9,7 @@ */ public final class TableResourcesListTableRoleAssignmentsSamples { /* - * x-ms-original-file: 2026-03-15/tablerbac/CosmosDBTableRoleAssignmentList.json + * x-ms-original-file: 2026-04-01-preview/tablerbac/CosmosDBTableRoleAssignmentList.json */ /** * Sample code: CosmosDBTableRoleAssignmentList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTableRoleDefinitionsSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTableRoleDefinitionsSamples.java index d4437417ff83..aa5419d27b4b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTableRoleDefinitionsSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTableRoleDefinitionsSamples.java @@ -9,7 +9,7 @@ */ public final class TableResourcesListTableRoleDefinitionsSamples { /* - * x-ms-original-file: 2026-03-15/tablerbac/CosmosDBTableRoleDefinitionList.json + * x-ms-original-file: 2026-04-01-preview/tablerbac/CosmosDBTableRoleDefinitionList.json */ /** * Sample code: CosmosDBTableRoleDefinitionList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTablesSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTablesSamples.java index acdbe8694730..df3f237ba2a0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTablesSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTablesSamples.java @@ -9,7 +9,7 @@ */ public final class TableResourcesListTablesSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBTableList.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBTableList.json */ /** * Sample code: CosmosDBTableList. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToAutoscaleSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToAutoscaleSamples.java index b619ef3288a3..62c959b62311 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToAutoscaleSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToAutoscaleSamples.java @@ -9,7 +9,7 @@ */ public final class TableResourcesMigrateTableToAutoscaleSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBTableMigrateToAutoscale.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBTableMigrateToAutoscale.json */ /** * Sample code: CosmosDBTableMigrateToAutoscale. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToManualThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToManualThroughputSamples.java index 293dc7398b2b..2ae10d3f0f94 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToManualThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToManualThroughputSamples.java @@ -9,7 +9,7 @@ */ public final class TableResourcesMigrateTableToManualThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBTableMigrateToManualThroughput.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBTableMigrateToManualThroughput.json */ /** * Sample code: CosmosDBTableMigrateToManualThroughput. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesRetrieveContinuousBackupInformationSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesRetrieveContinuousBackupInformationSamples.java index 253051924b81..24aa9c154b42 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesRetrieveContinuousBackupInformationSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesRetrieveContinuousBackupInformationSamples.java @@ -11,7 +11,7 @@ */ public final class TableResourcesRetrieveContinuousBackupInformationSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBTableBackupInformation.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBTableBackupInformation.json */ /** * Sample code: CosmosDBTableCollectionBackupInformation. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesUpdateTableThroughputSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesUpdateTableThroughputSamples.java index b1919777bca0..8d5ab3e15d2c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesUpdateTableThroughputSamples.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesUpdateTableThroughputSamples.java @@ -14,7 +14,7 @@ */ public final class TableResourcesUpdateTableThroughputSamples { /* - * x-ms-original-file: 2026-03-15/CosmosDBTableThroughputUpdate.json + * x-ms-original-file: 2026-04-01-preview/CosmosDBTableThroughputUpdate.json */ /** * Sample code: CosmosDBTableThroughputUpdate. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountCreateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountCreateSamples.java new file mode 100644 index 000000000000..e64b429eb572 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountCreateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolAccountResourceInner; + +/** + * Samples for ThroughputPoolAccount Create. + */ +public final class ThroughputPoolAccountCreateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/throughputPool/CosmosDBThroughputPoolAccountCreate.json + */ + /** + * Sample code: CosmosDB ThroughputPool Account Create. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBThroughputPoolAccountCreate(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getThroughputPoolAccounts() + .create("rg1", "tp1", "db1", new ThroughputPoolAccountResourceInner().withAccountResourceIdentifier( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/") + .withAccountLocation("West US"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountDeleteSamples.java new file mode 100644 index 000000000000..16e1e8fc305f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for ThroughputPoolAccount Delete. + */ +public final class ThroughputPoolAccountDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/throughputPool/CosmosDBThroughputPoolAccountDelete.json + */ + /** + * Sample code: CosmosDB ThroughputPool Account Delete. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBThroughputPoolAccountDelete(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getThroughputPoolAccounts() + .delete("rgName", "tp1", "db1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountGetSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountGetSamples.java new file mode 100644 index 000000000000..4d3d1950f9e8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for ThroughputPoolAccount Get. + */ +public final class ThroughputPoolAccountGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/throughputPool/CosmosDBThroughputPoolAccountGet.json + */ + /** + * Sample code: CosmosDB ThroughputPool Account Get. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBThroughputPoolAccountGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getThroughputPoolAccounts() + .getWithResponse("rgName", "tp1", "db1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountsOperationListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountsOperationListSamples.java new file mode 100644 index 000000000000..a9ca88290382 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountsOperationListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for ThroughputPoolAccountsOperation List. + */ +public final class ThroughputPoolAccountsOperationListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/throughputPool/CosmosDBThroughputPoolAccountsList.json + */ + /** + * Sample code: CosmosDB ThroughputPool Account List. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBThroughputPoolAccountList(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getThroughputPoolAccountsOperations() + .list("rgName", "tp1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolCreateOrUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolCreateOrUpdateSamples.java new file mode 100644 index 000000000000..00fce21fc480 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolCreateOrUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolResourceInner; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ThroughputPool CreateOrUpdate. + */ +public final class ThroughputPoolCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/throughputPool/CosmosDBThroughputPoolCreate.json + */ + /** + * Sample code: CosmosDB ThroughputPool Create. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBThroughputPoolCreate(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getThroughputPools() + .createOrUpdate("rg1", "tp1", + new ThroughputPoolResourceInner().withLocation("westus2").withTags(mapOf()).withMaxThroughput(10000), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolDeleteSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolDeleteSamples.java new file mode 100644 index 000000000000..68b02f310573 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for ThroughputPool Delete. + */ +public final class ThroughputPoolDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/throughputPool/CosmosDBThroughputPoolDelete.json + */ + /** + * Sample code: CosmosDB ThroughputPool Delete. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBThroughputPoolDelete(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient().getThroughputPools().delete("rgName", "tp1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolGetByResourceGroupSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolGetByResourceGroupSamples.java new file mode 100644 index 000000000000..b16eb5591915 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for ThroughputPool GetByResourceGroup. + */ +public final class ThroughputPoolGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/throughputPool/CosmosDBThroughputPoolGet.json + */ + /** + * Sample code: CosmosDB ThroughputPool Get. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBThroughputPoolGet(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getThroughputPools() + .getByResourceGroupWithResponse("rgName", "tp1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolUpdateSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolUpdateSamples.java new file mode 100644 index 000000000000..1baddfbc541b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.resourcemanager.cosmos.models.ThroughputPoolUpdate; + +/** + * Samples for ThroughputPool Update. + */ +public final class ThroughputPoolUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/throughputPool/CosmosDBThroughputPoolUpdate.json + */ + /** + * Sample code: CosmosDB ThroughputPool Update. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBThroughputPoolUpdate(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getThroughputPools() + .update("rg1", "tp1", new ThroughputPoolUpdate().withMaxThroughput(10000), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolsOperationListByResourceGroupSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolsOperationListByResourceGroupSamples.java new file mode 100644 index 000000000000..c43060634209 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolsOperationListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for ThroughputPoolsOperation ListByResourceGroup. + */ +public final class ThroughputPoolsOperationListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-04-01-preview/throughputPool/CosmosDBThroughputPoolList_ListByResourceGroup.json + */ + /** + * Sample code: CosmosDB ThroughputPool List by Resource Group. + * + * @param manager Entry point to CosmosManager. + */ + public static void + cosmosDBThroughputPoolListByResourceGroup(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient() + .getThroughputPoolsOperations() + .listByResourceGroup("rgName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolsOperationListSamples.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolsOperationListSamples.java new file mode 100644 index 000000000000..cbcc8164e8ab --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/samples/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolsOperationListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +/** + * Samples for ThroughputPoolsOperation List. + */ +public final class ThroughputPoolsOperationListSamples { + /* + * x-ms-original-file: 2026-04-01-preview/throughputPool/CosmosDBThroughputPoolList.json + */ + /** + * Sample code: CosmosDB ThroughputPool List. + * + * @param manager Entry point to CosmosManager. + */ + public static void cosmosDBThroughputPoolList(com.azure.resourcemanager.cosmos.CosmosManager manager) { + manager.serviceClient().getThroughputPoolsOperations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccessRulePropertiesSubscriptionTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccessRulePropertiesSubscriptionTests.java new file mode 100644 index 000000000000..6ac200d1b0b9 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccessRulePropertiesSubscriptionTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.AccessRulePropertiesSubscription; +import org.junit.jupiter.api.Assertions; + +public final class AccessRulePropertiesSubscriptionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AccessRulePropertiesSubscription model + = BinaryData.fromString("{\"id\":\"qbbewfcuqfpyyxm\"}").toObject(AccessRulePropertiesSubscription.class); + Assertions.assertEquals("qbbewfcuqfpyyxm", model.id()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccessRulePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccessRulePropertiesTests.java new file mode 100644 index 000000000000..09d4312f95e8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccessRulePropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.AccessRuleDirection; +import com.azure.resourcemanager.cosmos.models.AccessRuleProperties; +import org.junit.jupiter.api.Assertions; + +public final class AccessRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AccessRuleProperties model = BinaryData.fromString( + "{\"direction\":\"Outbound\",\"addressPrefixes\":[\"etxdqcmyctajqzj\",\"alec\",\"bibiwks\",\"egyxsbfpzvoik\"],\"subscriptions\":[{\"id\":\"czfzwushlc\"},{\"id\":\"blalh\"}],\"networkSecurityPerimeters\":[{\"id\":\"fkissaidqzsaa\",\"perimeterGuid\":\"dsgptotx\",\"location\":\"fiafc\"},{\"id\":\"r\",\"perimeterGuid\":\"fijzz\",\"location\":\"o\"}],\"fullyQualifiedDomainNames\":[\"lbuaukt\",\"ieopexelxqdwr\",\"wyil\",\"pibkgxyxyaux\"],\"emailAddresses\":[\"do\",\"mcnltmwytkujsqyc\",\"moxfablq\",\"pwbmwhria\"],\"phoneNumbers\":[\"rycgnwplrrbph\",\"tsbbibtic\",\"hqvumspbfs\"]}") + .toObject(AccessRuleProperties.class); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, model.direction()); + Assertions.assertEquals("etxdqcmyctajqzj", model.addressPrefixes().get(0)); + Assertions.assertEquals("czfzwushlc", model.subscriptions().get(0).id()); + Assertions.assertEquals("fkissaidqzsaa", model.networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals("dsgptotx", model.networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("fiafc", model.networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("lbuaukt", model.fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("do", model.emailAddresses().get(0)); + Assertions.assertEquals("rycgnwplrrbph", model.phoneNumbers().get(0)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccessRuleTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccessRuleTests.java new file mode 100644 index 000000000000..a0baa5648d94 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccessRuleTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.AccessRule; +import com.azure.resourcemanager.cosmos.models.AccessRuleDirection; +import org.junit.jupiter.api.Assertions; + +public final class AccessRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AccessRule model = BinaryData.fromString( + "{\"name\":\"at\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"oqsqjghr\"],\"subscriptions\":[{\"id\":\"plwsttxsrgxfqp\"},{\"id\":\"iceovxgzw\"},{\"id\":\"xyrujmt\"},{\"id\":\"eslikyohzixyqhf\"}],\"networkSecurityPerimeters\":[{\"id\":\"cqqqdseipn\",\"perimeterGuid\":\"wzxhrptyodlhkf\",\"location\":\"ltddsobjopnouh\"},{\"id\":\"ezkqxsalu\",\"perimeterGuid\":\"igfcvcewbwqhd\",\"location\":\"jsatm\"},{\"id\":\"c\",\"perimeterGuid\":\"zdfsqxhyqmr\",\"location\":\"parn\"},{\"id\":\"grszrbwtdrcwg\",\"perimeterGuid\":\"ll\",\"location\":\"lhhfi\"}],\"fullyQualifiedDomainNames\":[\"fculzjrmhpfyw\",\"yldqpzfzxsox\"],\"emailAddresses\":[\"nj\",\"zkdrocqsxy\",\"qqt\"],\"phoneNumbers\":[\"wdwisvn\",\"eylajamcajyhft\",\"zcrryklleynqa\",\"hkigglclwalhvub\"]}}") + .toObject(AccessRule.class); + Assertions.assertEquals("at", model.name()); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, model.properties().direction()); + Assertions.assertEquals("oqsqjghr", model.properties().addressPrefixes().get(0)); + Assertions.assertEquals("plwsttxsrgxfqp", model.properties().subscriptions().get(0).id()); + Assertions.assertEquals("cqqqdseipn", model.properties().networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals("wzxhrptyodlhkf", + model.properties().networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("ltddsobjopnouh", model.properties().networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("fculzjrmhpfyw", model.properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("nj", model.properties().emailAddresses().get(0)); + Assertions.assertEquals("wdwisvn", model.properties().phoneNumbers().get(0)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccountKeyMetadataTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccountKeyMetadataTests.java index 422dde36d2db..bb29b0340cd5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccountKeyMetadataTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AccountKeyMetadataTests.java @@ -10,7 +10,9 @@ public final class AccountKeyMetadataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AccountKeyMetadata model - = BinaryData.fromString("{\"generationTime\":\"2021-12-09T00:28:10Z\"}").toObject(AccountKeyMetadata.class); + AccountKeyMetadata model = BinaryData + .fromString( + "{\"generationTime\":\"2021-06-23T19:38:39Z\",\"approximateLastUsageTime\":\"2021-08-08T12:50:25Z\"}") + .toObject(AccountKeyMetadata.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ArmProxyResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ArmProxyResourceTests.java index f0a6f5c57111..ae910d00eac3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ArmProxyResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ArmProxyResourceTests.java @@ -10,8 +10,9 @@ public final class ArmProxyResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ArmProxyResource model = BinaryData.fromString("{\"id\":\"xpc\",\"name\":\"dnyeita\",\"type\":\"qady\"}") - .toObject(ArmProxyResource.class); + ArmProxyResource model + = BinaryData.fromString("{\"id\":\"oxsazuxejgwe\",\"name\":\"wnf\",\"type\":\"zzaczsinqbdn\"}") + .toObject(ArmProxyResource.class); } @org.junit.jupiter.api.Test diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ArmResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ArmResourcePropertiesTests.java index 6a03c6cc62c6..fc54eee2f5ee 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ArmResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ArmResourcePropertiesTests.java @@ -17,24 +17,26 @@ public final class ArmResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ArmResourceProperties model = BinaryData.fromString( - "{\"id\":\"xczfcl\",\"name\":\"axdbabph\",\"type\":\"rqlfktsthsucocmn\",\"location\":\"azt\",\"tags\":{\"uedck\":\"wwrq\",\"bxu\":\"ywbiexzfeyueax\"},\"identity\":{\"principalId\":\"hqwa\",\"tenantId\":\"uzyoxaep\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ytxhp\":{\"principalId\":\"cuxrhdwbavx\",\"clientId\":\"iwdjswztsdbpgn\"},\"wtctyqi\":{\"principalId\":\"bzpfzab\",\"clientId\":\"cuh\"}}}}") + "{\"id\":\"xzpuzycisp\",\"name\":\"zahmgkbrpyydhibn\",\"type\":\"qkpikadrgvtqagnb\",\"location\":\"nhijggmebfsi\",\"tags\":{\"pnazzm\":\"utrc\"},\"identity\":{\"principalId\":\"unmpxttd\",\"tenantId\":\"rbnlankxmyskp\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"haaxdbabphl\":{\"principalId\":\"kcxywnyt\",\"clientId\":\"synlqidybyxczfc\"},\"uedck\":{\"principalId\":\"qlfktsths\",\"clientId\":\"ocmnyyazttbtwwrq\"},\"hqwa\":{\"principalId\":\"wbiexzfey\",\"clientId\":\"axibxujw\"},\"d\":{\"principalId\":\"uzyoxaep\",\"clientId\":\"zjancuxr\"}}}}") .toObject(ArmResourceProperties.class); - Assertions.assertEquals("azt", model.location()); - Assertions.assertEquals("wwrq", model.tags().get("uedck")); - Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("nhijggmebfsi", model.location()); + Assertions.assertEquals("utrc", model.tags().get("pnazzm")); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ArmResourceProperties model = new ArmResourceProperties().withLocation("azt") - .withTags(mapOf("uedck", "wwrq", "bxu", "ywbiexzfeyueax")) - .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("ytxhp", new ManagedServiceIdentityUserAssignedIdentities(), - "wtctyqi", new ManagedServiceIdentityUserAssignedIdentities()))); + ArmResourceProperties model = new ArmResourceProperties().withLocation("nhijggmebfsi") + .withTags(mapOf("pnazzm", "utrc")) + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("haaxdbabphl", new ManagedServiceIdentityUserAssignedIdentities(), + "uedck", new ManagedServiceIdentityUserAssignedIdentities(), "hqwa", + new ManagedServiceIdentityUserAssignedIdentities(), "d", + new ManagedServiceIdentityUserAssignedIdentities()))); model = BinaryData.fromObject(model).toObject(ArmResourceProperties.class); - Assertions.assertEquals("azt", model.location()); - Assertions.assertEquals("wwrq", model.tags().get("uedck")); - Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("nhijggmebfsi", model.location()); + Assertions.assertEquals("utrc", model.tags().get("pnazzm")); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AutoUpgradePolicyResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AutoUpgradePolicyResourceTests.java index 3deae907667e..4a1386ddd853 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AutoUpgradePolicyResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AutoUpgradePolicyResourceTests.java @@ -13,18 +13,18 @@ public final class AutoUpgradePolicyResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutoUpgradePolicyResource model - = BinaryData.fromString("{\"throughputPolicy\":{\"isEnabled\":true,\"incrementPercent\":1810005859}}") + = BinaryData.fromString("{\"throughputPolicy\":{\"isEnabled\":true,\"incrementPercent\":1887864479}}") .toObject(AutoUpgradePolicyResource.class); Assertions.assertTrue(model.throughputPolicy().isEnabled()); - Assertions.assertEquals(1810005859, model.throughputPolicy().incrementPercent()); + Assertions.assertEquals(1887864479, model.throughputPolicy().incrementPercent()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AutoUpgradePolicyResource model = new AutoUpgradePolicyResource() - .withThroughputPolicy(new ThroughputPolicyResource().withIsEnabled(true).withIncrementPercent(1810005859)); + .withThroughputPolicy(new ThroughputPolicyResource().withIsEnabled(true).withIncrementPercent(1887864479)); model = BinaryData.fromObject(model).toObject(AutoUpgradePolicyResource.class); Assertions.assertTrue(model.throughputPolicy().isEnabled()); - Assertions.assertEquals(1810005859, model.throughputPolicy().incrementPercent()); + Assertions.assertEquals(1887864479, model.throughputPolicy().incrementPercent()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AutoscaleSettingsResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AutoscaleSettingsResourceTests.java index 08c989827e39..7270f1550afc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AutoscaleSettingsResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AutoscaleSettingsResourceTests.java @@ -14,21 +14,21 @@ public final class AutoscaleSettingsResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutoscaleSettingsResource model = BinaryData.fromString( - "{\"maxThroughput\":2127288077,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":false,\"incrementPercent\":1367034748}},\"targetMaxThroughput\":923273166}") + "{\"maxThroughput\":674255307,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":false,\"incrementPercent\":2090411231}},\"targetMaxThroughput\":1678517219}") .toObject(AutoscaleSettingsResource.class); - Assertions.assertEquals(2127288077, model.maxThroughput()); + Assertions.assertEquals(674255307, model.maxThroughput()); Assertions.assertFalse(model.autoUpgradePolicy().throughputPolicy().isEnabled()); - Assertions.assertEquals(1367034748, model.autoUpgradePolicy().throughputPolicy().incrementPercent()); + Assertions.assertEquals(2090411231, model.autoUpgradePolicy().throughputPolicy().incrementPercent()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AutoscaleSettingsResource model = new AutoscaleSettingsResource().withMaxThroughput(2127288077) + AutoscaleSettingsResource model = new AutoscaleSettingsResource().withMaxThroughput(674255307) .withAutoUpgradePolicy(new AutoUpgradePolicyResource().withThroughputPolicy( - new ThroughputPolicyResource().withIsEnabled(false).withIncrementPercent(1367034748))); + new ThroughputPolicyResource().withIsEnabled(false).withIncrementPercent(2090411231))); model = BinaryData.fromObject(model).toObject(AutoscaleSettingsResource.class); - Assertions.assertEquals(2127288077, model.maxThroughput()); + Assertions.assertEquals(674255307, model.maxThroughput()); Assertions.assertFalse(model.autoUpgradePolicy().throughputPolicy().isEnabled()); - Assertions.assertEquals(1367034748, model.autoUpgradePolicy().throughputPolicy().incrementPercent()); + Assertions.assertEquals(2090411231, model.autoUpgradePolicy().throughputPolicy().incrementPercent()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AutoscaleSettingsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AutoscaleSettingsTests.java index 1deb42735019..b04d39685d23 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AutoscaleSettingsTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AutoscaleSettingsTests.java @@ -12,14 +12,14 @@ public final class AutoscaleSettingsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutoscaleSettings model - = BinaryData.fromString("{\"maxThroughput\":1249324480}").toObject(AutoscaleSettings.class); - Assertions.assertEquals(1249324480, model.maxThroughput()); + = BinaryData.fromString("{\"maxThroughput\":1248397235}").toObject(AutoscaleSettings.class); + Assertions.assertEquals(1248397235, model.maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AutoscaleSettings model = new AutoscaleSettings().withMaxThroughput(1249324480); + AutoscaleSettings model = new AutoscaleSettings().withMaxThroughput(1248397235); model = BinaryData.fromObject(model).toObject(AutoscaleSettings.class); - Assertions.assertEquals(1249324480, model.maxThroughput()); + Assertions.assertEquals(1248397235, model.maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AzureBlobContainerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AzureBlobContainerTests.java new file mode 100644 index 000000000000..3b7a8b140903 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AzureBlobContainerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.AzureBlobContainer; +import org.junit.jupiter.api.Assertions; + +public final class AzureBlobContainerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureBlobContainer model + = BinaryData.fromString("{\"containerName\":\"cikhnv\"}").toObject(AzureBlobContainer.class); + Assertions.assertEquals("cikhnv", model.containerName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AzureBlobContainer model = new AzureBlobContainer().withContainerName("cikhnv"); + model = BinaryData.fromObject(model).toObject(AzureBlobContainer.class); + Assertions.assertEquals("cikhnv", model.containerName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AzureBlobDataTransferDataSourceSinkTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AzureBlobDataTransferDataSourceSinkTests.java new file mode 100644 index 000000000000..3f1ec8003675 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AzureBlobDataTransferDataSourceSinkTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.AzureBlobDataTransferDataSourceSink; +import org.junit.jupiter.api.Assertions; + +public final class AzureBlobDataTransferDataSourceSinkTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureBlobDataTransferDataSourceSink model = BinaryData + .fromString( + "{\"component\":\"AzureBlobStorage\",\"containerName\":\"slkyozd\",\"endpointUrl\":\"zjuegrh\"}") + .toObject(AzureBlobDataTransferDataSourceSink.class); + Assertions.assertEquals("slkyozd", model.containerName()); + Assertions.assertEquals("zjuegrh", model.endpointUrl()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AzureBlobDataTransferDataSourceSink model + = new AzureBlobDataTransferDataSourceSink().withContainerName("slkyozd").withEndpointUrl("zjuegrh"); + model = BinaryData.fromObject(model).toObject(AzureBlobDataTransferDataSourceSink.class); + Assertions.assertEquals("slkyozd", model.containerName()); + Assertions.assertEquals("zjuegrh", model.endpointUrl()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AzureBlobSourceSinkDetailsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AzureBlobSourceSinkDetailsTests.java new file mode 100644 index 000000000000..df113c81e240 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/AzureBlobSourceSinkDetailsTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.AzureBlobSourceSinkDetails; +import org.junit.jupiter.api.Assertions; + +public final class AzureBlobSourceSinkDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureBlobSourceSinkDetails model + = BinaryData.fromString("{\"endpointUrl\":\"y\"}").toObject(AzureBlobSourceSinkDetails.class); + Assertions.assertEquals("y", model.endpointUrl()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AzureBlobSourceSinkDetails model = new AzureBlobSourceSinkDetails().withEndpointUrl("y"); + model = BinaryData.fromObject(model).toObject(AzureBlobSourceSinkDetails.class); + Assertions.assertEquals("y", model.endpointUrl()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BackupInformationInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BackupInformationInnerTests.java index 712c59b7a78a..ce8b67aaee5c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BackupInformationInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BackupInformationInnerTests.java @@ -11,9 +11,9 @@ public final class BackupInformationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - BackupInformationInner model - = BinaryData.fromString("{\"continuousBackupInformation\":{\"latestRestorableTimestamp\":\"gxdbeesmie\"}}") - .toObject(BackupInformationInner.class); - Assertions.assertEquals("gxdbeesmie", model.continuousBackupInformation().latestRestorableTimestamp()); + BackupInformationInner model = BinaryData + .fromString("{\"continuousBackupInformation\":{\"latestRestorableTimestamp\":\"piljhahzvech\"}}") + .toObject(BackupInformationInner.class); + Assertions.assertEquals("piljhahzvech", model.continuousBackupInformation().latestRestorableTimestamp()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BackupResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BackupResourceInnerTests.java new file mode 100644 index 000000000000..77d49ffaa1fd --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BackupResourceInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.BackupResourceInner; +import com.azure.resourcemanager.cosmos.models.BackupState; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class BackupResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BackupResourceInner model = BinaryData.fromString( + "{\"backupId\":\"l\",\"backupState\":\"Succeeded\",\"backupStartTimestamp\":\"2021-11-29T11:37:38Z\",\"backupStopTimestamp\":\"2021-09-12T18:43:57Z\",\"backupExpiryTimestamp\":\"2021-01-10T23:42:04Z\"}") + .toObject(BackupResourceInner.class); + Assertions.assertEquals("l", model.backupId()); + Assertions.assertEquals(BackupState.SUCCEEDED, model.backupState()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-29T11:37:38Z"), model.backupStartTimestamp()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-12T18:43:57Z"), model.backupStopTimestamp()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-10T23:42:04Z"), model.backupExpiryTimestamp()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BackupScheduleTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BackupScheduleTests.java index d38437fdfcbc..39f96dd8a055 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BackupScheduleTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BackupScheduleTests.java @@ -11,22 +11,21 @@ public final class BackupScheduleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - BackupSchedule model = BinaryData - .fromString("{\"scheduleName\":\"fsxxby\",\"cronExpression\":\"sqlv\",\"retentionInHours\":1742759496}") - .toObject(BackupSchedule.class); - Assertions.assertEquals("fsxxby", model.scheduleName()); - Assertions.assertEquals("sqlv", model.cronExpression()); - Assertions.assertEquals(1742759496, model.retentionInHours()); + BackupSchedule model + = BinaryData.fromString("{\"scheduleName\":\"qh\",\"cronExpression\":\"p\",\"retentionInHours\":727688571}") + .toObject(BackupSchedule.class); + Assertions.assertEquals("qh", model.scheduleName()); + Assertions.assertEquals("p", model.cronExpression()); + Assertions.assertEquals(727688571, model.retentionInHours()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - BackupSchedule model = new BackupSchedule().withScheduleName("fsxxby") - .withCronExpression("sqlv") - .withRetentionInHours(1742759496); + BackupSchedule model + = new BackupSchedule().withScheduleName("qh").withCronExpression("p").withRetentionInHours(727688571); model = BinaryData.fromObject(model).toObject(BackupSchedule.class); - Assertions.assertEquals("fsxxby", model.scheduleName()); - Assertions.assertEquals("sqlv", model.cronExpression()); - Assertions.assertEquals(1742759496, model.retentionInHours()); + Assertions.assertEquals("qh", model.scheduleName()); + Assertions.assertEquals("p", model.cronExpression()); + Assertions.assertEquals(727688571, model.retentionInHours()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BaseCopyJobPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BaseCopyJobPropertiesTests.java new file mode 100644 index 000000000000..e3e8ced9571b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BaseCopyJobPropertiesTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.BaseCopyJobProperties; + +public final class BaseCopyJobPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BaseCopyJobProperties model + = BinaryData.fromString("{\"jobType\":\"BaseCopyJobProperties\"}").toObject(BaseCopyJobProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BaseCopyJobProperties model = new BaseCopyJobProperties(); + model = BinaryData.fromObject(model).toObject(BaseCopyJobProperties.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BaseCopyJobTaskTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BaseCopyJobTaskTests.java new file mode 100644 index 000000000000..56379e4efdae --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BaseCopyJobTaskTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.BaseCopyJobTask; + +public final class BaseCopyJobTaskTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BaseCopyJobTask model + = BinaryData.fromString("{\"totalCount\":3755443111078182446,\"processedCount\":4287611654348954436}") + .toObject(BaseCopyJobTask.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BaseCopyJobTask model = new BaseCopyJobTask(); + model = BinaryData.fromObject(model).toObject(BaseCopyJobTask.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BaseCosmosDataTransferDataSourceSinkTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BaseCosmosDataTransferDataSourceSinkTests.java new file mode 100644 index 000000000000..f421ebb40af2 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/BaseCosmosDataTransferDataSourceSinkTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.BaseCosmosDataTransferDataSourceSink; +import org.junit.jupiter.api.Assertions; + +public final class BaseCosmosDataTransferDataSourceSinkTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BaseCosmosDataTransferDataSourceSink model = BinaryData + .fromString("{\"component\":\"BaseCosmosDataTransferDataSourceSink\",\"remoteAccountName\":\"rhutf\"}") + .toObject(BaseCosmosDataTransferDataSourceSink.class); + Assertions.assertEquals("rhutf", model.remoteAccountName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BaseCosmosDataTransferDataSourceSink model + = new BaseCosmosDataTransferDataSourceSink().withRemoteAccountName("rhutf"); + model = BinaryData.fromObject(model).toObject(BaseCosmosDataTransferDataSourceSink.class); + Assertions.assertEquals("rhutf", model.remoteAccountName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CapacityModeChangeTransitionStateTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CapacityModeChangeTransitionStateTests.java new file mode 100644 index 000000000000..3bdb36b72fb4 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CapacityModeChangeTransitionStateTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CapacityMode; +import com.azure.resourcemanager.cosmos.models.CapacityModeChangeTransitionState; +import com.azure.resourcemanager.cosmos.models.CapacityModeTransitionStatus; +import org.junit.jupiter.api.Assertions; + +public final class CapacityModeChangeTransitionStateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CapacityModeChangeTransitionState model = BinaryData.fromString( + "{\"capacityModeTransitionStatus\":\"Failed\",\"currentCapacityMode\":\"Provisioned\",\"previousCapacityMode\":\"Serverless\",\"capacityModeTransitionBeginTimestamp\":\"2021-10-28T00:07:14Z\",\"capacityModeTransitionEndTimestamp\":\"2021-07-11T10:35:30Z\",\"capacityModeLastSuccessfulTransitionEndTimestamp\":\"2021-04-17T09:56:36Z\"}") + .toObject(CapacityModeChangeTransitionState.class); + Assertions.assertEquals(CapacityModeTransitionStatus.FAILED, model.capacityModeTransitionStatus()); + Assertions.assertEquals(CapacityMode.PROVISIONED, model.currentCapacityMode()); + Assertions.assertEquals(CapacityMode.SERVERLESS, model.previousCapacityMode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CapacityModeChangeTransitionState model = new CapacityModeChangeTransitionState() + .withCapacityModeTransitionStatus(CapacityModeTransitionStatus.FAILED) + .withCurrentCapacityMode(CapacityMode.PROVISIONED) + .withPreviousCapacityMode(CapacityMode.SERVERLESS); + model = BinaryData.fromObject(model).toObject(CapacityModeChangeTransitionState.class); + Assertions.assertEquals(CapacityModeTransitionStatus.FAILED, model.capacityModeTransitionStatus()); + Assertions.assertEquals(CapacityMode.PROVISIONED, model.currentCapacityMode()); + Assertions.assertEquals(CapacityMode.SERVERLESS, model.previousCapacityMode()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CapacityTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CapacityTests.java index 66fce3babaf5..9e160ac8b42c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CapacityTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CapacityTests.java @@ -11,14 +11,14 @@ public final class CapacityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Capacity model = BinaryData.fromString("{\"totalThroughputLimit\":212177726}").toObject(Capacity.class); - Assertions.assertEquals(212177726, model.totalThroughputLimit()); + Capacity model = BinaryData.fromString("{\"totalThroughputLimit\":2139015356}").toObject(Capacity.class); + Assertions.assertEquals(2139015356, model.totalThroughputLimit()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Capacity model = new Capacity().withTotalThroughputLimit(212177726); + Capacity model = new Capacity().withTotalThroughputLimit(2139015356); model = BinaryData.fromObject(model).toObject(Capacity.class); - Assertions.assertEquals(212177726, model.totalThroughputLimit()); + Assertions.assertEquals(2139015356, model.totalThroughputLimit()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceCreateUpdateParametersTests.java index bdd5d7e36d83..ce269fba2c4b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceCreateUpdateParametersTests.java @@ -20,33 +20,34 @@ public final class CassandraKeyspaceCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraKeyspaceCreateUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"id\":\"tdgukvlbp\"},\"options\":{\"throughput\":1914645473,\"autoscaleSettings\":{\"maxThroughput\":8081594}}},\"id\":\"uambewreswmowegm\",\"name\":\"teyxeyguq\",\"type\":\"ijiitns\",\"location\":\"lz\",\"tags\":{\"jwaiuf\":\"ygr\",\"aybfu\":\"n\"},\"identity\":{\"principalId\":\"rojsydg\",\"tenantId\":\"ydkygywezskieca\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"xawoijpodtblxp\":{\"principalId\":\"ieqvds\",\"clientId\":\"klixqcahyhxaly\"}}}}") + "{\"properties\":{\"resource\":{\"id\":\"ezkiswqjmdghsypa\"},\"options\":{\"throughput\":2024323319,\"autoscaleSettings\":{\"maxThroughput\":191485279}}},\"id\":\"bjczjnciuiyqvlda\",\"name\":\"v\",\"type\":\"i\",\"location\":\"qzlgcndhzxrrfcfs\",\"tags\":{\"fsbzxlbzxo\":\"hgsnxuwwkpph\",\"nmwpf\":\"eikjclwza\",\"uqqiqezxlhd\":\"uqtaazyqbxyxoyf\",\"cadwvpsozjii\":\"zq\"},\"identity\":{\"principalId\":\"iybmrzoep\",\"tenantId\":\"wdvwnjkgvfnmx\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"rfqjpnqnoo\":{\"principalId\":\"tibtyi\",\"clientId\":\"yvp\"}}}}") .toObject(CassandraKeyspaceCreateUpdateParameters.class); - Assertions.assertEquals("lz", model.location()); - Assertions.assertEquals("ygr", model.tags().get("jwaiuf")); + Assertions.assertEquals("qzlgcndhzxrrfcfs", model.location()); + Assertions.assertEquals("hgsnxuwwkpph", model.tags().get("fsbzxlbzxo")); Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("tdgukvlbp", model.resource().id()); - Assertions.assertEquals(1914645473, model.options().throughput()); - Assertions.assertEquals(8081594, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("ezkiswqjmdghsypa", model.resource().id()); + Assertions.assertEquals(2024323319, model.options().throughput()); + Assertions.assertEquals(191485279, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CassandraKeyspaceCreateUpdateParameters model = new CassandraKeyspaceCreateUpdateParameters().withLocation("lz") - .withTags(mapOf("jwaiuf", "ygr", "aybfu", "n")) + CassandraKeyspaceCreateUpdateParameters model = new CassandraKeyspaceCreateUpdateParameters() + .withLocation("qzlgcndhzxrrfcfs") + .withTags(mapOf("fsbzxlbzxo", "hgsnxuwwkpph", "nmwpf", "eikjclwza", "uqqiqezxlhd", "uqtaazyqbxyxoyf", + "cadwvpsozjii", "zq")) .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("xawoijpodtblxp", new ManagedServiceIdentityUserAssignedIdentities()))) - .withResource(new CassandraKeyspaceResource().withId("tdgukvlbp")) - .withOptions(new CreateUpdateOptions().withThroughput(1914645473) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(8081594))); + .withUserAssignedIdentities(mapOf("rfqjpnqnoo", new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource(new CassandraKeyspaceResource().withId("ezkiswqjmdghsypa")) + .withOptions(new CreateUpdateOptions().withThroughput(2024323319) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(191485279))); model = BinaryData.fromObject(model).toObject(CassandraKeyspaceCreateUpdateParameters.class); - Assertions.assertEquals("lz", model.location()); - Assertions.assertEquals("ygr", model.tags().get("jwaiuf")); + Assertions.assertEquals("qzlgcndhzxrrfcfs", model.location()); + Assertions.assertEquals("hgsnxuwwkpph", model.tags().get("fsbzxlbzxo")); Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("tdgukvlbp", model.resource().id()); - Assertions.assertEquals(1914645473, model.options().throughput()); - Assertions.assertEquals(8081594, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("ezkiswqjmdghsypa", model.resource().id()); + Assertions.assertEquals(2024323319, model.options().throughput()); + Assertions.assertEquals(191485279, model.options().autoscaleSettings().maxThroughput()); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceCreateUpdatePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceCreateUpdatePropertiesTests.java index a088a7d1dee7..bf2e338f346a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceCreateUpdatePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceCreateUpdatePropertiesTests.java @@ -15,22 +15,22 @@ public final class CassandraKeyspaceCreateUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraKeyspaceCreateUpdateProperties model = BinaryData.fromString( - "{\"resource\":{\"id\":\"kwjdjodqhy\"},\"options\":{\"throughput\":989850966,\"autoscaleSettings\":{\"maxThroughput\":79047446}}}") + "{\"resource\":{\"id\":\"sbede\"},\"options\":{\"throughput\":2100639848,\"autoscaleSettings\":{\"maxThroughput\":1063056742}}}") .toObject(CassandraKeyspaceCreateUpdateProperties.class); - Assertions.assertEquals("kwjdjodqhy", model.resource().id()); - Assertions.assertEquals(989850966, model.options().throughput()); - Assertions.assertEquals(79047446, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("sbede", model.resource().id()); + Assertions.assertEquals(2100639848, model.options().throughput()); + Assertions.assertEquals(1063056742, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CassandraKeyspaceCreateUpdateProperties model = new CassandraKeyspaceCreateUpdateProperties() - .withResource(new CassandraKeyspaceResource().withId("kwjdjodqhy")) - .withOptions(new CreateUpdateOptions().withThroughput(989850966) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(79047446))); + .withResource(new CassandraKeyspaceResource().withId("sbede")) + .withOptions(new CreateUpdateOptions().withThroughput(2100639848) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1063056742))); model = BinaryData.fromObject(model).toObject(CassandraKeyspaceCreateUpdateProperties.class); - Assertions.assertEquals("kwjdjodqhy", model.resource().id()); - Assertions.assertEquals(989850966, model.options().throughput()); - Assertions.assertEquals(79047446, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("sbede", model.resource().id()); + Assertions.assertEquals(2100639848, model.options().throughput()); + Assertions.assertEquals(1063056742, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetPropertiesOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetPropertiesOptionsTests.java index 8c2c350d3f97..c83df059b4a3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetPropertiesOptionsTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetPropertiesOptionsTests.java @@ -12,9 +12,9 @@ public final class CassandraKeyspaceGetPropertiesOptionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraKeyspaceGetPropertiesOptions model - = BinaryData.fromString("{\"throughput\":1079278403,\"autoscaleSettings\":{\"maxThroughput\":11369007}}") + = BinaryData.fromString("{\"throughput\":1812101895,\"autoscaleSettings\":{\"maxThroughput\":1560709540}}") .toObject(CassandraKeyspaceGetPropertiesOptions.class); - Assertions.assertEquals(1079278403, model.throughput()); - Assertions.assertEquals(11369007, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1812101895, model.throughput()); + Assertions.assertEquals(1560709540, model.autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetPropertiesResourceTests.java index 584c418d5676..a42c7a5eb120 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetPropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetPropertiesResourceTests.java @@ -12,8 +12,8 @@ public final class CassandraKeyspaceGetPropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraKeyspaceGetPropertiesResource model = BinaryData - .fromString("{\"_rid\":\"fngq\",\"_ts\":56.76762,\"_etag\":\"dftujwjjufwbeqr\",\"id\":\"uorhtssruqnmdvh\"}") + .fromString("{\"_rid\":\"gn\",\"_ts\":89.98291,\"_etag\":\"eewoiymrvzb\",\"id\":\"uyrsrziuctix\"}") .toObject(CassandraKeyspaceGetPropertiesResource.class); - Assertions.assertEquals("uorhtssruqnmdvh", model.id()); + Assertions.assertEquals("uyrsrziuctix", model.id()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetPropertiesTests.java index 3baa9033ada5..1064147efe3c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetPropertiesTests.java @@ -12,10 +12,10 @@ public final class CassandraKeyspaceGetPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraKeyspaceGetProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"hufmpq\",\"_ts\":1.5317738,\"_etag\":\"jgydzul\",\"id\":\"dsaeuzanhsfnh\"},\"options\":{\"throughput\":440946587,\"autoscaleSettings\":{\"maxThroughput\":470751726}}}") + "{\"resource\":{\"_rid\":\"ltfnnxrkad\",\"_ts\":55.375187,\"_etag\":\"nfmuiiiripf\",\"id\":\"hykfkxbb\"},\"options\":{\"throughput\":360564631,\"autoscaleSettings\":{\"maxThroughput\":8699305}}}") .toObject(CassandraKeyspaceGetProperties.class); - Assertions.assertEquals("dsaeuzanhsfnh", model.resource().id()); - Assertions.assertEquals(440946587, model.options().throughput()); - Assertions.assertEquals(470751726, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("hykfkxbb", model.resource().id()); + Assertions.assertEquals(360564631, model.options().throughput()); + Assertions.assertEquals(8699305, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetResultsInnerTests.java index b74f82aa079b..7b48daac51b0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetResultsInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceGetResultsInnerTests.java @@ -13,13 +13,13 @@ public final class CassandraKeyspaceGetResultsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraKeyspaceGetResultsInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"qcwgaxfgvaknokz\",\"_ts\":68.62356,\"_etag\":\"r\",\"id\":\"tixldzyyfytpqs\"},\"options\":{\"throughput\":1286470793,\"autoscaleSettings\":{\"maxThroughput\":1092655779}}},\"location\":\"ivyqlkjuvsmbmsl\",\"tags\":{\"mx\":\"ovwzdbpqvybefg\",\"vcuartrhun\":\"okcvtlubses\",\"reuykbbmnwagl\":\"pirykycndzfqiv\"},\"identity\":{\"principalId\":\"oeeonqlnfwm\",\"tenantId\":\"mvqdbpbhfckdvez\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"alehpav\":{\"principalId\":\"zhddubbnqf\",\"clientId\":\"h\"},\"teajohiyg\":{\"principalId\":\"ugiqjtiogqg\",\"clientId\":\"inic\"}}},\"id\":\"n\",\"name\":\"onhpcz\",\"type\":\"kmktpvwxqcseh\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"umyw\",\"_ts\":47.70764,\"_etag\":\"xgo\",\"id\":\"oyjfqipu\"},\"options\":{\"throughput\":68265470,\"autoscaleSettings\":{\"maxThroughput\":94013318}}},\"location\":\"ke\",\"tags\":{\"m\":\"vop\"},\"identity\":{\"principalId\":\"qujlyegqa\",\"tenantId\":\"igflqqbtnyjp\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"baevwjcnkottl\":{\"principalId\":\"vabm\",\"clientId\":\"s\"}}},\"id\":\"hvajmailfemjjzak\",\"name\":\"wjiqullqxb\",\"type\":\"mvrscmqerndbrny\"}") .toObject(CassandraKeyspaceGetResultsInner.class); - Assertions.assertEquals("ivyqlkjuvsmbmsl", model.location()); - Assertions.assertEquals("ovwzdbpqvybefg", model.tags().get("mx")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("tixldzyyfytpqs", model.resource().id()); - Assertions.assertEquals(1286470793, model.options().throughput()); - Assertions.assertEquals(1092655779, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("ke", model.location()); + Assertions.assertEquals("vop", model.tags().get("m")); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("oyjfqipu", model.resource().id()); + Assertions.assertEquals(68265470, model.options().throughput()); + Assertions.assertEquals(94013318, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceListResultTests.java index 9ec451a669f3..9e2150dbbffc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceListResultTests.java @@ -12,8 +12,8 @@ public final class CassandraKeyspaceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraKeyspaceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"izhceumoqodkadp\",\"_ts\":60.23653,\"_etag\":\"ngqladywrx\",\"id\":\"hydt\"},\"options\":{\"throughput\":1662063978,\"autoscaleSettings\":{\"maxThroughput\":1449134162}}},\"location\":\"zsn\",\"tags\":{\"lnwy\":\"mlowuowhl\",\"mo\":\"mouvbl\",\"ih\":\"zkltrfowtdvrfmv\"},\"identity\":{\"principalId\":\"drqc\",\"tenantId\":\"idhftu\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"tqxmbj\":{\"principalId\":\"wyojbfqzdkfnjyi\",\"clientId\":\"afr\"},\"ywpvt\":{\"principalId\":\"umzznvalqjrhuz\",\"clientId\":\"xonjtpusl\"}}},\"id\":\"tzbpdbollgry\",\"name\":\"qiuasigrows\",\"type\":\"c\"},{\"properties\":{\"resource\":{\"_rid\":\"ygdjboqgrmtqjk\",\"_ts\":34.21506,\"_etag\":\"drmmwiuawvcmjz\",\"id\":\"xiid\"},\"options\":{\"throughput\":2054278648,\"autoscaleSettings\":{\"maxThroughput\":1531746992}}},\"location\":\"woqiqazugamxzkrr\",\"tags\":{\"kuztdsbezaxyfu\":\"isbamnppcc\"},\"identity\":{\"principalId\":\"uizh\",\"tenantId\":\"nepk\",\"type\":\"None\",\"userAssignedIdentities\":{\"dblnsntrp\":{\"principalId\":\"xqiubxdukecpx\",\"clientId\":\"zvdhctmmkosz\"},\"ezyquw\":{\"principalId\":\"qkio\",\"clientId\":\"btfmhklbnldpvcbh\"}}},\"id\":\"qxutrpbrruyuua\",\"name\":\"vlm\",\"type\":\"jwcolbm\"},{\"properties\":{\"resource\":{\"_rid\":\"w\",\"_ts\":70.82039,\"_etag\":\"ahprzrvxhmtfhocn\",\"id\":\"zcmjhngxnoqrxt\"},\"options\":{\"throughput\":1339031940,\"autoscaleSettings\":{\"maxThroughput\":848846708}}},\"location\":\"d\",\"tags\":{\"hepfwwtjfdoes\":\"did\",\"dbckyo\":\"xhmw\",\"jzrbhtmeplv\":\"kxkxhnegk\",\"pgsn\":\"kaobrl\"},\"identity\":{\"principalId\":\"nchjhgemuowakywa\",\"tenantId\":\"jymxcgqt\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"nlbvgjcodkk\":{\"principalId\":\"ssoljom\",\"clientId\":\"tfy\"},\"z\":{\"principalId\":\"iiy\",\"clientId\":\"sik\"},\"ekxgn\":{\"principalId\":\"ufqbvntnr\",\"clientId\":\"qsorh\"},\"lwxlboncqbazq\":{\"principalId\":\"km\",\"clientId\":\"pwzvmdoksqdti\"}}},\"id\":\"qchygtv\",\"name\":\"byjanep\",\"type\":\"bdpkxyqvgx\"}],\"nextLink\":\"od\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"nul\",\"_ts\":14.888406,\"_etag\":\"jevdyznf\",\"id\":\"jsvkskmqozzkivy\"},\"options\":{\"throughput\":1187773195,\"autoscaleSettings\":{\"maxThroughput\":793376445}}},\"location\":\"ixlqfhefkwabsolr\",\"tags\":{\"lexhv\":\"qlmgnlqxsjxt\",\"rkuz\":\"qbozoolzqoc\",\"ndtsnxawqytll\":\"bc\",\"yckzex\":\"dyz\"},\"identity\":{\"principalId\":\"kck\",\"tenantId\":\"ymx\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"y\":{\"principalId\":\"dtfohfaog\",\"clientId\":\"kiwrsiw\"},\"gdda\":{\"principalId\":\"urykcrraueekcs\",\"clientId\":\"h\"}}},\"id\":\"cbgydlqi\",\"name\":\"ywmhmptyrilkfbnr\",\"type\":\"qxvztpbnfnqtxjt\"},{\"properties\":{\"resource\":{\"_rid\":\"swbnfddepldwqjns\",\"_ts\":42.675285,\"_etag\":\"leexahvmywh\",\"id\":\"brcary\"},\"options\":{\"throughput\":255556619,\"autoscaleSettings\":{\"maxThroughput\":1953070260}}},\"location\":\"aqaj\",\"tags\":{\"hmpful\":\"hzptdmkrr\",\"gybpmfb\":\"be\"},\"identity\":{\"principalId\":\"unmpzkrvfyifkdsc\",\"tenantId\":\"zvfictnk\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"dfpdqwtygevg\":{\"principalId\":\"nphbkgfyrt\",\"clientId\":\"mhmjpjs\"},\"n\":{\"principalId\":\"sehar\",\"clientId\":\"fv\"},\"akftng\":{\"principalId\":\"tmbpjp\",\"clientId\":\"vwjhrsidqpxlbt\"},\"cvjqdv\":{\"principalId\":\"wmykyutry\",\"clientId\":\"wmfjhp\"}}},\"id\":\"kqpldrle\",\"name\":\"gnaavu\",\"type\":\"gnteta\"}],\"nextLink\":\"tnpdctuhspfefy\"}") .toObject(CassandraKeyspaceListResult.class); - Assertions.assertEquals("od", model.nextLink()); + Assertions.assertEquals("tnpdctuhspfefy", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceResourceTests.java index 5b8b8dc19ef0..8cb8a24cbf27 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraKeyspaceResourceTests.java @@ -12,14 +12,14 @@ public final class CassandraKeyspaceResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraKeyspaceResource model - = BinaryData.fromString("{\"id\":\"zcvjytiqswbqerz\"}").toObject(CassandraKeyspaceResource.class); - Assertions.assertEquals("zcvjytiqswbqerz", model.id()); + = BinaryData.fromString("{\"id\":\"bdsuifr\"}").toObject(CassandraKeyspaceResource.class); + Assertions.assertEquals("bdsuifr", model.id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CassandraKeyspaceResource model = new CassandraKeyspaceResource().withId("zcvjytiqswbqerz"); + CassandraKeyspaceResource model = new CassandraKeyspaceResource().withId("bdsuifr"); model = BinaryData.fromObject(model).toObject(CassandraKeyspaceResource.class); - Assertions.assertEquals("zcvjytiqswbqerz", model.id()); + Assertions.assertEquals("bdsuifr", model.id()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraPartitionKeyTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraPartitionKeyTests.java index 1f995aceaf3e..a82dbdcb0c3c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraPartitionKeyTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraPartitionKeyTests.java @@ -12,14 +12,14 @@ public final class CassandraPartitionKeyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraPartitionKey model - = BinaryData.fromString("{\"name\":\"tuoqujlyegqavni\"}").toObject(CassandraPartitionKey.class); - Assertions.assertEquals("tuoqujlyegqavni", model.name()); + = BinaryData.fromString("{\"name\":\"cjkay\"}").toObject(CassandraPartitionKey.class); + Assertions.assertEquals("cjkay", model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CassandraPartitionKey model = new CassandraPartitionKey().withName("tuoqujlyegqavni"); + CassandraPartitionKey model = new CassandraPartitionKey().withName("cjkay"); model = BinaryData.fromObject(model).toObject(CassandraPartitionKey.class); - Assertions.assertEquals("tuoqujlyegqavni", model.name()); + Assertions.assertEquals("cjkay", model.name()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleAssignmentListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleAssignmentListResultTests.java index b825c9f3ba63..fd122d887b6f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleAssignmentListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleAssignmentListResultTests.java @@ -12,11 +12,11 @@ public final class CassandraRoleAssignmentListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraRoleAssignmentListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"roleDefinitionId\":\"awn\",\"scope\":\"mlnkoywsxv\",\"principalId\":\"bjqqaxuyvymcn\",\"provisioningState\":\"ndoabhjxwxqweuip\"},\"id\":\"vk\",\"name\":\"m\",\"type\":\"tnsqxtlt\"},{\"properties\":{\"roleDefinitionId\":\"rdpqgfhy\",\"scope\":\"rakkld\",\"principalId\":\"c\",\"provisioningState\":\"cmfcnrjajq\"},\"id\":\"txjtielnzqgx\",\"name\":\"gfb\",\"type\":\"mtlpqagyno\"},{\"properties\":{\"roleDefinitionId\":\"n\",\"scope\":\"ali\",\"principalId\":\"ryqxzxa\",\"provisioningState\":\"ibmq\"},\"id\":\"iymqr\",\"name\":\"qguhfupetasvvo\",\"type\":\"sbpkf\"}],\"nextLink\":\"nfkgxsyaowuzowpu\"}") + "{\"value\":[{\"properties\":{\"roleDefinitionId\":\"xbteogfgfiijryk\",\"scope\":\"efksxqceaz\",\"principalId\":\"xgnmqvzvluyq\",\"provisioningState\":\"ios\"},\"id\":\"cyvaifppuacvfy\",\"name\":\"owpsfxt\",\"type\":\"dhsoymhpv\"}],\"nextLink\":\"qfttehdpboujs\"}") .toObject(CassandraRoleAssignmentListResult.class); - Assertions.assertEquals("awn", model.value().get(0).roleDefinitionId()); - Assertions.assertEquals("mlnkoywsxv", model.value().get(0).scope()); - Assertions.assertEquals("bjqqaxuyvymcn", model.value().get(0).principalId()); - Assertions.assertEquals("nfkgxsyaowuzowpu", model.nextLink()); + Assertions.assertEquals("xbteogfgfiijryk", model.value().get(0).roleDefinitionId()); + Assertions.assertEquals("efksxqceaz", model.value().get(0).scope()); + Assertions.assertEquals("xgnmqvzvluyq", model.value().get(0).principalId()); + Assertions.assertEquals("qfttehdpboujs", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleAssignmentResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleAssignmentResourceInnerTests.java index 9faa22491353..ce88629f69ff 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleAssignmentResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleAssignmentResourceInnerTests.java @@ -12,22 +12,22 @@ public final class CassandraRoleAssignmentResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraRoleAssignmentResourceInner model = BinaryData.fromString( - "{\"properties\":{\"roleDefinitionId\":\"gatolekscbctnan\",\"scope\":\"mwbzxpdc\",\"principalId\":\"pkawnsnlaim\",\"provisioningState\":\"xwksq\"},\"id\":\"dmfcoibicziusws\",\"name\":\"jrkbqsjhbtqqvyfs\",\"type\":\"yrfwbivq\"}") + "{\"properties\":{\"roleDefinitionId\":\"yhgww\",\"scope\":\"uxdbdljzgdyrcvuq\",\"principalId\":\"gzlrqhbj\",\"provisioningState\":\"ogdxwbsfpyxxtjlf\"},\"id\":\"cominxojjluxx\",\"name\":\"hilzzdzzq\",\"type\":\"mueza\"}") .toObject(CassandraRoleAssignmentResourceInner.class); - Assertions.assertEquals("gatolekscbctnan", model.roleDefinitionId()); - Assertions.assertEquals("mwbzxpdc", model.scope()); - Assertions.assertEquals("pkawnsnlaim", model.principalId()); + Assertions.assertEquals("yhgww", model.roleDefinitionId()); + Assertions.assertEquals("uxdbdljzgdyrcvuq", model.scope()); + Assertions.assertEquals("gzlrqhbj", model.principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CassandraRoleAssignmentResourceInner model - = new CassandraRoleAssignmentResourceInner().withRoleDefinitionId("gatolekscbctnan") - .withScope("mwbzxpdc") - .withPrincipalId("pkawnsnlaim"); + = new CassandraRoleAssignmentResourceInner().withRoleDefinitionId("yhgww") + .withScope("uxdbdljzgdyrcvuq") + .withPrincipalId("gzlrqhbj"); model = BinaryData.fromObject(model).toObject(CassandraRoleAssignmentResourceInner.class); - Assertions.assertEquals("gatolekscbctnan", model.roleDefinitionId()); - Assertions.assertEquals("mwbzxpdc", model.scope()); - Assertions.assertEquals("pkawnsnlaim", model.principalId()); + Assertions.assertEquals("yhgww", model.roleDefinitionId()); + Assertions.assertEquals("uxdbdljzgdyrcvuq", model.scope()); + Assertions.assertEquals("gzlrqhbj", model.principalId()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleAssignmentResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleAssignmentResourcePropertiesTests.java index bf011626d88c..20a0ce47c34f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleAssignmentResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleAssignmentResourcePropertiesTests.java @@ -12,22 +12,22 @@ public final class CassandraRoleAssignmentResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraRoleAssignmentResourceProperties model = BinaryData.fromString( - "{\"roleDefinitionId\":\"gfuyzwv\",\"scope\":\"limbyqecroodlik\",\"principalId\":\"rdaasaxxo\",\"provisioningState\":\"mfkwiyjvzuk\"}") + "{\"roleDefinitionId\":\"vribqlotokht\",\"scope\":\"taznkcqwwxwjyof\",\"principalId\":\"hnkbtlwljssmctsn\",\"provisioningState\":\"kpwolg\"}") .toObject(CassandraRoleAssignmentResourceProperties.class); - Assertions.assertEquals("gfuyzwv", model.roleDefinitionId()); - Assertions.assertEquals("limbyqecroodlik", model.scope()); - Assertions.assertEquals("rdaasaxxo", model.principalId()); + Assertions.assertEquals("vribqlotokht", model.roleDefinitionId()); + Assertions.assertEquals("taznkcqwwxwjyof", model.scope()); + Assertions.assertEquals("hnkbtlwljssmctsn", model.principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CassandraRoleAssignmentResourceProperties model - = new CassandraRoleAssignmentResourceProperties().withRoleDefinitionId("gfuyzwv") - .withScope("limbyqecroodlik") - .withPrincipalId("rdaasaxxo"); + = new CassandraRoleAssignmentResourceProperties().withRoleDefinitionId("vribqlotokht") + .withScope("taznkcqwwxwjyof") + .withPrincipalId("hnkbtlwljssmctsn"); model = BinaryData.fromObject(model).toObject(CassandraRoleAssignmentResourceProperties.class); - Assertions.assertEquals("gfuyzwv", model.roleDefinitionId()); - Assertions.assertEquals("limbyqecroodlik", model.scope()); - Assertions.assertEquals("rdaasaxxo", model.principalId()); + Assertions.assertEquals("vribqlotokht", model.roleDefinitionId()); + Assertions.assertEquals("taznkcqwwxwjyof", model.scope()); + Assertions.assertEquals("hnkbtlwljssmctsn", model.principalId()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleDefinitionListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleDefinitionListResultTests.java index 735debfc4bc3..5e579022be89 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleDefinitionListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleDefinitionListResultTests.java @@ -13,15 +13,15 @@ public final class CassandraRoleDefinitionListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraRoleDefinitionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"id\":\"eharxifv\",\"roleName\":\"rxtmbpjptnvw\",\"type\":\"CustomRole\",\"assignableScopes\":[\"dqpx\",\"btpakftngatw\",\"ykyutrymdwmfj\",\"pycvjqdvdwkqpldr\"],\"permissions\":[{\"id\":\"naa\",\"dataActions\":[\"gnteta\",\"utnpdctuhspfefyi\"],\"notDataActions\":[\"yeuyldph\",\"tybkcgs\"]},{\"id\":\"h\",\"dataActions\":[\"nmwynefxexl\"],\"notDataActions\":[\"atxtjrrlkmdskjhh\"]},{\"id\":\"lajfoxcxscvslxlh\",\"dataActions\":[\"krmukmyjmkxett\",\"slojfkqidnqt\",\"qxjhqxcsqhtkbtnq\"],\"notDataActions\":[\"gldmbiipsnaww\",\"qkzn\",\"hhl\"]},{\"id\":\"ricctkwmuqqoa\",\"dataActions\":[\"iygle\",\"rwvaexhdc\",\"rceqnkbrupob\",\"hdmljz\"],\"notDataActions\":[\"umepjpbibn\"]}]},\"id\":\"phepifexleqirc\",\"name\":\"jclykcg\",\"type\":\"vrpjlvczuodacp\"},{\"properties\":{\"id\":\"ttepdjxqe\",\"roleName\":\"oy\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"pckaewse\",\"vesk\",\"xegqphr\",\"fn\"],\"permissions\":[{\"id\":\"mjtsgh\",\"dataActions\":[\"bcpzarpzeqacdldt\"],\"notDataActions\":[\"ypefcpczshnuqnda\",\"zupfkhuytuszxhm\",\"vtvegwqiukvzw\",\"dwttha\"]},{\"id\":\"gkskjivbss\",\"dataActions\":[\"qfukpeexpgeumi\"],\"notDataActions\":[\"uitrdexyiono\"]},{\"id\":\"inbd\",\"dataActions\":[\"xcwqqrsmpc\"],\"notDataActions\":[\"rtugavbzbcyks\",\"vm\"]},{\"id\":\"gd\",\"dataActions\":[\"fcmkr\",\"tsjcwjjxs\",\"mb\"],\"notDataActions\":[\"ifdxkecifhocjxw\",\"loozrvt\",\"vcmuf\",\"nlcpxxviry\"]}]},\"id\":\"ngjgvrquvpyg\",\"name\":\"lpmcrdc\",\"type\":\"eljtiahxmfqryarv\"},{\"properties\":{\"id\":\"qbglcjkaysp\",\"roleName\":\"zodubtlm\",\"type\":\"CustomRole\",\"assignableScopes\":[\"ioskkfmkmfdjxyxg\",\"kkqvjcteoedl\",\"slskkz\",\"xv\"],\"permissions\":[{\"id\":\"pvocojhpcna\",\"dataActions\":[\"fsnggytexvzilm\"],\"notDataActions\":[\"zkwwwn\",\"knrzdajlskzpt\",\"xulweucyrthxqle\"]}]},\"id\":\"cgcjeinuehokamv\",\"name\":\"ejvqnt\",\"type\":\"mbqdabzfivfo\"},{\"properties\":{\"id\":\"sthhzagjfwy\",\"roleName\":\"lhgenuzejgvkv\",\"type\":\"CustomRole\",\"assignableScopes\":[\"zllrz\",\"smmd\",\"gmihzpimcqr\",\"nxtminklog\"],\"permissions\":[{\"id\":\"zarhzvqnsqktcmbj\",\"dataActions\":[\"oslpky\",\"tglwkzpgajsqjc\",\"mqbmfuvqarwz\"],\"notDataActions\":[\"rebluimmbwxsf\",\"td\"]}]},\"id\":\"vxekraokqkbud\",\"name\":\"twaokb\",\"type\":\"vlyttaaknwfrke\"}],\"nextLink\":\"mhpdu\"}") + "{\"value\":[{\"properties\":{\"id\":\"wxwy\",\"roleName\":\"c\",\"type\":\"CustomRole\",\"assignableScopes\":[\"ipcukdveks\"],\"permissions\":[{\"id\":\"duchvls\",\"dataActions\":[\"pibfdy\"],\"notDataActions\":[\"sspyszekbh\",\"lkaaggkr\",\"hbfrnuybfflj\"]},{\"id\":\"imreoag\",\"dataActions\":[\"aadusrexxfa\",\"sqwudohzilfmnli\"],\"notDataActions\":[\"i\",\"s\",\"eypofqpm\",\"hyqgsdrmmttjx\"]},{\"id\":\"hgerhsmvg\",\"dataActions\":[\"wzm\",\"ilrixysf\",\"imsqywwwmhk\",\"uwaedrympmlqoi\"],\"notDataActions\":[\"duewihapfj\",\"iknj\",\"iqfl\",\"ejhpclbiedfsbwc\"]}]},\"id\":\"vbvzipbwxgo\",\"name\":\"oxzpr\",\"type\":\"dmskxknpdgzigjsu\"},{\"properties\":{\"id\":\"hgsaodkwwn\",\"roleName\":\"foct\",\"type\":\"CustomRole\",\"assignableScopes\":[\"quvwsxbgn\",\"kerv\",\"choadhrsxqv\",\"vspabdsrgfajgl\"],\"permissions\":[{\"id\":\"bklrxh\",\"dataActions\":[\"tcetjdv\",\"ydi\",\"q\"],\"notDataActions\":[\"aruwdxvqzxoebw\"]},{\"id\":\"xbibanbaupw\",\"dataActions\":[\"pak\",\"ozkxbzrpejplss\",\"nbtttkgsuxu\"],\"notDataActions\":[\"wgkpjhboyikebh\",\"hkslgwlokhueoij\",\"zcqypzqzufgsyf\",\"jyvdwtfxptpqayam\"]}]},\"id\":\"cf\",\"name\":\"ybmx\",\"type\":\"nxocuul\"}],\"nextLink\":\"j\"}") .toObject(CassandraRoleDefinitionListResult.class); - Assertions.assertEquals("eharxifv", model.value().get(0).idPropertiesId()); - Assertions.assertEquals("rxtmbpjptnvw", model.value().get(0).roleName()); + Assertions.assertEquals("wxwy", model.value().get(0).idPropertiesId()); + Assertions.assertEquals("c", model.value().get(0).roleName()); Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.value().get(0).typePropertiesType()); - Assertions.assertEquals("dqpx", model.value().get(0).assignableScopes().get(0)); - Assertions.assertEquals("naa", model.value().get(0).permissions().get(0).id()); - Assertions.assertEquals("gnteta", model.value().get(0).permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("yeuyldph", model.value().get(0).permissions().get(0).notDataActions().get(0)); - Assertions.assertEquals("mhpdu", model.nextLink()); + Assertions.assertEquals("ipcukdveks", model.value().get(0).assignableScopes().get(0)); + Assertions.assertEquals("duchvls", model.value().get(0).permissions().get(0).id()); + Assertions.assertEquals("pibfdy", model.value().get(0).permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("sspyszekbh", model.value().get(0).permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("j", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleDefinitionResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleDefinitionResourceInnerTests.java index a67de57c6db4..f4832ba85d0f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleDefinitionResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleDefinitionResourceInnerTests.java @@ -15,44 +15,38 @@ public final class CassandraRoleDefinitionResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraRoleDefinitionResourceInner model = BinaryData.fromString( - "{\"properties\":{\"id\":\"hdjzqdcadwvpsoz\",\"roleName\":\"ih\",\"type\":\"CustomRole\",\"assignableScopes\":[\"mrzoep\",\"xwdvwnj\",\"gv\"],\"permissions\":[{\"id\":\"aursqftibtyi\",\"dataActions\":[\"vpi\"],\"notDataActions\":[\"jpnqnoowsbeden\",\"exkxbhx\",\"ucnulgmnh\",\"evdyz\"]},{\"id\":\"ajsvk\",\"dataActions\":[\"qozzkivyhjrliizj\",\"xlqfh\",\"fkwa\"],\"notDataActions\":[\"lronqqlmg\"]},{\"id\":\"qxsjxte\",\"dataActions\":[\"hvuqbo\",\"oolzqocarkuzl\",\"cnn\"],\"notDataActions\":[\"nx\",\"wqy\"]},{\"id\":\"lhdyzmyckzex\",\"dataActions\":[\"kck\",\"wymxgaabjk\"],\"notDataActions\":[\"ohfaog\",\"vkiwrsiwdyjqu\",\"ykcrraue\"]}]},\"id\":\"csuehogddac\",\"name\":\"cbgydlqi\",\"type\":\"ywmhmptyrilkfbnr\"}") + "{\"properties\":{\"id\":\"iekoif\",\"roleName\":\"nyttzgix\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"lgmgbe\",\"lqtxnrflkndrn\",\"pgfjo\"],\"permissions\":[{\"id\":\"qotwfh\",\"dataActions\":[\"wgsabvcipo\",\"zafczuumljci\"],\"notDataActions\":[\"efy\",\"dvei\"]},{\"id\":\"tjnsx\",\"dataActions\":[\"lnsjhw\",\"uyx\"],\"notDataActions\":[\"qvmvuaytuadxkxe\",\"bwpntghy\"]}]},\"id\":\"a\",\"name\":\"cdrnxsl\",\"type\":\"vlzladl\"}") .toObject(CassandraRoleDefinitionResourceInner.class); - Assertions.assertEquals("hdjzqdcadwvpsoz", model.idPropertiesId()); - Assertions.assertEquals("ih", model.roleName()); - Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.typePropertiesType()); - Assertions.assertEquals("mrzoep", model.assignableScopes().get(0)); - Assertions.assertEquals("aursqftibtyi", model.permissions().get(0).id()); - Assertions.assertEquals("vpi", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("jpnqnoowsbeden", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("iekoif", model.idPropertiesId()); + Assertions.assertEquals("nyttzgix", model.roleName()); + Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.typePropertiesType()); + Assertions.assertEquals("lgmgbe", model.assignableScopes().get(0)); + Assertions.assertEquals("qotwfh", model.permissions().get(0).id()); + Assertions.assertEquals("wgsabvcipo", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("efy", model.permissions().get(0).notDataActions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CassandraRoleDefinitionResourceInner model - = new CassandraRoleDefinitionResourceInner().withIdPropertiesId("hdjzqdcadwvpsoz") - .withRoleName("ih") - .withTypePropertiesType(RoleDefinitionType.CUSTOM_ROLE) - .withAssignableScopes(Arrays.asList("mrzoep", "xwdvwnj", "gv")) + = new CassandraRoleDefinitionResourceInner().withIdPropertiesId("iekoif") + .withRoleName("nyttzgix") + .withTypePropertiesType(RoleDefinitionType.BUILT_IN_ROLE) + .withAssignableScopes(Arrays.asList("lgmgbe", "lqtxnrflkndrn", "pgfjo")) .withPermissions(Arrays.asList( - new Permission().withId("aursqftibtyi") - .withDataActions(Arrays.asList("vpi")) - .withNotDataActions(Arrays.asList("jpnqnoowsbeden", "exkxbhx", "ucnulgmnh", "evdyz")), - new Permission().withId("ajsvk") - .withDataActions(Arrays.asList("qozzkivyhjrliizj", "xlqfh", "fkwa")) - .withNotDataActions(Arrays.asList("lronqqlmg")), - new Permission().withId("qxsjxte") - .withDataActions(Arrays.asList("hvuqbo", "oolzqocarkuzl", "cnn")) - .withNotDataActions(Arrays.asList("nx", "wqy")), - new Permission().withId("lhdyzmyckzex") - .withDataActions(Arrays.asList("kck", "wymxgaabjk")) - .withNotDataActions(Arrays.asList("ohfaog", "vkiwrsiwdyjqu", "ykcrraue")))); + new Permission().withId("qotwfh") + .withDataActions(Arrays.asList("wgsabvcipo", "zafczuumljci")) + .withNotDataActions(Arrays.asList("efy", "dvei")), + new Permission().withId("tjnsx") + .withDataActions(Arrays.asList("lnsjhw", "uyx")) + .withNotDataActions(Arrays.asList("qvmvuaytuadxkxe", "bwpntghy")))); model = BinaryData.fromObject(model).toObject(CassandraRoleDefinitionResourceInner.class); - Assertions.assertEquals("hdjzqdcadwvpsoz", model.idPropertiesId()); - Assertions.assertEquals("ih", model.roleName()); - Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.typePropertiesType()); - Assertions.assertEquals("mrzoep", model.assignableScopes().get(0)); - Assertions.assertEquals("aursqftibtyi", model.permissions().get(0).id()); - Assertions.assertEquals("vpi", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("jpnqnoowsbeden", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("iekoif", model.idPropertiesId()); + Assertions.assertEquals("nyttzgix", model.roleName()); + Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.typePropertiesType()); + Assertions.assertEquals("lgmgbe", model.assignableScopes().get(0)); + Assertions.assertEquals("qotwfh", model.permissions().get(0).id()); + Assertions.assertEquals("wgsabvcipo", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("efy", model.permissions().get(0).notDataActions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleDefinitionResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleDefinitionResourcePropertiesTests.java index 6134095f2bba..3bdb10e6bd4d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleDefinitionResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraRoleDefinitionResourcePropertiesTests.java @@ -15,38 +15,44 @@ public final class CassandraRoleDefinitionResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraRoleDefinitionResourceProperties model = BinaryData.fromString( - "{\"id\":\"xvztpbnfnqtxj\",\"roleName\":\"m\",\"type\":\"CustomRole\",\"assignableScopes\":[\"nfddepldwqjns\",\"zygleexahvm\"],\"permissions\":[{\"id\":\"brcary\",\"dataActions\":[\"j\",\"yvoaqajuvehzp\",\"dmkrrb\",\"mpfu\"],\"notDataActions\":[\"efgybpmfbfununmp\"]},{\"id\":\"rvfyifkdsch\",\"dataActions\":[\"fict\",\"kjjwgcwn\",\"hbkgfyrt\",\"gm\"],\"notDataActions\":[\"pjscdfpdqwtygev\"]}]}") + "{\"id\":\"kpbqhvfdqqjw\",\"roleName\":\"hwzdanojisgglmv\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"ztjctibpvbkae\",\"xsmzygdf\"],\"permissions\":[{\"id\":\"seivmakxhysow\",\"dataActions\":[\"x\"],\"notDataActions\":[\"ect\",\"tfjmskdchmaiub\",\"vlzw\",\"vgmfalkzazmgok\"]},{\"id\":\"gjqafkmkrokzr\",\"dataActions\":[\"etw\",\"qrtvaoznqni\",\"iezeagm\",\"eituugedhfpjs\"],\"notDataActions\":[\"mbl\",\"yjdeolctaebfs\",\"rledjcu\"]},{\"id\":\"bvt\",\"dataActions\":[\"d\",\"zvsgeafgfosehxlz\",\"xezppk\",\"waaeskyfjl\"],\"notDataActions\":[\"qtoyrpl\",\"xlaj\"]},{\"id\":\"lpquevhamfow\",\"dataActions\":[\"tmk\",\"kxpkzwaq\",\"ofqovchiqbplv\",\"idu\"],\"notDataActions\":[\"ekxbyjg\",\"sfepxyihpq\",\"dagrhrdicxdw\"]}]}") .toObject(CassandraRoleDefinitionResourceProperties.class); - Assertions.assertEquals("xvztpbnfnqtxj", model.id()); - Assertions.assertEquals("m", model.roleName()); - Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.type()); - Assertions.assertEquals("nfddepldwqjns", model.assignableScopes().get(0)); - Assertions.assertEquals("brcary", model.permissions().get(0).id()); - Assertions.assertEquals("j", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("efgybpmfbfununmp", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("kpbqhvfdqqjw", model.id()); + Assertions.assertEquals("hwzdanojisgglmv", model.roleName()); + Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.type()); + Assertions.assertEquals("ztjctibpvbkae", model.assignableScopes().get(0)); + Assertions.assertEquals("seivmakxhysow", model.permissions().get(0).id()); + Assertions.assertEquals("x", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("ect", model.permissions().get(0).notDataActions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CassandraRoleDefinitionResourceProperties model - = new CassandraRoleDefinitionResourceProperties().withId("xvztpbnfnqtxj") - .withRoleName("m") - .withType(RoleDefinitionType.CUSTOM_ROLE) - .withAssignableScopes(Arrays.asList("nfddepldwqjns", "zygleexahvm")) + = new CassandraRoleDefinitionResourceProperties().withId("kpbqhvfdqqjw") + .withRoleName("hwzdanojisgglmv") + .withType(RoleDefinitionType.BUILT_IN_ROLE) + .withAssignableScopes(Arrays.asList("ztjctibpvbkae", "xsmzygdf")) .withPermissions(Arrays.asList( - new Permission().withId("brcary") - .withDataActions(Arrays.asList("j", "yvoaqajuvehzp", "dmkrrb", "mpfu")) - .withNotDataActions(Arrays.asList("efgybpmfbfununmp")), - new Permission().withId("rvfyifkdsch") - .withDataActions(Arrays.asList("fict", "kjjwgcwn", "hbkgfyrt", "gm")) - .withNotDataActions(Arrays.asList("pjscdfpdqwtygev")))); + new Permission().withId("seivmakxhysow") + .withDataActions(Arrays.asList("x")) + .withNotDataActions(Arrays.asList("ect", "tfjmskdchmaiub", "vlzw", "vgmfalkzazmgok")), + new Permission().withId("gjqafkmkrokzr") + .withDataActions(Arrays.asList("etw", "qrtvaoznqni", "iezeagm", "eituugedhfpjs")) + .withNotDataActions(Arrays.asList("mbl", "yjdeolctaebfs", "rledjcu")), + new Permission().withId("bvt") + .withDataActions(Arrays.asList("d", "zvsgeafgfosehxlz", "xezppk", "waaeskyfjl")) + .withNotDataActions(Arrays.asList("qtoyrpl", "xlaj")), + new Permission().withId("lpquevhamfow") + .withDataActions(Arrays.asList("tmk", "kxpkzwaq", "ofqovchiqbplv", "idu")) + .withNotDataActions(Arrays.asList("ekxbyjg", "sfepxyihpq", "dagrhrdicxdw")))); model = BinaryData.fromObject(model).toObject(CassandraRoleDefinitionResourceProperties.class); - Assertions.assertEquals("xvztpbnfnqtxj", model.id()); - Assertions.assertEquals("m", model.roleName()); - Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.type()); - Assertions.assertEquals("nfddepldwqjns", model.assignableScopes().get(0)); - Assertions.assertEquals("brcary", model.permissions().get(0).id()); - Assertions.assertEquals("j", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("efgybpmfbfununmp", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("kpbqhvfdqqjw", model.id()); + Assertions.assertEquals("hwzdanojisgglmv", model.roleName()); + Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.type()); + Assertions.assertEquals("ztjctibpvbkae", model.assignableScopes().get(0)); + Assertions.assertEquals("seivmakxhysow", model.permissions().get(0).id()); + Assertions.assertEquals("x", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("ect", model.permissions().get(0).notDataActions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraTableGetPropertiesOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraTableGetPropertiesOptionsTests.java index ea5bb04a4c64..91b262ff37fd 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraTableGetPropertiesOptionsTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraTableGetPropertiesOptionsTests.java @@ -12,9 +12,9 @@ public final class CassandraTableGetPropertiesOptionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CassandraTableGetPropertiesOptions model - = BinaryData.fromString("{\"throughput\":532534725,\"autoscaleSettings\":{\"maxThroughput\":1991162890}}") + = BinaryData.fromString("{\"throughput\":2017064438,\"autoscaleSettings\":{\"maxThroughput\":2013220790}}") .toObject(CassandraTableGetPropertiesOptions.class); - Assertions.assertEquals(532534725, model.throughput()); - Assertions.assertEquals(1991162890, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(2017064438, model.throughput()); + Assertions.assertEquals(2013220790, model.autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewCreateUpdateParametersTests.java new file mode 100644 index 000000000000..c586a29487fa --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewCreateUpdateParametersTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.AutoscaleSettings; +import com.azure.resourcemanager.cosmos.models.CassandraViewCreateUpdateParameters; +import com.azure.resourcemanager.cosmos.models.CassandraViewResource; +import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentityUserAssignedIdentities; +import com.azure.resourcemanager.cosmos.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class CassandraViewCreateUpdateParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CassandraViewCreateUpdateParameters model = BinaryData.fromString( + "{\"properties\":{\"resource\":{\"id\":\"sbpkf\",\"viewDefinition\":\"anfkgxsyaowuzow\"},\"options\":{\"throughput\":2145616749,\"autoscaleSettings\":{\"maxThroughput\":1716360044}}},\"id\":\"rgukxrztio\",\"name\":\"lutixmq\",\"type\":\"djizcbf\",\"location\":\"crunfhi\",\"tags\":{\"u\":\"mfbcpaqktkrum\",\"kxiuxqggvqr\":\"dkyzbfvxov\"},\"identity\":{\"principalId\":\"hlwcjsqg\",\"tenantId\":\"hffbxrq\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"wmwwmjswen\":{\"principalId\":\"uqlsdx\",\"clientId\":\"ztv\"},\"llhsvidmyt\":{\"principalId\":\"wamec\",\"clientId\":\"qioulndhzyoeojht\"},\"bcswqagyw\":{\"principalId\":\"nglxpn\",\"clientId\":\"yoan\"},\"lhsidsjtdl\":{\"principalId\":\"xigvjrktpgaeuk\",\"clientId\":\"wohpmwhqnucs\"}}}}") + .toObject(CassandraViewCreateUpdateParameters.class); + Assertions.assertEquals("crunfhi", model.location()); + Assertions.assertEquals("mfbcpaqktkrum", model.tags().get("u")); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("sbpkf", model.resource().id()); + Assertions.assertEquals("anfkgxsyaowuzow", model.resource().viewDefinition()); + Assertions.assertEquals(2145616749, model.options().throughput()); + Assertions.assertEquals(1716360044, model.options().autoscaleSettings().maxThroughput()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CassandraViewCreateUpdateParameters model = new CassandraViewCreateUpdateParameters().withLocation("crunfhi") + .withTags(mapOf("u", "mfbcpaqktkrum", "kxiuxqggvqr", "dkyzbfvxov")) + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("wmwwmjswen", new ManagedServiceIdentityUserAssignedIdentities(), + "llhsvidmyt", new ManagedServiceIdentityUserAssignedIdentities(), "bcswqagyw", + new ManagedServiceIdentityUserAssignedIdentities(), "lhsidsjtdl", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource(new CassandraViewResource().withId("sbpkf").withViewDefinition("anfkgxsyaowuzow")) + .withOptions(new CreateUpdateOptions().withThroughput(2145616749) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1716360044))); + model = BinaryData.fromObject(model).toObject(CassandraViewCreateUpdateParameters.class); + Assertions.assertEquals("crunfhi", model.location()); + Assertions.assertEquals("mfbcpaqktkrum", model.tags().get("u")); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("sbpkf", model.resource().id()); + Assertions.assertEquals("anfkgxsyaowuzow", model.resource().viewDefinition()); + Assertions.assertEquals(2145616749, model.options().throughput()); + Assertions.assertEquals(1716360044, model.options().autoscaleSettings().maxThroughput()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewCreateUpdatePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewCreateUpdatePropertiesTests.java new file mode 100644 index 000000000000..cd2d53a3e6b2 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewCreateUpdatePropertiesTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraViewCreateUpdateProperties; +import com.azure.resourcemanager.cosmos.models.AutoscaleSettings; +import com.azure.resourcemanager.cosmos.models.CassandraViewResource; +import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; +import org.junit.jupiter.api.Assertions; + +public final class CassandraViewCreateUpdatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CassandraViewCreateUpdateProperties model = BinaryData.fromString( + "{\"resource\":{\"id\":\"bninjgazlsvbzfc\",\"viewDefinition\":\"uoeedwjcci\"},\"options\":{\"throughput\":1071981499,\"autoscaleSettings\":{\"maxThroughput\":1148982233}}}") + .toObject(CassandraViewCreateUpdateProperties.class); + Assertions.assertEquals("bninjgazlsvbzfc", model.resource().id()); + Assertions.assertEquals("uoeedwjcci", model.resource().viewDefinition()); + Assertions.assertEquals(1071981499, model.options().throughput()); + Assertions.assertEquals(1148982233, model.options().autoscaleSettings().maxThroughput()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CassandraViewCreateUpdateProperties model = new CassandraViewCreateUpdateProperties() + .withResource(new CassandraViewResource().withId("bninjgazlsvbzfc").withViewDefinition("uoeedwjcci")) + .withOptions(new CreateUpdateOptions().withThroughput(1071981499) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1148982233))); + model = BinaryData.fromObject(model).toObject(CassandraViewCreateUpdateProperties.class); + Assertions.assertEquals("bninjgazlsvbzfc", model.resource().id()); + Assertions.assertEquals("uoeedwjcci", model.resource().viewDefinition()); + Assertions.assertEquals(1071981499, model.options().throughput()); + Assertions.assertEquals(1148982233, model.options().autoscaleSettings().maxThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetPropertiesOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetPropertiesOptionsTests.java new file mode 100644 index 000000000000..aa61d8534725 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetPropertiesOptionsTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CassandraViewGetPropertiesOptions; +import org.junit.jupiter.api.Assertions; + +public final class CassandraViewGetPropertiesOptionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CassandraViewGetPropertiesOptions model + = BinaryData.fromString("{\"throughput\":176903649,\"autoscaleSettings\":{\"maxThroughput\":909148113}}") + .toObject(CassandraViewGetPropertiesOptions.class); + Assertions.assertEquals(176903649, model.throughput()); + Assertions.assertEquals(909148113, model.autoscaleSettings().maxThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetPropertiesResourceTests.java new file mode 100644 index 000000000000..73c235e876e2 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetPropertiesResourceTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CassandraViewGetPropertiesResource; +import org.junit.jupiter.api.Assertions; + +public final class CassandraViewGetPropertiesResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CassandraViewGetPropertiesResource model = BinaryData.fromString( + "{\"_rid\":\"bbmtlpqagynoip\",\"_ts\":59.592606,\"_etag\":\"ali\",\"id\":\"cryqxzx\",\"viewDefinition\":\"q\"}") + .toObject(CassandraViewGetPropertiesResource.class); + Assertions.assertEquals("cryqxzx", model.id()); + Assertions.assertEquals("q", model.viewDefinition()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetPropertiesTests.java new file mode 100644 index 000000000000..400d4dfb8441 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetPropertiesTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraViewGetProperties; +import org.junit.jupiter.api.Assertions; + +public final class CassandraViewGetPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CassandraViewGetProperties model = BinaryData.fromString( + "{\"resource\":{\"_rid\":\"dpqgfhyrfr\",\"_ts\":73.38665,\"_etag\":\"d\",\"id\":\"rcwfcmfcnrjajq\",\"viewDefinition\":\"atxjtiel\"},\"options\":{\"throughput\":1395640980,\"autoscaleSettings\":{\"maxThroughput\":609218787}}}") + .toObject(CassandraViewGetProperties.class); + Assertions.assertEquals("rcwfcmfcnrjajq", model.resource().id()); + Assertions.assertEquals("atxjtiel", model.resource().viewDefinition()); + Assertions.assertEquals(1395640980, model.options().throughput()); + Assertions.assertEquals(609218787, model.options().autoscaleSettings().maxThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetResultsInnerTests.java new file mode 100644 index 000000000000..d9cb402a5139 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewGetResultsInnerTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraViewGetResultsInner; +import com.azure.resourcemanager.cosmos.models.ResourceIdentityType; +import org.junit.jupiter.api.Assertions; + +public final class CassandraViewGetResultsInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CassandraViewGetResultsInner model = BinaryData.fromString( + "{\"properties\":{\"resource\":{\"_rid\":\"btwa\",\"_ts\":25.816637,\"_etag\":\"vlyttaaknwfrke\",\"id\":\"sm\",\"viewDefinition\":\"p\"},\"options\":{\"throughput\":662298798,\"autoscaleSettings\":{\"maxThroughput\":336497916}}},\"location\":\"olekscbctnanqim\",\"tags\":{\"imouxwksqmudmfco\":\"xpdcldpkawnsnl\",\"kbqsjhbtqqvyfscy\":\"bicziuswswj\",\"fuy\":\"fwbivqvo\",\"crood\":\"wvbhlimbyq\"},\"identity\":{\"principalId\":\"cdrdaasaxxo\",\"tenantId\":\"mfkwiyjvzuk\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"doabhj\":{\"principalId\":\"nvzmlnkoywsx\",\"clientId\":\"abjqqaxuyvymcnud\"}}},\"id\":\"xqweu\",\"name\":\"pmpvks\",\"type\":\"itnsqxtltc\"}") + .toObject(CassandraViewGetResultsInner.class); + Assertions.assertEquals("olekscbctnanqim", model.location()); + Assertions.assertEquals("xpdcldpkawnsnl", model.tags().get("imouxwksqmudmfco")); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("sm", model.resource().id()); + Assertions.assertEquals("p", model.resource().viewDefinition()); + Assertions.assertEquals(662298798, model.options().throughput()); + Assertions.assertEquals(336497916, model.options().autoscaleSettings().maxThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewListResultTests.java new file mode 100644 index 000000000000..cce649872a3f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.implementation.models.CassandraViewListResult; +import org.junit.jupiter.api.Assertions; + +public final class CassandraViewListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CassandraViewListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"xolriy\",\"_ts\":29.146534,\"_etag\":\"eivdlhy\",\"id\":\"wbdbfg\",\"viewDefinition\":\"lpu\"},\"options\":{\"throughput\":598808822,\"autoscaleSettings\":{\"maxThroughput\":1597685904}}},\"location\":\"mmpathu\",\"tags\":{\"e\":\"h\"},\"identity\":{\"principalId\":\"iwllbvgwzsffted\",\"tenantId\":\"snkt\",\"type\":\"None\",\"userAssignedIdentities\":{\"zlqbtxxwpfhn\":{\"principalId\":\"aqo\",\"clientId\":\"kbeba\"},\"hmngqb\":{\"principalId\":\"udrtpzkgme\",\"clientId\":\"ywhczzq\"},\"hlr\":{\"principalId\":\"ygisrz\",\"clientId\":\"ykdidj\"},\"ewhfjsrwqrxetf\":{\"principalId\":\"wctofldseacdhz\",\"clientId\":\"kbrfgdrwji\"}}},\"id\":\"wvrrmdqn\",\"name\":\"ycnawthvmaxgnuy\",\"type\":\"a\"},{\"properties\":{\"resource\":{\"_rid\":\"udf\",\"_ts\":35.990543,\"_etag\":\"h\",\"id\":\"k\",\"viewDefinition\":\"cpqtwloesq\"},\"options\":{\"throughput\":642124537,\"autoscaleSettings\":{\"maxThroughput\":2013032635}}},\"location\":\"rukoi\",\"tags\":{\"leipjl\":\"iduw\",\"kkwhbgxvellvulnx\":\"wyxpzruzyth\"},\"identity\":{\"principalId\":\"itmujdtvm\",\"tenantId\":\"yymffhmjp\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"pv\":{\"principalId\":\"zuvrzmzqmz\",\"clientId\":\"rb\"},\"laohoqkp\":{\"principalId\":\"dyfoeb\",\"clientId\":\"tjpp\"},\"syril\":{\"principalId\":\"nqjilaywk\",\"clientId\":\"wm\"},\"mfwo\":{\"principalId\":\"xdqaolfylnkkb\",\"clientId\":\"jvlywl\"}}},\"id\":\"jw\",\"name\":\"lwyjfnqzocrdz\",\"type\":\"czeuntgx\"}],\"nextLink\":\"ca\"}") + .toObject(CassandraViewListResult.class); + Assertions.assertEquals("ca", model.nextLink()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewResourceTests.java new file mode 100644 index 000000000000..5dee15057d3b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CassandraViewResourceTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CassandraViewResource; +import org.junit.jupiter.api.Assertions; + +public final class CassandraViewResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CassandraViewResource model = BinaryData.fromString("{\"id\":\"ibmq\",\"viewDefinition\":\"miymqruqguhfupet\"}") + .toObject(CassandraViewResource.class); + Assertions.assertEquals("ibmq", model.id()); + Assertions.assertEquals("miymqruqguhfupet", model.viewDefinition()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CassandraViewResource model = new CassandraViewResource().withId("ibmq").withViewDefinition("miymqruqguhfupet"); + model = BinaryData.fromObject(model).toObject(CassandraViewResource.class); + Assertions.assertEquals("ibmq", model.id()); + Assertions.assertEquals("miymqruqguhfupet", model.viewDefinition()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CertificateTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CertificateTests.java index 9b93f4f6cf57..d3a95dc3ee30 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CertificateTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CertificateTests.java @@ -11,14 +11,14 @@ public final class CertificateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Certificate model = BinaryData.fromString("{\"pem\":\"aj\"}").toObject(Certificate.class); - Assertions.assertEquals("aj", model.pem()); + Certificate model = BinaryData.fromString("{\"pem\":\"kqiyvnd\"}").toObject(Certificate.class); + Assertions.assertEquals("kqiyvnd", model.pem()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Certificate model = new Certificate().withPem("aj"); + Certificate model = new Certificate().withPem("kqiyvnd"); model = BinaryData.fromObject(model).toObject(Certificate.class); - Assertions.assertEquals("aj", model.pem()); + Assertions.assertEquals("kqiyvnd", model.pem()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultListResponseTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultListResponseTests.java new file mode 100644 index 000000000000..d0f5028b48ce --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultListResponseTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.implementation.models.ChaosFaultListResponse; +import com.azure.resourcemanager.cosmos.models.SupportedActions; +import org.junit.jupiter.api.Assertions; + +public final class ChaosFaultListResponseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ChaosFaultListResponse model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"action\":\"Enable\",\"region\":\"mzrqraz\",\"databaseName\":\"ivznllas\",\"containerName\":\"skhj\",\"provisioningState\":\"pvbaih\"},\"id\":\"tgzgta\",\"name\":\"ywbqgroigbsfsgs\",\"type\":\"enwl\"},{\"properties\":{\"action\":\"Enable\",\"region\":\"jqlxspmrj\",\"databaseName\":\"ryldsxeb\",\"containerName\":\"sxrznmg\",\"provisioningState\":\"al\"},\"id\":\"ckhefrb\",\"name\":\"s\",\"type\":\"uerbgpxebjl\"}],\"nextLink\":\"caytujraxdtpryj\"}") + .toObject(ChaosFaultListResponse.class); + Assertions.assertEquals(SupportedActions.ENABLE, model.value().get(0).action()); + Assertions.assertEquals("mzrqraz", model.value().get(0).region()); + Assertions.assertEquals("ivznllas", model.value().get(0).databaseName()); + Assertions.assertEquals("skhj", model.value().get(0).containerName()); + Assertions.assertEquals("caytujraxdtpryj", model.nextLink()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultPropertiesTests.java new file mode 100644 index 000000000000..d8484e217aaa --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultPropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.ChaosFaultProperties; +import com.azure.resourcemanager.cosmos.models.SupportedActions; +import org.junit.jupiter.api.Assertions; + +public final class ChaosFaultPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ChaosFaultProperties model = BinaryData.fromString( + "{\"action\":\"Enable\",\"region\":\"olrndwdb\",\"databaseName\":\"vzaledoyqxlunk\",\"containerName\":\"hmcxqqxmyzkl\",\"provisioningState\":\"a\"}") + .toObject(ChaosFaultProperties.class); + Assertions.assertEquals(SupportedActions.ENABLE, model.action()); + Assertions.assertEquals("olrndwdb", model.region()); + Assertions.assertEquals("vzaledoyqxlunk", model.databaseName()); + Assertions.assertEquals("hmcxqqxmyzkl", model.containerName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ChaosFaultProperties model = new ChaosFaultProperties().withAction(SupportedActions.ENABLE) + .withRegion("olrndwdb") + .withDatabaseName("vzaledoyqxlunk") + .withContainerName("hmcxqqxmyzkl"); + model = BinaryData.fromObject(model).toObject(ChaosFaultProperties.class); + Assertions.assertEquals(SupportedActions.ENABLE, model.action()); + Assertions.assertEquals("olrndwdb", model.region()); + Assertions.assertEquals("vzaledoyqxlunk", model.databaseName()); + Assertions.assertEquals("hmcxqqxmyzkl", model.containerName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultResourceInnerTests.java new file mode 100644 index 000000000000..b81e80fe1b98 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ChaosFaultResourceInnerTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.ChaosFaultResourceInner; +import com.azure.resourcemanager.cosmos.models.SupportedActions; +import org.junit.jupiter.api.Assertions; + +public final class ChaosFaultResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ChaosFaultResourceInner model = BinaryData.fromString( + "{\"properties\":{\"action\":\"Disable\",\"region\":\"xnhwh\",\"databaseName\":\"oyrzaaoe\",\"containerName\":\"pmjen\",\"provisioningState\":\"eat\"},\"id\":\"xxcrxoxdjxld\",\"name\":\"a\",\"type\":\"yyi\"}") + .toObject(ChaosFaultResourceInner.class); + Assertions.assertEquals(SupportedActions.DISABLE, model.action()); + Assertions.assertEquals("xnhwh", model.region()); + Assertions.assertEquals("oyrzaaoe", model.databaseName()); + Assertions.assertEquals("pmjen", model.containerName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ChaosFaultResourceInner model = new ChaosFaultResourceInner().withAction(SupportedActions.DISABLE) + .withRegion("xnhwh") + .withDatabaseName("oyrzaaoe") + .withContainerName("pmjen"); + model = BinaryData.fromObject(model).toObject(ChaosFaultResourceInner.class); + Assertions.assertEquals(SupportedActions.DISABLE, model.action()); + Assertions.assertEquals("xnhwh", model.region()); + Assertions.assertEquals("oyrzaaoe", model.databaseName()); + Assertions.assertEquals("pmjen", model.containerName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ClusterKeyTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ClusterKeyTests.java index 6bbdf2018b41..6392a2a3efe9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ClusterKeyTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ClusterKeyTests.java @@ -11,17 +11,17 @@ public final class ClusterKeyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClusterKey model = BinaryData.fromString("{\"name\":\"lqqbtnyjpylxdbfv\",\"orderBy\":\"mvmsxbae\"}") - .toObject(ClusterKey.class); - Assertions.assertEquals("lqqbtnyjpylxdbfv", model.name()); - Assertions.assertEquals("mvmsxbae", model.orderBy()); + ClusterKey model + = BinaryData.fromString("{\"name\":\"thzodubtlmjtgbl\",\"orderBy\":\"skkfmk\"}").toObject(ClusterKey.class); + Assertions.assertEquals("thzodubtlmjtgbl", model.name()); + Assertions.assertEquals("skkfmk", model.orderBy()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterKey model = new ClusterKey().withName("lqqbtnyjpylxdbfv").withOrderBy("mvmsxbae"); + ClusterKey model = new ClusterKey().withName("thzodubtlmjtgbl").withOrderBy("skkfmk"); model = BinaryData.fromObject(model).toObject(ClusterKey.class); - Assertions.assertEquals("lqqbtnyjpylxdbfv", model.name()); - Assertions.assertEquals("mvmsxbae", model.orderBy()); + Assertions.assertEquals("thzodubtlmjtgbl", model.name()); + Assertions.assertEquals("skkfmk", model.orderBy()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ColumnTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ColumnTests.java index 5a5d81a03a80..3b32276b72fc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ColumnTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ColumnTests.java @@ -11,16 +11,16 @@ public final class ColumnTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Column model = BinaryData.fromString("{\"name\":\"clkfkee\",\"type\":\"vop\"}").toObject(Column.class); - Assertions.assertEquals("clkfkee", model.name()); - Assertions.assertEquals("vop", model.type()); + Column model = BinaryData.fromString("{\"name\":\"ahxm\",\"type\":\"ryarvsxzqb\"}").toObject(Column.class); + Assertions.assertEquals("ahxm", model.name()); + Assertions.assertEquals("ryarvsxzqb", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Column model = new Column().withName("clkfkee").withType("vop"); + Column model = new Column().withName("ahxm").withType("ryarvsxzqb"); model = BinaryData.fromObject(model).toObject(Column.class); - Assertions.assertEquals("clkfkee", model.name()); - Assertions.assertEquals("vop", model.type()); + Assertions.assertEquals("ahxm", model.name()); + Assertions.assertEquals("ryarvsxzqb", model.type()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandAsyncPostBodyTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandAsyncPostBodyTests.java new file mode 100644 index 000000000000..70bf627738fc --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandAsyncPostBodyTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CommandAsyncPostBody; +import org.junit.jupiter.api.Assertions; + +public final class CommandAsyncPostBodyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CommandAsyncPostBody model = BinaryData.fromString( + "{\"command\":\"bqrvvbqv\",\"arguments\":\"\\\"datampe\\\"\",\"host\":\"qx\",\"cassandra-stop-start\":false,\"readWrite\":false}") + .toObject(CommandAsyncPostBody.class); + Assertions.assertEquals("bqrvvbqv", model.command()); + Assertions.assertEquals("qx", model.host()); + Assertions.assertFalse(model.cassandraStopStart()); + Assertions.assertFalse(model.readWrite()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CommandAsyncPostBody model = new CommandAsyncPostBody().withCommand("bqrvvbqv") + .withArguments("\"datampe\"") + .withHost("qx") + .withCassandraStopStart(false) + .withReadWrite(false); + model = BinaryData.fromObject(model).toObject(CommandAsyncPostBody.class); + Assertions.assertEquals("bqrvvbqv", model.command()); + Assertions.assertEquals("qx", model.host()); + Assertions.assertFalse(model.cassandraStopStart()); + Assertions.assertFalse(model.readWrite()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandOutputInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandOutputInnerTests.java index 5042b9a90ce8..0d867f96c031 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandOutputInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandOutputInnerTests.java @@ -12,7 +12,7 @@ public final class CommandOutputInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommandOutputInner model - = BinaryData.fromString("{\"commandOutput\":\"aaxoialahfxwcc\"}").toObject(CommandOutputInner.class); - Assertions.assertEquals("aaxoialahfxwcc", model.commandOutput()); + = BinaryData.fromString("{\"commandOutput\":\"evasyntvzjyie\"}").toObject(CommandOutputInner.class); + Assertions.assertEquals("evasyntvzjyie", model.commandOutput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandPostBodyTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandPostBodyTests.java index 52cad7968e0c..e5a26ba8b3b1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandPostBodyTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandPostBodyTests.java @@ -14,28 +14,28 @@ public final class CommandPostBodyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommandPostBody model = BinaryData.fromString( - "{\"command\":\"wkppnwyytfvp\",\"arguments\":{\"vuldbkkejjk\":\"jikffffgkuhznw\",\"azmxjqi\":\"igaw\",\"jjsbcmlzaahzbhur\":\"h\",\"lirh\":\"olk\"},\"host\":\"mojusuz\",\"cassandra-stop-start\":false,\"readwrite\":true}") + "{\"command\":\"ydtnaczkfwfatgaw\",\"arguments\":{\"ecsaaqgoqbdiu\":\"skivdwgtqcu\",\"hrbkhtmqowi\":\"csbskowkrbh\",\"ruozkgyfp\":\"asfgqgucyhfaimqv\"},\"host\":\"oehgfmqmskkixvlz\",\"cassandra-stop-start\":true,\"readwrite\":true}") .toObject(CommandPostBody.class); - Assertions.assertEquals("wkppnwyytfvp", model.command()); - Assertions.assertEquals("jikffffgkuhznw", model.arguments().get("vuldbkkejjk")); - Assertions.assertEquals("mojusuz", model.host()); - Assertions.assertFalse(model.cassandraStopStart()); + Assertions.assertEquals("ydtnaczkfwfatgaw", model.command()); + Assertions.assertEquals("skivdwgtqcu", model.arguments().get("ecsaaqgoqbdiu")); + Assertions.assertEquals("oehgfmqmskkixvlz", model.host()); + Assertions.assertTrue(model.cassandraStopStart()); Assertions.assertTrue(model.readwrite()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CommandPostBody model = new CommandPostBody().withCommand("wkppnwyytfvp") + CommandPostBody model = new CommandPostBody().withCommand("ydtnaczkfwfatgaw") .withArguments( - mapOf("vuldbkkejjk", "jikffffgkuhznw", "azmxjqi", "igaw", "jjsbcmlzaahzbhur", "h", "lirh", "olk")) - .withHost("mojusuz") - .withCassandraStopStart(false) + mapOf("ecsaaqgoqbdiu", "skivdwgtqcu", "hrbkhtmqowi", "csbskowkrbh", "ruozkgyfp", "asfgqgucyhfaimqv")) + .withHost("oehgfmqmskkixvlz") + .withCassandraStopStart(true) .withReadwrite(true); model = BinaryData.fromObject(model).toObject(CommandPostBody.class); - Assertions.assertEquals("wkppnwyytfvp", model.command()); - Assertions.assertEquals("jikffffgkuhznw", model.arguments().get("vuldbkkejjk")); - Assertions.assertEquals("mojusuz", model.host()); - Assertions.assertFalse(model.cassandraStopStart()); + Assertions.assertEquals("ydtnaczkfwfatgaw", model.command()); + Assertions.assertEquals("skivdwgtqcu", model.arguments().get("ecsaaqgoqbdiu")); + Assertions.assertEquals("oehgfmqmskkixvlz", model.host()); + Assertions.assertTrue(model.cassandraStopStart()); Assertions.assertTrue(model.readwrite()); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandPublicResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandPublicResourceInnerTests.java new file mode 100644 index 000000000000..7c525dc1db97 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CommandPublicResourceInnerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.CommandPublicResourceInner; +import com.azure.resourcemanager.cosmos.models.CommandStatus; +import org.junit.jupiter.api.Assertions; + +public final class CommandPublicResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CommandPublicResourceInner model = BinaryData.fromString( + "{\"command\":\"fubnsnstlpwqpj\",\"commandId\":\"jkht\",\"arguments\":\"\\\"datasvyou\\\"\",\"host\":\"uiyxfwkztsmsfb\",\"isAdmin\":true,\"cassandraStopStart\":true,\"readWrite\":true,\"result\":\"hkqytkzta\",\"status\":\"Finished\",\"outputFile\":\"fzdgjfcycrsvloy\"}") + .toObject(CommandPublicResourceInner.class); + Assertions.assertEquals("fubnsnstlpwqpj", model.command()); + Assertions.assertEquals("jkht", model.commandId()); + Assertions.assertEquals("uiyxfwkztsmsfb", model.host()); + Assertions.assertTrue(model.isAdmin()); + Assertions.assertTrue(model.cassandraStopStart()); + Assertions.assertTrue(model.readWrite()); + Assertions.assertEquals("hkqytkzta", model.result()); + Assertions.assertEquals(CommandStatus.FINISHED, model.status()); + Assertions.assertEquals("fzdgjfcycrsvloy", model.outputFile()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CompositePathTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CompositePathTests.java index 70f9d8890fb6..a53788a69d2d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CompositePathTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CompositePathTests.java @@ -12,18 +12,17 @@ public final class CompositePathTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CompositePath model = BinaryData.fromString("{\"path\":\"lmywwtkgkxnyed\",\"order\":\"descending\"}") - .toObject(CompositePath.class); - Assertions.assertEquals("lmywwtkgkxnyed", model.path()); - Assertions.assertEquals(CompositePathSortOrder.DESCENDING, model.order()); + CompositePath model + = BinaryData.fromString("{\"path\":\"qxnmwmqt\",\"order\":\"ascending\"}").toObject(CompositePath.class); + Assertions.assertEquals("qxnmwmqt", model.path()); + Assertions.assertEquals(CompositePathSortOrder.ASCENDING, model.order()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CompositePath model - = new CompositePath().withPath("lmywwtkgkxnyed").withOrder(CompositePathSortOrder.DESCENDING); + CompositePath model = new CompositePath().withPath("qxnmwmqt").withOrder(CompositePathSortOrder.ASCENDING); model = BinaryData.fromObject(model).toObject(CompositePath.class); - Assertions.assertEquals("lmywwtkgkxnyed", model.path()); - Assertions.assertEquals(CompositePathSortOrder.DESCENDING, model.order()); + Assertions.assertEquals("qxnmwmqt", model.path()); + Assertions.assertEquals(CompositePathSortOrder.ASCENDING, model.order()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ComputedPropertyTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ComputedPropertyTests.java index cae24605c035..b8abee780925 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ComputedPropertyTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ComputedPropertyTests.java @@ -11,17 +11,17 @@ public final class ComputedPropertyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ComputedProperty model = BinaryData.fromString("{\"name\":\"drihpfhoqcaaewda\",\"query\":\"djvlpj\"}") - .toObject(ComputedProperty.class); - Assertions.assertEquals("drihpfhoqcaaewda", model.name()); - Assertions.assertEquals("djvlpj", model.query()); + ComputedProperty model + = BinaryData.fromString("{\"name\":\"as\",\"query\":\"lyhb\"}").toObject(ComputedProperty.class); + Assertions.assertEquals("as", model.name()); + Assertions.assertEquals("lyhb", model.query()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ComputedProperty model = new ComputedProperty().withName("drihpfhoqcaaewda").withQuery("djvlpj"); + ComputedProperty model = new ComputedProperty().withName("as").withQuery("lyhb"); model = BinaryData.fromObject(model).toObject(ComputedProperty.class); - Assertions.assertEquals("drihpfhoqcaaewda", model.name()); - Assertions.assertEquals("djvlpj", model.query()); + Assertions.assertEquals("as", model.name()); + Assertions.assertEquals("lyhb", model.query()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ConflictResolutionPolicyTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ConflictResolutionPolicyTests.java index ad84f2b681e7..7b7f519fd409 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ConflictResolutionPolicyTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ConflictResolutionPolicyTests.java @@ -13,22 +13,21 @@ public final class ConflictResolutionPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConflictResolutionPolicy model = BinaryData.fromString( - "{\"mode\":\"LastWriterWins\",\"conflictResolutionPath\":\"evwrdnhfuk\",\"conflictResolutionProcedure\":\"sjcswsmystuluqyp\"}") + "{\"mode\":\"Custom\",\"conflictResolutionPath\":\"vwrevkhgnlnzon\",\"conflictResolutionProcedure\":\"rpiqywncv\"}") .toObject(ConflictResolutionPolicy.class); - Assertions.assertEquals(ConflictResolutionMode.LAST_WRITER_WINS, model.mode()); - Assertions.assertEquals("evwrdnhfuk", model.conflictResolutionPath()); - Assertions.assertEquals("sjcswsmystuluqyp", model.conflictResolutionProcedure()); + Assertions.assertEquals(ConflictResolutionMode.CUSTOM, model.mode()); + Assertions.assertEquals("vwrevkhgnlnzon", model.conflictResolutionPath()); + Assertions.assertEquals("rpiqywncv", model.conflictResolutionProcedure()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConflictResolutionPolicy model - = new ConflictResolutionPolicy().withMode(ConflictResolutionMode.LAST_WRITER_WINS) - .withConflictResolutionPath("evwrdnhfuk") - .withConflictResolutionProcedure("sjcswsmystuluqyp"); + ConflictResolutionPolicy model = new ConflictResolutionPolicy().withMode(ConflictResolutionMode.CUSTOM) + .withConflictResolutionPath("vwrevkhgnlnzon") + .withConflictResolutionProcedure("rpiqywncv"); model = BinaryData.fromObject(model).toObject(ConflictResolutionPolicy.class); - Assertions.assertEquals(ConflictResolutionMode.LAST_WRITER_WINS, model.mode()); - Assertions.assertEquals("evwrdnhfuk", model.conflictResolutionPath()); - Assertions.assertEquals("sjcswsmystuluqyp", model.conflictResolutionProcedure()); + Assertions.assertEquals(ConflictResolutionMode.CUSTOM, model.mode()); + Assertions.assertEquals("vwrevkhgnlnzon", model.conflictResolutionPath()); + Assertions.assertEquals("rpiqywncv", model.conflictResolutionProcedure()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ConnectionErrorTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ConnectionErrorTests.java index 4959c03b1cca..79ee0bd07768 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ConnectionErrorTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ConnectionErrorTests.java @@ -13,13 +13,12 @@ public final class ConnectionErrorTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectionError model = BinaryData.fromString( - "{\"connectionState\":\"InternalOperatorToDataCenterCertificateError\",\"iPFrom\":\"gencdgmoq\",\"iPTo\":\"qih\",\"port\":1592793613,\"exception\":\"wlt\"}") + "{\"connectionState\":\"OperatorToDataCenterNetworkError\",\"iPFrom\":\"vucgji\",\"iPTo\":\"iqpmnufz\",\"port\":415443610,\"exception\":\"x\"}") .toObject(ConnectionError.class); - Assertions.assertEquals(ConnectionState.INTERNAL_OPERATOR_TO_DATA_CENTER_CERTIFICATE_ERROR, - model.connectionState()); - Assertions.assertEquals("gencdgmoq", model.iPFrom()); - Assertions.assertEquals("qih", model.iPTo()); - Assertions.assertEquals(1592793613, model.port()); - Assertions.assertEquals("wlt", model.exception()); + Assertions.assertEquals(ConnectionState.OPERATOR_TO_DATA_CENTER_NETWORK_ERROR, model.connectionState()); + Assertions.assertEquals("vucgji", model.iPFrom()); + Assertions.assertEquals("iqpmnufz", model.iPTo()); + Assertions.assertEquals(415443610, model.port()); + Assertions.assertEquals("x", model.exception()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ContinuousBackupInformationTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ContinuousBackupInformationTests.java index 5cf2c6db63f7..236e507b0926 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ContinuousBackupInformationTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ContinuousBackupInformationTests.java @@ -11,8 +11,8 @@ public final class ContinuousBackupInformationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ContinuousBackupInformation model = BinaryData.fromString("{\"latestRestorableTimestamp\":\"lrariaawiu\"}") + ContinuousBackupInformation model = BinaryData.fromString("{\"latestRestorableTimestamp\":\"bnwieholew\"}") .toObject(ContinuousBackupInformation.class); - Assertions.assertEquals("lrariaawiu", model.latestRestorableTimestamp()); + Assertions.assertEquals("bnwieholew", model.latestRestorableTimestamp()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ContinuousBackupRestoreLocationTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ContinuousBackupRestoreLocationTests.java index 9f40221064f1..a107da4e2939 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ContinuousBackupRestoreLocationTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ContinuousBackupRestoreLocationTests.java @@ -11,15 +11,15 @@ public final class ContinuousBackupRestoreLocationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ContinuousBackupRestoreLocation model = BinaryData.fromString("{\"location\":\"xtjjfzqlqhycav\"}") - .toObject(ContinuousBackupRestoreLocation.class); - Assertions.assertEquals("xtjjfzqlqhycav", model.location()); + ContinuousBackupRestoreLocation model + = BinaryData.fromString("{\"location\":\"lbkpb\"}").toObject(ContinuousBackupRestoreLocation.class); + Assertions.assertEquals("lbkpb", model.location()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ContinuousBackupRestoreLocation model = new ContinuousBackupRestoreLocation().withLocation("xtjjfzqlqhycav"); + ContinuousBackupRestoreLocation model = new ContinuousBackupRestoreLocation().withLocation("lbkpb"); model = BinaryData.fromObject(model).toObject(ContinuousBackupRestoreLocation.class); - Assertions.assertEquals("xtjjfzqlqhycav", model.location()); + Assertions.assertEquals("lbkpb", model.location()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ContinuousModePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ContinuousModePropertiesTests.java index def1956622fe..517864e8458b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ContinuousModePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ContinuousModePropertiesTests.java @@ -13,14 +13,14 @@ public final class ContinuousModePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ContinuousModeProperties model - = BinaryData.fromString("{\"tier\":\"Continuous30Days\"}").toObject(ContinuousModeProperties.class); - Assertions.assertEquals(ContinuousTier.CONTINUOUS30DAYS, model.tier()); + = BinaryData.fromString("{\"tier\":\"Continuous35Days\"}").toObject(ContinuousModeProperties.class); + Assertions.assertEquals(ContinuousTier.CONTINUOUS35DAYS, model.tier()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ContinuousModeProperties model = new ContinuousModeProperties().withTier(ContinuousTier.CONTINUOUS30DAYS); + ContinuousModeProperties model = new ContinuousModeProperties().withTier(ContinuousTier.CONTINUOUS35DAYS); model = BinaryData.fromObject(model).toObject(ContinuousModeProperties.class); - Assertions.assertEquals(ContinuousTier.CONTINUOUS30DAYS, model.tier()); + Assertions.assertEquals(ContinuousTier.CONTINUOUS35DAYS, model.tier()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBMongoCollectionTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBMongoCollectionTests.java new file mode 100644 index 000000000000..1090eb7c8767 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBMongoCollectionTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CosmosDBMongoCollection; +import org.junit.jupiter.api.Assertions; + +public final class CosmosDBMongoCollectionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CosmosDBMongoCollection model + = BinaryData.fromString("{\"databaseName\":\"aw\",\"collectionName\":\"eaivxwczel\"}") + .toObject(CosmosDBMongoCollection.class); + Assertions.assertEquals("aw", model.databaseName()); + Assertions.assertEquals("eaivxwczel", model.collectionName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CosmosDBMongoCollection model + = new CosmosDBMongoCollection().withDatabaseName("aw").withCollectionName("eaivxwczel"); + model = BinaryData.fromObject(model).toObject(CosmosDBMongoCollection.class); + Assertions.assertEquals("aw", model.databaseName()); + Assertions.assertEquals("eaivxwczel", model.collectionName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBMongoVCoreCollectionTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBMongoVCoreCollectionTests.java new file mode 100644 index 000000000000..614aa43df6c8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBMongoVCoreCollectionTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CosmosDBMongoVCoreCollection; +import org.junit.jupiter.api.Assertions; + +public final class CosmosDBMongoVCoreCollectionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CosmosDBMongoVCoreCollection model + = BinaryData.fromString("{\"databaseName\":\"r\",\"collectionName\":\"ywdmjsjqbjh\"}") + .toObject(CosmosDBMongoVCoreCollection.class); + Assertions.assertEquals("r", model.databaseName()); + Assertions.assertEquals("ywdmjsjqbjh", model.collectionName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CosmosDBMongoVCoreCollection model + = new CosmosDBMongoVCoreCollection().withDatabaseName("r").withCollectionName("ywdmjsjqbjh"); + model = BinaryData.fromObject(model).toObject(CosmosDBMongoVCoreCollection.class); + Assertions.assertEquals("r", model.databaseName()); + Assertions.assertEquals("ywdmjsjqbjh", model.collectionName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBNoSqlContainerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBNoSqlContainerTests.java new file mode 100644 index 000000000000..008fb1ca2a21 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBNoSqlContainerTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CosmosDBNoSqlContainer; +import org.junit.jupiter.api.Assertions; + +public final class CosmosDBNoSqlContainerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CosmosDBNoSqlContainer model = BinaryData.fromString("{\"databaseName\":\"kggkfpa\",\"containerName\":\"ao\"}") + .toObject(CosmosDBNoSqlContainer.class); + Assertions.assertEquals("kggkfpa", model.databaseName()); + Assertions.assertEquals("ao", model.containerName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CosmosDBNoSqlContainer model = new CosmosDBNoSqlContainer().withDatabaseName("kggkfpa").withContainerName("ao"); + model = BinaryData.fromObject(model).toObject(CosmosDBNoSqlContainer.class); + Assertions.assertEquals("kggkfpa", model.databaseName()); + Assertions.assertEquals("ao", model.containerName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBSourceSinkDetailsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBSourceSinkDetailsTests.java new file mode 100644 index 000000000000..2327f709a15b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosDBSourceSinkDetailsTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CosmosDBSourceSinkDetails; +import org.junit.jupiter.api.Assertions; + +public final class CosmosDBSourceSinkDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CosmosDBSourceSinkDetails model = BinaryData.fromString("{\"remoteAccountName\":\"ynkedyatrwyhqmib\"}") + .toObject(CosmosDBSourceSinkDetails.class); + Assertions.assertEquals("ynkedyatrwyhqmib", model.remoteAccountName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CosmosDBSourceSinkDetails model = new CosmosDBSourceSinkDetails().withRemoteAccountName("ynkedyatrwyhqmib"); + model = BinaryData.fromObject(model).toObject(CosmosDBSourceSinkDetails.class); + Assertions.assertEquals("ynkedyatrwyhqmib", model.remoteAccountName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosMongoDataTransferDataSourceSinkTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosMongoDataTransferDataSourceSinkTests.java new file mode 100644 index 000000000000..986106f9011d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosMongoDataTransferDataSourceSinkTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CosmosMongoDataTransferDataSourceSink; +import org.junit.jupiter.api.Assertions; + +public final class CosmosMongoDataTransferDataSourceSinkTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CosmosMongoDataTransferDataSourceSink model = BinaryData.fromString( + "{\"component\":\"CosmosDBMongo\",\"databaseName\":\"gssz\",\"collectionName\":\"vctkbbx\",\"remoteAccountName\":\"arlsirn\"}") + .toObject(CosmosMongoDataTransferDataSourceSink.class); + Assertions.assertEquals("arlsirn", model.remoteAccountName()); + Assertions.assertEquals("gssz", model.databaseName()); + Assertions.assertEquals("vctkbbx", model.collectionName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CosmosMongoDataTransferDataSourceSink model + = new CosmosMongoDataTransferDataSourceSink().withRemoteAccountName("arlsirn") + .withDatabaseName("gssz") + .withCollectionName("vctkbbx"); + model = BinaryData.fromObject(model).toObject(CosmosMongoDataTransferDataSourceSink.class); + Assertions.assertEquals("arlsirn", model.remoteAccountName()); + Assertions.assertEquals("gssz", model.databaseName()); + Assertions.assertEquals("vctkbbx", model.collectionName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosSqlDataTransferDataSourceSinkTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosSqlDataTransferDataSourceSinkTests.java new file mode 100644 index 000000000000..50714c1dd874 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CosmosSqlDataTransferDataSourceSinkTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CosmosSqlDataTransferDataSourceSink; +import org.junit.jupiter.api.Assertions; + +public final class CosmosSqlDataTransferDataSourceSinkTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CosmosSqlDataTransferDataSourceSink model = BinaryData.fromString( + "{\"component\":\"CosmosDBSql\",\"databaseName\":\"clabv\",\"containerName\":\"yngsuxxcz\",\"remoteAccountName\":\"yqjoghdsa\"}") + .toObject(CosmosSqlDataTransferDataSourceSink.class); + Assertions.assertEquals("yqjoghdsa", model.remoteAccountName()); + Assertions.assertEquals("clabv", model.databaseName()); + Assertions.assertEquals("yngsuxxcz", model.containerName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CosmosSqlDataTransferDataSourceSink model + = new CosmosSqlDataTransferDataSourceSink().withRemoteAccountName("yqjoghdsa") + .withDatabaseName("clabv") + .withContainerName("yngsuxxcz"); + model = BinaryData.fromObject(model).toObject(CosmosSqlDataTransferDataSourceSink.class); + Assertions.assertEquals("yqjoghdsa", model.remoteAccountName()); + Assertions.assertEquals("clabv", model.databaseName()); + Assertions.assertEquals("yngsuxxcz", model.containerName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CreateUpdateOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CreateUpdateOptionsTests.java index a64e88f2b3a2..205cc0c19802 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CreateUpdateOptionsTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/CreateUpdateOptionsTests.java @@ -13,18 +13,18 @@ public final class CreateUpdateOptionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CreateUpdateOptions model - = BinaryData.fromString("{\"throughput\":615108235,\"autoscaleSettings\":{\"maxThroughput\":1075232734}}") + = BinaryData.fromString("{\"throughput\":1466032347,\"autoscaleSettings\":{\"maxThroughput\":1063869072}}") .toObject(CreateUpdateOptions.class); - Assertions.assertEquals(615108235, model.throughput()); - Assertions.assertEquals(1075232734, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1466032347, model.throughput()); + Assertions.assertEquals(1063869072, model.autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CreateUpdateOptions model = new CreateUpdateOptions().withThroughput(615108235) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1075232734)); + CreateUpdateOptions model = new CreateUpdateOptions().withThroughput(1466032347) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1063869072)); model = BinaryData.fromObject(model).toObject(CreateUpdateOptions.class); - Assertions.assertEquals(615108235, model.throughput()); - Assertions.assertEquals(1075232734, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1466032347, model.throughput()); + Assertions.assertEquals(1063869072, model.autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataMaskingPolicyExcludedPathsItemTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataMaskingPolicyExcludedPathsItemTests.java new file mode 100644 index 000000000000..17fcef47766b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataMaskingPolicyExcludedPathsItemTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.DataMaskingPolicyExcludedPathsItem; +import org.junit.jupiter.api.Assertions; + +public final class DataMaskingPolicyExcludedPathsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataMaskingPolicyExcludedPathsItem model + = BinaryData.fromString("{\"path\":\"hrraiouaubrj\"}").toObject(DataMaskingPolicyExcludedPathsItem.class); + Assertions.assertEquals("hrraiouaubrj", model.path()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataMaskingPolicyExcludedPathsItem model = new DataMaskingPolicyExcludedPathsItem().withPath("hrraiouaubrj"); + model = BinaryData.fromObject(model).toObject(DataMaskingPolicyExcludedPathsItem.class); + Assertions.assertEquals("hrraiouaubrj", model.path()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataMaskingPolicyIncludedPathsItemTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataMaskingPolicyIncludedPathsItemTests.java new file mode 100644 index 000000000000..847e63dbd105 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataMaskingPolicyIncludedPathsItemTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.DataMaskingPolicyIncludedPathsItem; +import org.junit.jupiter.api.Assertions; + +public final class DataMaskingPolicyIncludedPathsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataMaskingPolicyIncludedPathsItem model = BinaryData.fromString( + "{\"path\":\"hrqbnjjrcg\",\"strategy\":\"ydcwboxjumv\",\"startPosition\":1707929789,\"length\":733872098}") + .toObject(DataMaskingPolicyIncludedPathsItem.class); + Assertions.assertEquals("hrqbnjjrcg", model.path()); + Assertions.assertEquals("ydcwboxjumv", model.strategy()); + Assertions.assertEquals(1707929789, model.startPosition()); + Assertions.assertEquals(733872098, model.length()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataMaskingPolicyIncludedPathsItem model = new DataMaskingPolicyIncludedPathsItem().withPath("hrqbnjjrcg") + .withStrategy("ydcwboxjumv") + .withStartPosition(1707929789) + .withLength(733872098); + model = BinaryData.fromObject(model).toObject(DataMaskingPolicyIncludedPathsItem.class); + Assertions.assertEquals("hrqbnjjrcg", model.path()); + Assertions.assertEquals("ydcwboxjumv", model.strategy()); + Assertions.assertEquals(1707929789, model.startPosition()); + Assertions.assertEquals(733872098, model.length()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataMaskingPolicyTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataMaskingPolicyTests.java new file mode 100644 index 000000000000..fb1a86d2f8a2 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataMaskingPolicyTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.DataMaskingPolicy; +import com.azure.resourcemanager.cosmos.models.DataMaskingPolicyExcludedPathsItem; +import com.azure.resourcemanager.cosmos.models.DataMaskingPolicyIncludedPathsItem; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DataMaskingPolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataMaskingPolicy model = BinaryData.fromString( + "{\"includedPaths\":[{\"path\":\"yvlixqnrk\",\"strategy\":\"kjibnxmysuxswqrn\",\"startPosition\":790882759,\"length\":1670220024},{\"path\":\"jpsttexoq\",\"strategy\":\"wcyyufmhruncu\",\"startPosition\":1162689425,\"length\":432418961}],\"excludedPaths\":[{\"path\":\"dqzh\"},{\"path\":\"ctddun\"},{\"path\":\"ndy\"}],\"isPolicyEnabled\":false}") + .toObject(DataMaskingPolicy.class); + Assertions.assertEquals("yvlixqnrk", model.includedPaths().get(0).path()); + Assertions.assertEquals("kjibnxmysuxswqrn", model.includedPaths().get(0).strategy()); + Assertions.assertEquals(790882759, model.includedPaths().get(0).startPosition()); + Assertions.assertEquals(1670220024, model.includedPaths().get(0).length()); + Assertions.assertEquals("dqzh", model.excludedPaths().get(0).path()); + Assertions.assertFalse(model.isPolicyEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataMaskingPolicy model = new DataMaskingPolicy() + .withIncludedPaths(Arrays.asList( + new DataMaskingPolicyIncludedPathsItem().withPath("yvlixqnrk") + .withStrategy("kjibnxmysuxswqrn") + .withStartPosition(790882759) + .withLength(1670220024), + new DataMaskingPolicyIncludedPathsItem().withPath("jpsttexoq") + .withStrategy("wcyyufmhruncu") + .withStartPosition(1162689425) + .withLength(432418961))) + .withExcludedPaths(Arrays.asList(new DataMaskingPolicyExcludedPathsItem().withPath("dqzh"), + new DataMaskingPolicyExcludedPathsItem().withPath("ctddun"), + new DataMaskingPolicyExcludedPathsItem().withPath("ndy"))) + .withIsPolicyEnabled(false); + model = BinaryData.fromObject(model).toObject(DataMaskingPolicy.class); + Assertions.assertEquals("yvlixqnrk", model.includedPaths().get(0).path()); + Assertions.assertEquals("kjibnxmysuxswqrn", model.includedPaths().get(0).strategy()); + Assertions.assertEquals(790882759, model.includedPaths().get(0).startPosition()); + Assertions.assertEquals(1670220024, model.includedPaths().get(0).length()); + Assertions.assertEquals("dqzh", model.excludedPaths().get(0).path()); + Assertions.assertFalse(model.isPolicyEnabled()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferDataSourceSinkTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferDataSourceSinkTests.java new file mode 100644 index 000000000000..5d1526645d98 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferDataSourceSinkTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.DataTransferDataSourceSink; + +public final class DataTransferDataSourceSinkTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataTransferDataSourceSink model = BinaryData.fromString("{\"component\":\"DataTransferDataSourceSink\"}") + .toObject(DataTransferDataSourceSink.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataTransferDataSourceSink model = new DataTransferDataSourceSink(); + model = BinaryData.fromObject(model).toObject(DataTransferDataSourceSink.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferRegionalServiceResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferRegionalServiceResourceTests.java index ec27174340b9..6bcac89a831b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferRegionalServiceResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferRegionalServiceResourceTests.java @@ -11,7 +11,7 @@ public final class DataTransferRegionalServiceResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataTransferRegionalServiceResource model - = BinaryData.fromString("{\"name\":\"hragpxmib\",\"location\":\"nupoyryefqmwovyz\",\"status\":\"Stopped\"}") + = BinaryData.fromString("{\"name\":\"donb\",\"location\":\"snfzyviiwsuanz\",\"status\":\"Creating\"}") .toObject(DataTransferRegionalServiceResource.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferServiceResourceCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferServiceResourceCreateUpdateParametersTests.java index b10a2218638f..bae740572f0a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferServiceResourceCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferServiceResourceCreateUpdateParametersTests.java @@ -14,19 +14,19 @@ public final class DataTransferServiceResourceCreateUpdateParametersTests { public void testDeserialize() throws Exception { DataTransferServiceResourceCreateUpdateParameters model = BinaryData .fromString( - "{\"serviceType\":\"DataTransfer\",\"instanceSize\":\"Cosmos.D4s\",\"instanceCount\":2011444801}") + "{\"serviceType\":\"DataTransfer\",\"instanceSize\":\"Cosmos.D8s\",\"instanceCount\":1477705179}") .toObject(DataTransferServiceResourceCreateUpdateParameters.class); - Assertions.assertEquals(ServiceSize.COSMOS_D4S, model.instanceSize()); - Assertions.assertEquals(2011444801, model.instanceCount()); + Assertions.assertEquals(ServiceSize.COSMOS_D8S, model.instanceSize()); + Assertions.assertEquals(1477705179, model.instanceCount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DataTransferServiceResourceCreateUpdateParameters model - = new DataTransferServiceResourceCreateUpdateParameters().withInstanceSize(ServiceSize.COSMOS_D4S) - .withInstanceCount(2011444801); + = new DataTransferServiceResourceCreateUpdateParameters().withInstanceSize(ServiceSize.COSMOS_D8S) + .withInstanceCount(1477705179); model = BinaryData.fromObject(model).toObject(DataTransferServiceResourceCreateUpdateParameters.class); - Assertions.assertEquals(ServiceSize.COSMOS_D4S, model.instanceSize()); - Assertions.assertEquals(2011444801, model.instanceCount()); + Assertions.assertEquals(ServiceSize.COSMOS_D8S, model.instanceSize()); + Assertions.assertEquals(1477705179, model.instanceCount()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferServiceResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferServiceResourcePropertiesTests.java index d5aeb32334c9..4d59ac3e0129 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferServiceResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DataTransferServiceResourcePropertiesTests.java @@ -13,9 +13,9 @@ public final class DataTransferServiceResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataTransferServiceResourceProperties model = BinaryData.fromString( - "{\"serviceType\":\"DataTransfer\",\"locations\":[{\"name\":\"faxdtnqifbsa\",\"location\":\"oiauesugmocpcj\",\"status\":\"Updating\"},{\"name\":\"elrgttwfldsiuo\",\"location\":\"nikcedpk\",\"status\":\"Running\"}],\"creationTime\":\"2021-05-23T18:22:44Z\",\"instanceSize\":\"Cosmos.D8s\",\"instanceCount\":1817794368,\"status\":\"Deleting\",\"btgmbxi\":\"\\\"dataqvvyczyay\\\"\"}") + "{\"serviceType\":\"DataTransfer\",\"locations\":[{\"name\":\"cqufylam\",\"location\":\"wbg\",\"status\":\"Running\"}],\"creationTime\":\"2021-11-06T04:37:52Z\",\"instanceSize\":\"Cosmos.D8s\",\"instanceCount\":2114305274,\"status\":\"Updating\",\"iknsgo\":\"\\\"datatipquks\\\"\",\"gvm\":\"\\\"dataunswhpcek\\\"\",\"eetxtpwcv\":\"\\\"datannbbxngdfkke\\\"\",\"wsunjzijaciwmmpd\":\"\\\"datai\\\"\"}") .toObject(DataTransferServiceResourceProperties.class); Assertions.assertEquals(ServiceSize.COSMOS_D8S, model.instanceSize()); - Assertions.assertEquals(1817794368, model.instanceCount()); + Assertions.assertEquals(2114305274, model.instanceCount()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DiagnosticLogSettingsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DiagnosticLogSettingsTests.java new file mode 100644 index 000000000000..5270c0a30494 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/DiagnosticLogSettingsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.DiagnosticLogSettings; +import com.azure.resourcemanager.cosmos.models.EnableFullTextQuery; +import org.junit.jupiter.api.Assertions; + +public final class DiagnosticLogSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiagnosticLogSettings model + = BinaryData.fromString("{\"enableFullTextQuery\":\"True\"}").toObject(DiagnosticLogSettings.class); + Assertions.assertEquals(EnableFullTextQuery.TRUE, model.enableFullTextQuery()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DiagnosticLogSettings model = new DiagnosticLogSettings().withEnableFullTextQuery(EnableFullTextQuery.TRUE); + model = BinaryData.fromObject(model).toObject(DiagnosticLogSettings.class); + Assertions.assertEquals(EnableFullTextQuery.TRUE, model.enableFullTextQuery()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ExcludedPathTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ExcludedPathTests.java index 80d5ca5891f3..1859319faac4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ExcludedPathTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ExcludedPathTests.java @@ -11,14 +11,14 @@ public final class ExcludedPathTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ExcludedPath model = BinaryData.fromString("{\"path\":\"xakvvjgslor\"}").toObject(ExcludedPath.class); - Assertions.assertEquals("xakvvjgslor", model.path()); + ExcludedPath model = BinaryData.fromString("{\"path\":\"jpahlxvea\"}").toObject(ExcludedPath.class); + Assertions.assertEquals("jpahlxvea", model.path()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ExcludedPath model = new ExcludedPath().withPath("xakvvjgslor"); + ExcludedPath model = new ExcludedPath().withPath("jpahlxvea"); model = BinaryData.fromObject(model).toObject(ExcludedPath.class); - Assertions.assertEquals("xakvvjgslor", model.path()); + Assertions.assertEquals("jpahlxvea", model.path()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FailoverPoliciesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FailoverPoliciesTests.java index a2448992b10c..c2f53210d0dd 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FailoverPoliciesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FailoverPoliciesTests.java @@ -14,20 +14,20 @@ public final class FailoverPoliciesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FailoverPolicies model = BinaryData.fromString( - "{\"failoverPolicies\":[{\"id\":\"nzbtbhj\",\"locationName\":\"lkfg\",\"failoverPriority\":1036395530},{\"id\":\"euel\",\"locationName\":\"hsd\",\"failoverPriority\":58245942},{\"id\":\"zfikd\",\"locationName\":\"wq\",\"failoverPriority\":180318621}]}") + "{\"failoverPolicies\":[{\"id\":\"sub\",\"locationName\":\"jbi\",\"failoverPriority\":532379819},{\"id\":\"ybsrfbjfdtwss\",\"locationName\":\"ftpvjzbexil\",\"failoverPriority\":1948356330},{\"id\":\"qqnvwpmq\",\"locationName\":\"ruoujmk\",\"failoverPriority\":1426920839}]}") .toObject(FailoverPolicies.class); - Assertions.assertEquals("lkfg", model.failoverPolicies().get(0).locationName()); - Assertions.assertEquals(1036395530, model.failoverPolicies().get(0).failoverPriority()); + Assertions.assertEquals("jbi", model.failoverPolicies().get(0).locationName()); + Assertions.assertEquals(532379819, model.failoverPolicies().get(0).failoverPriority()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FailoverPolicies model = new FailoverPolicies().withFailoverPolicies( - Arrays.asList(new FailoverPolicy().withLocationName("lkfg").withFailoverPriority(1036395530), - new FailoverPolicy().withLocationName("hsd").withFailoverPriority(58245942), - new FailoverPolicy().withLocationName("wq").withFailoverPriority(180318621))); + Arrays.asList(new FailoverPolicy().withLocationName("jbi").withFailoverPriority(532379819), + new FailoverPolicy().withLocationName("ftpvjzbexil").withFailoverPriority(1948356330), + new FailoverPolicy().withLocationName("ruoujmk").withFailoverPriority(1426920839))); model = BinaryData.fromObject(model).toObject(FailoverPolicies.class); - Assertions.assertEquals("lkfg", model.failoverPolicies().get(0).locationName()); - Assertions.assertEquals(1036395530, model.failoverPolicies().get(0).failoverPriority()); + Assertions.assertEquals("jbi", model.failoverPolicies().get(0).locationName()); + Assertions.assertEquals(532379819, model.failoverPolicies().get(0).failoverPriority()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsListResultTests.java new file mode 100644 index 000000000000..c1ec2f61047e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsListResultTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.implementation.models.FleetAnalyticsListResult; +import com.azure.resourcemanager.cosmos.models.FleetAnalyticsPropertiesStorageLocationType; +import org.junit.jupiter.api.Assertions; + +public final class FleetAnalyticsListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FleetAnalyticsListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Uninitialized\",\"storageLocationType\":\"FabricLakehouse\",\"storageLocationUri\":\"skkfkuyikm\"},\"id\":\"hqsxjbjkewrig\",\"name\":\"bqtrefeclflxc\",\"type\":\"ffzw\"}],\"nextLink\":\"vdef\"}") + .toObject(FleetAnalyticsListResult.class); + Assertions.assertEquals(FleetAnalyticsPropertiesStorageLocationType.FABRIC_LAKEHOUSE, + model.value().get(0).storageLocationType()); + Assertions.assertEquals("skkfkuyikm", model.value().get(0).storageLocationUri()); + Assertions.assertEquals("vdef", model.nextLink()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsPropertiesTests.java new file mode 100644 index 000000000000..3df236d99342 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsPropertiesTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.FleetAnalyticsProperties; +import com.azure.resourcemanager.cosmos.models.FleetAnalyticsPropertiesStorageLocationType; +import org.junit.jupiter.api.Assertions; + +public final class FleetAnalyticsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FleetAnalyticsProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Succeeded\",\"storageLocationType\":\"FabricLakehouse\",\"storageLocationUri\":\"rmdtacntjnaffhv\"}") + .toObject(FleetAnalyticsProperties.class); + Assertions.assertEquals(FleetAnalyticsPropertiesStorageLocationType.FABRIC_LAKEHOUSE, + model.storageLocationType()); + Assertions.assertEquals("rmdtacntjnaffhv", model.storageLocationUri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FleetAnalyticsProperties model = new FleetAnalyticsProperties() + .withStorageLocationType(FleetAnalyticsPropertiesStorageLocationType.FABRIC_LAKEHOUSE) + .withStorageLocationUri("rmdtacntjnaffhv"); + model = BinaryData.fromObject(model).toObject(FleetAnalyticsProperties.class); + Assertions.assertEquals(FleetAnalyticsPropertiesStorageLocationType.FABRIC_LAKEHOUSE, + model.storageLocationType()); + Assertions.assertEquals("rmdtacntjnaffhv", model.storageLocationUri()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsResourceInnerTests.java new file mode 100644 index 000000000000..de6611da0a24 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetAnalyticsResourceInnerTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.FleetAnalyticsResourceInner; +import com.azure.resourcemanager.cosmos.models.FleetAnalyticsPropertiesStorageLocationType; +import org.junit.jupiter.api.Assertions; + +public final class FleetAnalyticsResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FleetAnalyticsResourceInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Creating\",\"storageLocationType\":\"FabricLakehouse\",\"storageLocationUri\":\"xnrz\"},\"id\":\"x\",\"name\":\"ahhsmfndcbsyhlud\",\"type\":\"jkkovohwvprj\"}") + .toObject(FleetAnalyticsResourceInner.class); + Assertions.assertEquals(FleetAnalyticsPropertiesStorageLocationType.FABRIC_LAKEHOUSE, + model.storageLocationType()); + Assertions.assertEquals("xnrz", model.storageLocationUri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FleetAnalyticsResourceInner model = new FleetAnalyticsResourceInner() + .withStorageLocationType(FleetAnalyticsPropertiesStorageLocationType.FABRIC_LAKEHOUSE) + .withStorageLocationUri("xnrz"); + model = BinaryData.fromObject(model).toObject(FleetAnalyticsResourceInner.class); + Assertions.assertEquals(FleetAnalyticsPropertiesStorageLocationType.FABRIC_LAKEHOUSE, + model.storageLocationType()); + Assertions.assertEquals("xnrz", model.storageLocationUri()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetListResultTests.java index 84f5fac5cd76..8c070467224c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetListResultTests.java @@ -12,10 +12,10 @@ public final class FleetListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"InternallyReady\"},\"location\":\"utxfptofhgnuyw\",\"tags\":{\"aaqwvkg\":\"gvad\"},\"id\":\"pytpmpvdnogehlu\",\"name\":\"b\",\"type\":\"rtbnu\"},{\"properties\":{\"provisioningState\":\"Initializing\"},\"location\":\"zsvbxxyjisskobq\",\"tags\":{\"smvrkdpsqe\":\"flioewyhxe\",\"ses\":\"fbdxm\",\"ib\":\"rujbjpppktlp\",\"qplgtkihonikz\":\"mthieatnejrnmin\"},\"id\":\"r\",\"name\":\"f\",\"type\":\"f\"}],\"nextLink\":\"lzfbpntogken\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Online\"},\"location\":\"iuajklnacgdn\",\"tags\":{\"d\":\"onmzrjjaojpzn\",\"qyuddk\":\"zigecwsad\",\"hheuyuun\":\"wqdm\"},\"id\":\"myevyigdeipn\",\"name\":\"izej\",\"type\":\"li\"},{\"properties\":{\"provisioningState\":\"Deleting\"},\"location\":\"jzwhajod\",\"tags\":{\"hdyncradxs\":\"o\",\"e\":\"w\",\"ygihiclmslnu\":\"pfapmqnmelyk\",\"awexizb\":\"kqvzlbbbajdexq\"},\"id\":\"zetjizwh\",\"name\":\"nbmajvvyxtvvx\",\"type\":\"akzixb\"}],\"nextLink\":\"ybfmlngfwhrmvl\"}") .toObject(FleetListResult.class); - Assertions.assertEquals("utxfptofhgnuyw", model.value().get(0).location()); - Assertions.assertEquals("gvad", model.value().get(0).tags().get("aaqwvkg")); - Assertions.assertEquals("lzfbpntogken", model.nextLink()); + Assertions.assertEquals("iuajklnacgdn", model.value().get(0).location()); + Assertions.assertEquals("onmzrjjaojpzn", model.value().get(0).tags().get("d")); + Assertions.assertEquals("ybfmlngfwhrmvl", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetResourceInnerTests.java index 46ebc937ddfa..8449ed0e00b2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetResourceInnerTests.java @@ -14,20 +14,19 @@ public final class FleetResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetResourceInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\"},\"location\":\"bgsosc\",\"tags\":{\"n\":\"ezfvbe\",\"tekwwnthropm\":\"fkbpjn\",\"yiurztvktjh\":\"ud\",\"hpuzxkpye\":\"fecqkoqyouerga\"},\"id\":\"hfdyldhgye\",\"name\":\"zfz\",\"type\":\"iyuq\"}") + "{\"properties\":{\"provisioningState\":\"Initializing\"},\"location\":\"wuzrono\",\"tags\":{\"nwysodcikgxkkzzf\":\"zfk\"},\"id\":\"d\",\"name\":\"ekebawnxzs\",\"type\":\"wyfixi\"}") .toObject(FleetResourceInner.class); - Assertions.assertEquals("bgsosc", model.location()); - Assertions.assertEquals("ezfvbe", model.tags().get("n")); + Assertions.assertEquals("wuzrono", model.location()); + Assertions.assertEquals("zfk", model.tags().get("nwysodcikgxkkzzf")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FleetResourceInner model = new FleetResourceInner().withLocation("bgsosc") - .withTags( - mapOf("n", "ezfvbe", "tekwwnthropm", "fkbpjn", "yiurztvktjh", "ud", "hpuzxkpye", "fecqkoqyouerga")); + FleetResourceInner model + = new FleetResourceInner().withLocation("wuzrono").withTags(mapOf("nwysodcikgxkkzzf", "zfk")); model = BinaryData.fromObject(model).toObject(FleetResourceInner.class); - Assertions.assertEquals("bgsosc", model.location()); - Assertions.assertEquals("ezfvbe", model.tags().get("n")); + Assertions.assertEquals("wuzrono", model.location()); + Assertions.assertEquals("zfk", model.tags().get("nwysodcikgxkkzzf")); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetResourcePropertiesTests.java index 915f2533bb90..fff85cd6759b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetResourcePropertiesTests.java @@ -11,7 +11,7 @@ public final class FleetResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetResourceProperties model - = BinaryData.fromString("{\"provisioningState\":\"Succeeded\"}").toObject(FleetResourceProperties.class); + = BinaryData.fromString("{\"provisioningState\":\"Updating\"}").toObject(FleetResourceProperties.class); } @org.junit.jupiter.api.Test diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetResourceUpdateTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetResourceUpdateTests.java index be81290ad59f..f9f20112b9c6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetResourceUpdateTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetResourceUpdateTests.java @@ -14,17 +14,17 @@ public final class FleetResourceUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetResourceUpdate model = BinaryData.fromString( - "{\"tags\":{\"hpjlwyxedznmxrf\":\"eunokakz\",\"px\":\"mckewvmyif\"},\"properties\":{\"provisioningState\":\"Online\"}}") + "{\"tags\":{\"pjkakrxifqnf\":\"aiwu\",\"guxcmmhip\":\"orxsqtzngxbsale\",\"itlynkwfsa\":\"vsk\",\"gb\":\"ng\"},\"properties\":{\"provisioningState\":\"Succeeded\"}}") .toObject(FleetResourceUpdate.class); - Assertions.assertEquals("eunokakz", model.tags().get("hpjlwyxedznmxrf")); + Assertions.assertEquals("aiwu", model.tags().get("pjkakrxifqnf")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FleetResourceUpdate model - = new FleetResourceUpdate().withTags(mapOf("hpjlwyxedznmxrf", "eunokakz", "px", "mckewvmyif")); + FleetResourceUpdate model = new FleetResourceUpdate() + .withTags(mapOf("pjkakrxifqnf", "aiwu", "guxcmmhip", "orxsqtzngxbsale", "itlynkwfsa", "vsk", "gb", "ng")); model = BinaryData.fromObject(model).toObject(FleetResourceUpdate.class); - Assertions.assertEquals("eunokakz", model.tags().get("hpjlwyxedznmxrf")); + Assertions.assertEquals("aiwu", model.tags().get("pjkakrxifqnf")); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountListResultTests.java index 296182ca6647..6af2a7aebb26 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountListResultTests.java @@ -12,11 +12,11 @@ public final class FleetspaceAccountListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetspaceAccountListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"globalDatabaseAccountProperties\":{\"resourceId\":\"etbapfczewxtrlqb\",\"armLocation\":\"yazkjpir\"}},\"id\":\"xvb\",\"name\":\"zwhy\",\"type\":\"gbth\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"globalDatabaseAccountProperties\":{\"resourceId\":\"buiggrunozf\",\"armLocation\":\"aljthoivsdwsn\"}},\"id\":\"rfihscj\",\"name\":\"akmhz\",\"type\":\"hwahfbw\"},{\"properties\":{\"provisioningState\":\"Creating\",\"globalDatabaseAccountProperties\":{\"resourceId\":\"em\",\"armLocation\":\"nuqqkotauratnicp\"}},\"id\":\"zsclefyrletn\",\"name\":\"qlmfdg\",\"type\":\"n\"}],\"nextLink\":\"uypw\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"globalDatabaseAccountProperties\":{\"resourceId\":\"relsxfkzrz\",\"armLocation\":\"rjvqxvwkiocxoer\"}},\"id\":\"buocq\",\"name\":\"lmnlrlqxbctatez\",\"type\":\"o\"},{\"properties\":{\"provisioningState\":\"Creating\",\"globalDatabaseAccountProperties\":{\"resourceId\":\"nlsjxcscnitodmra\",\"armLocation\":\"jido\"}},\"id\":\"vltcvmahpuwku\",\"name\":\"bbnhi\",\"type\":\"lh\"}],\"nextLink\":\"hrcqdfwbifnnhl\"}") .toObject(FleetspaceAccountListResult.class); - Assertions.assertEquals("etbapfczewxtrlqb", - model.value().get(0).globalDatabaseAccountProperties().resourceId()); - Assertions.assertEquals("yazkjpir", model.value().get(0).globalDatabaseAccountProperties().armLocation()); - Assertions.assertEquals("uypw", model.nextLink()); + Assertions.assertEquals("relsxfkzrz", model.value().get(0).globalDatabaseAccountProperties().resourceId()); + Assertions.assertEquals("rjvqxvwkiocxoer", + model.value().get(0).globalDatabaseAccountProperties().armLocation()); + Assertions.assertEquals("hrcqdfwbifnnhl", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountPropertiesGlobalDatabaseAccountPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountPropertiesGlobalDatabaseAccountPropertiesTests.java index 5b45a5d83037..c5d38c7ffa19 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountPropertiesGlobalDatabaseAccountPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountPropertiesGlobalDatabaseAccountPropertiesTests.java @@ -12,19 +12,19 @@ public final class FleetspaceAccountPropertiesGlobalDatabaseAccountPropertiesTes @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetspaceAccountPropertiesGlobalDatabaseAccountProperties model - = BinaryData.fromString("{\"resourceId\":\"yddeeqz\",\"armLocation\":\"abm\"}") + = BinaryData.fromString("{\"resourceId\":\"mvj\",\"armLocation\":\"r\"}") .toObject(FleetspaceAccountPropertiesGlobalDatabaseAccountProperties.class); - Assertions.assertEquals("yddeeqz", model.resourceId()); - Assertions.assertEquals("abm", model.armLocation()); + Assertions.assertEquals("mvj", model.resourceId()); + Assertions.assertEquals("r", model.armLocation()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FleetspaceAccountPropertiesGlobalDatabaseAccountProperties model - = new FleetspaceAccountPropertiesGlobalDatabaseAccountProperties().withResourceId("yddeeqz") - .withArmLocation("abm"); + = new FleetspaceAccountPropertiesGlobalDatabaseAccountProperties().withResourceId("mvj") + .withArmLocation("r"); model = BinaryData.fromObject(model).toObject(FleetspaceAccountPropertiesGlobalDatabaseAccountProperties.class); - Assertions.assertEquals("yddeeqz", model.resourceId()); - Assertions.assertEquals("abm", model.armLocation()); + Assertions.assertEquals("mvj", model.resourceId()); + Assertions.assertEquals("r", model.armLocation()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountPropertiesTests.java index fdb537f3b314..fe97976d512a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountPropertiesTests.java @@ -13,19 +13,19 @@ public final class FleetspaceAccountPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetspaceAccountProperties model = BinaryData.fromString( - "{\"provisioningState\":\"InternallyReady\",\"globalDatabaseAccountProperties\":{\"resourceId\":\"rcjlvkrkegtyczup\",\"armLocation\":\"yxlz\"}}") + "{\"provisioningState\":\"InternallyReady\",\"globalDatabaseAccountProperties\":{\"resourceId\":\"wjalw\",\"armLocation\":\"ofxca\"}}") .toObject(FleetspaceAccountProperties.class); - Assertions.assertEquals("rcjlvkrkegtyczup", model.globalDatabaseAccountProperties().resourceId()); - Assertions.assertEquals("yxlz", model.globalDatabaseAccountProperties().armLocation()); + Assertions.assertEquals("wjalw", model.globalDatabaseAccountProperties().resourceId()); + Assertions.assertEquals("ofxca", model.globalDatabaseAccountProperties().armLocation()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FleetspaceAccountProperties model = new FleetspaceAccountProperties().withGlobalDatabaseAccountProperties( - new FleetspaceAccountPropertiesGlobalDatabaseAccountProperties().withResourceId("rcjlvkrkegtyczup") - .withArmLocation("yxlz")); + new FleetspaceAccountPropertiesGlobalDatabaseAccountProperties().withResourceId("wjalw") + .withArmLocation("ofxca")); model = BinaryData.fromObject(model).toObject(FleetspaceAccountProperties.class); - Assertions.assertEquals("rcjlvkrkegtyczup", model.globalDatabaseAccountProperties().resourceId()); - Assertions.assertEquals("yxlz", model.globalDatabaseAccountProperties().armLocation()); + Assertions.assertEquals("wjalw", model.globalDatabaseAccountProperties().resourceId()); + Assertions.assertEquals("ofxca", model.globalDatabaseAccountProperties().armLocation()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountResourceInnerTests.java index 02e83827260f..7c63c2aa8f85 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceAccountResourceInnerTests.java @@ -13,19 +13,19 @@ public final class FleetspaceAccountResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetspaceAccountResourceInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Updating\",\"globalDatabaseAccountProperties\":{\"resourceId\":\"ixlxic\",\"armLocation\":\"pthdcfmf\"}},\"id\":\"fasfod\",\"name\":\"opalvngtwyu\",\"type\":\"kwgqrn\"}") + "{\"properties\":{\"provisioningState\":\"InternallyReady\",\"globalDatabaseAccountProperties\":{\"resourceId\":\"iz\",\"armLocation\":\"jrahgdstu\"}},\"id\":\"ggxzsshxl\",\"name\":\"qmsckwhfm\",\"type\":\"oii\"}") .toObject(FleetspaceAccountResourceInner.class); - Assertions.assertEquals("ixlxic", model.globalDatabaseAccountProperties().resourceId()); - Assertions.assertEquals("pthdcfmf", model.globalDatabaseAccountProperties().armLocation()); + Assertions.assertEquals("iz", model.globalDatabaseAccountProperties().resourceId()); + Assertions.assertEquals("jrahgdstu", model.globalDatabaseAccountProperties().armLocation()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FleetspaceAccountResourceInner model = new FleetspaceAccountResourceInner().withGlobalDatabaseAccountProperties( - new FleetspaceAccountPropertiesGlobalDatabaseAccountProperties().withResourceId("ixlxic") - .withArmLocation("pthdcfmf")); + new FleetspaceAccountPropertiesGlobalDatabaseAccountProperties().withResourceId("iz") + .withArmLocation("jrahgdstu")); model = BinaryData.fromObject(model).toObject(FleetspaceAccountResourceInner.class); - Assertions.assertEquals("ixlxic", model.globalDatabaseAccountProperties().resourceId()); - Assertions.assertEquals("pthdcfmf", model.globalDatabaseAccountProperties().armLocation()); + Assertions.assertEquals("iz", model.globalDatabaseAccountProperties().resourceId()); + Assertions.assertEquals("jrahgdstu", model.globalDatabaseAccountProperties().armLocation()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceListResultTests.java index b071e82a6606..18430df80247 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceListResultTests.java @@ -14,17 +14,17 @@ public final class FleetspaceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetspaceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Online\",\"fleetspaceApiKind\":\"NoSQL\",\"serviceTier\":\"GeneralPurpose\",\"dataRegions\":[\"nhtmeplhbp\",\"bap\",\"ummmkvavucgji\",\"aiq\"],\"throughputPoolConfiguration\":{\"minThroughput\":1940753594,\"maxThroughput\":1431651894,\"dedicatedRUs\":5873691817945541274,\"maxConsumableRUs\":464292919391586778}},\"id\":\"uzdmhv\",\"name\":\"lvivj\",\"type\":\"xmlitqdsjip\"},{\"properties\":{\"provisioningState\":\"InternallyReady\",\"fleetspaceApiKind\":\"NoSQL\",\"serviceTier\":\"GeneralPurpose\",\"dataRegions\":[\"riifefn\"],\"throughputPoolConfiguration\":{\"minThroughput\":173143566,\"maxThroughput\":1677805514,\"dedicatedRUs\":5722887155206429100,\"maxConsumableRUs\":7822603693152244116}},\"id\":\"eailwdqmqf\",\"name\":\"deotmfx\",\"type\":\"kd\"}],\"nextLink\":\"wgnamkuuy\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Initializing\",\"fleetspaceApiKind\":\"NoSQL\",\"serviceTier\":\"GeneralPurpose\",\"dataRegions\":[\"au\",\"fshznu\",\"ttuhaaax\"],\"throughputPoolConfiguration\":{\"minThroughput\":487545221,\"maxThroughput\":178534975,\"dedicatedRUs\":7741917657137270977,\"maxConsumableRUs\":5949862560682157515}},\"id\":\"mbecxs\",\"name\":\"owagehxuihwes\",\"type\":\"tjaqgbl\"},{\"properties\":{\"provisioningState\":\"Creating\",\"fleetspaceApiKind\":\"NoSQL\",\"serviceTier\":\"BusinessCritical\",\"dataRegions\":[\"spsaneyvaerpiob\",\"hrfbrj\",\"kjwqdmraqnilp\"],\"throughputPoolConfiguration\":{\"minThroughput\":1799589380,\"maxThroughput\":703772124,\"dedicatedRUs\":8710729360806434411,\"maxConsumableRUs\":6369529725398699244}},\"id\":\"f\",\"name\":\"jwlzseodtqfdrsl\",\"type\":\"ymqxserwy\"}],\"nextLink\":\"hytjwgetfigw\"}") .toObject(FleetspaceListResult.class); Assertions.assertEquals(FleetspacePropertiesFleetspaceApiKind.NO_SQL, model.value().get(0).fleetspaceApiKind()); Assertions.assertEquals(FleetspacePropertiesServiceTier.GENERAL_PURPOSE, model.value().get(0).serviceTier()); - Assertions.assertEquals("nhtmeplhbp", model.value().get(0).dataRegions().get(0)); - Assertions.assertEquals(1940753594, model.value().get(0).throughputPoolConfiguration().minThroughput()); - Assertions.assertEquals(1431651894, model.value().get(0).throughputPoolConfiguration().maxThroughput()); - Assertions.assertEquals(5873691817945541274L, + Assertions.assertEquals("au", model.value().get(0).dataRegions().get(0)); + Assertions.assertEquals(487545221, model.value().get(0).throughputPoolConfiguration().minThroughput()); + Assertions.assertEquals(178534975, model.value().get(0).throughputPoolConfiguration().maxThroughput()); + Assertions.assertEquals(7741917657137270977L, model.value().get(0).throughputPoolConfiguration().dedicatedRUs()); - Assertions.assertEquals(464292919391586778L, + Assertions.assertEquals(5949862560682157515L, model.value().get(0).throughputPoolConfiguration().maxConsumableRUs()); - Assertions.assertEquals("wgnamkuuy", model.nextLink()); + Assertions.assertEquals("hytjwgetfigw", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspacePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspacePropertiesTests.java index 13d818928489..6e69a41f34fb 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspacePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspacePropertiesTests.java @@ -16,15 +16,15 @@ public final class FleetspacePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetspaceProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Uninitialized\",\"fleetspaceApiKind\":\"NoSQL\",\"serviceTier\":\"BusinessCritical\",\"dataRegions\":[\"lfvhlqcskkqjm\"],\"throughputPoolConfiguration\":{\"minThroughput\":267955466,\"maxThroughput\":1067653949,\"dedicatedRUs\":5067502145305671473,\"maxConsumableRUs\":8917923588503952120}}") + "{\"provisioningState\":\"Succeeded\",\"fleetspaceApiKind\":\"NoSQL\",\"serviceTier\":\"BusinessCritical\",\"dataRegions\":[\"nhptjlrkdcy\"],\"throughputPoolConfiguration\":{\"minThroughput\":1382485200,\"maxThroughput\":1551514224,\"dedicatedRUs\":3667394137675611990,\"maxConsumableRUs\":6586563088968830874}}") .toObject(FleetspaceProperties.class); Assertions.assertEquals(FleetspacePropertiesFleetspaceApiKind.NO_SQL, model.fleetspaceApiKind()); Assertions.assertEquals(FleetspacePropertiesServiceTier.BUSINESS_CRITICAL, model.serviceTier()); - Assertions.assertEquals("lfvhlqcskkqjm", model.dataRegions().get(0)); - Assertions.assertEquals(267955466, model.throughputPoolConfiguration().minThroughput()); - Assertions.assertEquals(1067653949, model.throughputPoolConfiguration().maxThroughput()); - Assertions.assertEquals(5067502145305671473L, model.throughputPoolConfiguration().dedicatedRUs()); - Assertions.assertEquals(8917923588503952120L, model.throughputPoolConfiguration().maxConsumableRUs()); + Assertions.assertEquals("nhptjlrkdcy", model.dataRegions().get(0)); + Assertions.assertEquals(1382485200, model.throughputPoolConfiguration().minThroughput()); + Assertions.assertEquals(1551514224, model.throughputPoolConfiguration().maxThroughput()); + Assertions.assertEquals(3667394137675611990L, model.throughputPoolConfiguration().dedicatedRUs()); + Assertions.assertEquals(6586563088968830874L, model.throughputPoolConfiguration().maxConsumableRUs()); } @org.junit.jupiter.api.Test @@ -32,19 +32,19 @@ public void testSerialize() throws Exception { FleetspaceProperties model = new FleetspaceProperties().withFleetspaceApiKind(FleetspacePropertiesFleetspaceApiKind.NO_SQL) .withServiceTier(FleetspacePropertiesServiceTier.BUSINESS_CRITICAL) - .withDataRegions(Arrays.asList("lfvhlqcskkqjm")) + .withDataRegions(Arrays.asList("nhptjlrkdcy")) .withThroughputPoolConfiguration( - new FleetspacePropertiesThroughputPoolConfiguration().withMinThroughput(267955466) - .withMaxThroughput(1067653949) - .withDedicatedRUs(5067502145305671473L) - .withMaxConsumableRUs(8917923588503952120L)); + new FleetspacePropertiesThroughputPoolConfiguration().withMinThroughput(1382485200) + .withMaxThroughput(1551514224) + .withDedicatedRUs(3667394137675611990L) + .withMaxConsumableRUs(6586563088968830874L)); model = BinaryData.fromObject(model).toObject(FleetspaceProperties.class); Assertions.assertEquals(FleetspacePropertiesFleetspaceApiKind.NO_SQL, model.fleetspaceApiKind()); Assertions.assertEquals(FleetspacePropertiesServiceTier.BUSINESS_CRITICAL, model.serviceTier()); - Assertions.assertEquals("lfvhlqcskkqjm", model.dataRegions().get(0)); - Assertions.assertEquals(267955466, model.throughputPoolConfiguration().minThroughput()); - Assertions.assertEquals(1067653949, model.throughputPoolConfiguration().maxThroughput()); - Assertions.assertEquals(5067502145305671473L, model.throughputPoolConfiguration().dedicatedRUs()); - Assertions.assertEquals(8917923588503952120L, model.throughputPoolConfiguration().maxConsumableRUs()); + Assertions.assertEquals("nhptjlrkdcy", model.dataRegions().get(0)); + Assertions.assertEquals(1382485200, model.throughputPoolConfiguration().minThroughput()); + Assertions.assertEquals(1551514224, model.throughputPoolConfiguration().maxThroughput()); + Assertions.assertEquals(3667394137675611990L, model.throughputPoolConfiguration().dedicatedRUs()); + Assertions.assertEquals(6586563088968830874L, model.throughputPoolConfiguration().maxConsumableRUs()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspacePropertiesThroughputPoolConfigurationTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspacePropertiesThroughputPoolConfigurationTests.java index 46a7bf555a74..97e9514293af 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspacePropertiesThroughputPoolConfigurationTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspacePropertiesThroughputPoolConfigurationTests.java @@ -12,25 +12,25 @@ public final class FleetspacePropertiesThroughputPoolConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetspacePropertiesThroughputPoolConfiguration model = BinaryData.fromString( - "{\"minThroughput\":326530419,\"maxThroughput\":342537841,\"dedicatedRUs\":4415414185373352874,\"maxConsumableRUs\":9164451009862825116}") + "{\"minThroughput\":1520186432,\"maxThroughput\":970852790,\"dedicatedRUs\":6534731570373706775,\"maxConsumableRUs\":1612514202751885810}") .toObject(FleetspacePropertiesThroughputPoolConfiguration.class); - Assertions.assertEquals(326530419, model.minThroughput()); - Assertions.assertEquals(342537841, model.maxThroughput()); - Assertions.assertEquals(4415414185373352874L, model.dedicatedRUs()); - Assertions.assertEquals(9164451009862825116L, model.maxConsumableRUs()); + Assertions.assertEquals(1520186432, model.minThroughput()); + Assertions.assertEquals(970852790, model.maxThroughput()); + Assertions.assertEquals(6534731570373706775L, model.dedicatedRUs()); + Assertions.assertEquals(1612514202751885810L, model.maxConsumableRUs()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FleetspacePropertiesThroughputPoolConfiguration model - = new FleetspacePropertiesThroughputPoolConfiguration().withMinThroughput(326530419) - .withMaxThroughput(342537841) - .withDedicatedRUs(4415414185373352874L) - .withMaxConsumableRUs(9164451009862825116L); + = new FleetspacePropertiesThroughputPoolConfiguration().withMinThroughput(1520186432) + .withMaxThroughput(970852790) + .withDedicatedRUs(6534731570373706775L) + .withMaxConsumableRUs(1612514202751885810L); model = BinaryData.fromObject(model).toObject(FleetspacePropertiesThroughputPoolConfiguration.class); - Assertions.assertEquals(326530419, model.minThroughput()); - Assertions.assertEquals(342537841, model.maxThroughput()); - Assertions.assertEquals(4415414185373352874L, model.dedicatedRUs()); - Assertions.assertEquals(9164451009862825116L, model.maxConsumableRUs()); + Assertions.assertEquals(1520186432, model.minThroughput()); + Assertions.assertEquals(970852790, model.maxThroughput()); + Assertions.assertEquals(6534731570373706775L, model.dedicatedRUs()); + Assertions.assertEquals(1612514202751885810L, model.maxConsumableRUs()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceResourceInnerTests.java index 7f5f37ed4aa9..5e5df33f4c69 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceResourceInnerTests.java @@ -16,15 +16,15 @@ public final class FleetspaceResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetspaceResourceInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Failed\",\"fleetspaceApiKind\":\"NoSQL\",\"serviceTier\":\"GeneralPurpose\",\"dataRegions\":[\"oyfxxkwykuqdndx\",\"ykhkg\"],\"throughputPoolConfiguration\":{\"minThroughput\":109130639,\"maxThroughput\":642442067,\"dedicatedRUs\":4517860496852863838,\"maxConsumableRUs\":6856150375213261489}},\"id\":\"cd\",\"name\":\"rnrnjrcufmbgacnr\",\"type\":\"fdtncmspsanma\"}") + "{\"properties\":{\"provisioningState\":\"Canceled\",\"fleetspaceApiKind\":\"NoSQL\",\"serviceTier\":\"GeneralPurpose\",\"dataRegions\":[\"n\",\"tqrcjqp\",\"jvnpjrrh\",\"gsjbi\"],\"throughputPoolConfiguration\":{\"minThroughput\":1874325220,\"maxThroughput\":199329303,\"dedicatedRUs\":4955502586150653240,\"maxConsumableRUs\":4726547622840728423}},\"id\":\"aolid\",\"name\":\"dfs\",\"type\":\"vkjcim\"}") .toObject(FleetspaceResourceInner.class); Assertions.assertEquals(FleetspacePropertiesFleetspaceApiKind.NO_SQL, model.fleetspaceApiKind()); Assertions.assertEquals(FleetspacePropertiesServiceTier.GENERAL_PURPOSE, model.serviceTier()); - Assertions.assertEquals("oyfxxkwykuqdndx", model.dataRegions().get(0)); - Assertions.assertEquals(109130639, model.throughputPoolConfiguration().minThroughput()); - Assertions.assertEquals(642442067, model.throughputPoolConfiguration().maxThroughput()); - Assertions.assertEquals(4517860496852863838L, model.throughputPoolConfiguration().dedicatedRUs()); - Assertions.assertEquals(6856150375213261489L, model.throughputPoolConfiguration().maxConsumableRUs()); + Assertions.assertEquals("n", model.dataRegions().get(0)); + Assertions.assertEquals(1874325220, model.throughputPoolConfiguration().minThroughput()); + Assertions.assertEquals(199329303, model.throughputPoolConfiguration().maxThroughput()); + Assertions.assertEquals(4955502586150653240L, model.throughputPoolConfiguration().dedicatedRUs()); + Assertions.assertEquals(4726547622840728423L, model.throughputPoolConfiguration().maxConsumableRUs()); } @org.junit.jupiter.api.Test @@ -32,19 +32,19 @@ public void testSerialize() throws Exception { FleetspaceResourceInner model = new FleetspaceResourceInner().withFleetspaceApiKind(FleetspacePropertiesFleetspaceApiKind.NO_SQL) .withServiceTier(FleetspacePropertiesServiceTier.GENERAL_PURPOSE) - .withDataRegions(Arrays.asList("oyfxxkwykuqdndx", "ykhkg")) + .withDataRegions(Arrays.asList("n", "tqrcjqp", "jvnpjrrh", "gsjbi")) .withThroughputPoolConfiguration( - new FleetspacePropertiesThroughputPoolConfiguration().withMinThroughput(109130639) - .withMaxThroughput(642442067) - .withDedicatedRUs(4517860496852863838L) - .withMaxConsumableRUs(6856150375213261489L)); + new FleetspacePropertiesThroughputPoolConfiguration().withMinThroughput(1874325220) + .withMaxThroughput(199329303) + .withDedicatedRUs(4955502586150653240L) + .withMaxConsumableRUs(4726547622840728423L)); model = BinaryData.fromObject(model).toObject(FleetspaceResourceInner.class); Assertions.assertEquals(FleetspacePropertiesFleetspaceApiKind.NO_SQL, model.fleetspaceApiKind()); Assertions.assertEquals(FleetspacePropertiesServiceTier.GENERAL_PURPOSE, model.serviceTier()); - Assertions.assertEquals("oyfxxkwykuqdndx", model.dataRegions().get(0)); - Assertions.assertEquals(109130639, model.throughputPoolConfiguration().minThroughput()); - Assertions.assertEquals(642442067, model.throughputPoolConfiguration().maxThroughput()); - Assertions.assertEquals(4517860496852863838L, model.throughputPoolConfiguration().dedicatedRUs()); - Assertions.assertEquals(6856150375213261489L, model.throughputPoolConfiguration().maxConsumableRUs()); + Assertions.assertEquals("n", model.dataRegions().get(0)); + Assertions.assertEquals(1874325220, model.throughputPoolConfiguration().minThroughput()); + Assertions.assertEquals(199329303, model.throughputPoolConfiguration().maxThroughput()); + Assertions.assertEquals(4955502586150653240L, model.throughputPoolConfiguration().dedicatedRUs()); + Assertions.assertEquals(4726547622840728423L, model.throughputPoolConfiguration().maxConsumableRUs()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceUpdateTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceUpdateTests.java index d72ca6f9e206..613029827804 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceUpdateTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FleetspaceUpdateTests.java @@ -16,15 +16,15 @@ public final class FleetspaceUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FleetspaceUpdate model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"fleetspaceApiKind\":\"NoSQL\",\"serviceTier\":\"BusinessCritical\",\"dataRegions\":[\"uehvvpx\"],\"throughputPoolConfiguration\":{\"minThroughput\":292089964,\"maxThroughput\":1507419320,\"dedicatedRUs\":1008566850319287802,\"maxConsumableRUs\":2375241321249913977}}}") + "{\"properties\":{\"provisioningState\":\"Online\",\"fleetspaceApiKind\":\"NoSQL\",\"serviceTier\":\"BusinessCritical\",\"dataRegions\":[\"kqoyimxpggk\",\"teagbgac\",\"qpjuytvude\"],\"throughputPoolConfiguration\":{\"minThroughput\":164165619,\"maxThroughput\":1327011085,\"dedicatedRUs\":1814794624079734065,\"maxConsumableRUs\":3858383093728778124}}}") .toObject(FleetspaceUpdate.class); Assertions.assertEquals(FleetspacePropertiesFleetspaceApiKind.NO_SQL, model.fleetspaceApiKind()); Assertions.assertEquals(FleetspacePropertiesServiceTier.BUSINESS_CRITICAL, model.serviceTier()); - Assertions.assertEquals("uehvvpx", model.dataRegions().get(0)); - Assertions.assertEquals(292089964, model.throughputPoolConfiguration().minThroughput()); - Assertions.assertEquals(1507419320, model.throughputPoolConfiguration().maxThroughput()); - Assertions.assertEquals(1008566850319287802L, model.throughputPoolConfiguration().dedicatedRUs()); - Assertions.assertEquals(2375241321249913977L, model.throughputPoolConfiguration().maxConsumableRUs()); + Assertions.assertEquals("kqoyimxpggk", model.dataRegions().get(0)); + Assertions.assertEquals(164165619, model.throughputPoolConfiguration().minThroughput()); + Assertions.assertEquals(1327011085, model.throughputPoolConfiguration().maxThroughput()); + Assertions.assertEquals(1814794624079734065L, model.throughputPoolConfiguration().dedicatedRUs()); + Assertions.assertEquals(3858383093728778124L, model.throughputPoolConfiguration().maxConsumableRUs()); } @org.junit.jupiter.api.Test @@ -32,19 +32,19 @@ public void testSerialize() throws Exception { FleetspaceUpdate model = new FleetspaceUpdate().withFleetspaceApiKind(FleetspacePropertiesFleetspaceApiKind.NO_SQL) .withServiceTier(FleetspacePropertiesServiceTier.BUSINESS_CRITICAL) - .withDataRegions(Arrays.asList("uehvvpx")) + .withDataRegions(Arrays.asList("kqoyimxpggk", "teagbgac", "qpjuytvude")) .withThroughputPoolConfiguration( - new FleetspacePropertiesThroughputPoolConfiguration().withMinThroughput(292089964) - .withMaxThroughput(1507419320) - .withDedicatedRUs(1008566850319287802L) - .withMaxConsumableRUs(2375241321249913977L)); + new FleetspacePropertiesThroughputPoolConfiguration().withMinThroughput(164165619) + .withMaxThroughput(1327011085) + .withDedicatedRUs(1814794624079734065L) + .withMaxConsumableRUs(3858383093728778124L)); model = BinaryData.fromObject(model).toObject(FleetspaceUpdate.class); Assertions.assertEquals(FleetspacePropertiesFleetspaceApiKind.NO_SQL, model.fleetspaceApiKind()); Assertions.assertEquals(FleetspacePropertiesServiceTier.BUSINESS_CRITICAL, model.serviceTier()); - Assertions.assertEquals("uehvvpx", model.dataRegions().get(0)); - Assertions.assertEquals(292089964, model.throughputPoolConfiguration().minThroughput()); - Assertions.assertEquals(1507419320, model.throughputPoolConfiguration().maxThroughput()); - Assertions.assertEquals(1008566850319287802L, model.throughputPoolConfiguration().dedicatedRUs()); - Assertions.assertEquals(2375241321249913977L, model.throughputPoolConfiguration().maxConsumableRUs()); + Assertions.assertEquals("kqoyimxpggk", model.dataRegions().get(0)); + Assertions.assertEquals(164165619, model.throughputPoolConfiguration().minThroughput()); + Assertions.assertEquals(1327011085, model.throughputPoolConfiguration().maxThroughput()); + Assertions.assertEquals(1814794624079734065L, model.throughputPoolConfiguration().dedicatedRUs()); + Assertions.assertEquals(3858383093728778124L, model.throughputPoolConfiguration().maxConsumableRUs()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FullTextIndexPathTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FullTextIndexPathTests.java index a37793b775d6..d74e9d303098 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FullTextIndexPathTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FullTextIndexPathTests.java @@ -11,14 +11,15 @@ public final class FullTextIndexPathTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - FullTextIndexPath model = BinaryData.fromString("{\"path\":\"px\"}").toObject(FullTextIndexPath.class); - Assertions.assertEquals("px", model.path()); + FullTextIndexPath model + = BinaryData.fromString("{\"path\":\"dqmeqwigpibudq\"}").toObject(FullTextIndexPath.class); + Assertions.assertEquals("dqmeqwigpibudq", model.path()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FullTextIndexPath model = new FullTextIndexPath().withPath("px"); + FullTextIndexPath model = new FullTextIndexPath().withPath("dqmeqwigpibudq"); model = BinaryData.fromObject(model).toObject(FullTextIndexPath.class); - Assertions.assertEquals("px", model.path()); + Assertions.assertEquals("dqmeqwigpibudq", model.path()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FullTextPathTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FullTextPathTests.java index 9e72ef7a496e..9a00fb397ab9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FullTextPathTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FullTextPathTests.java @@ -11,17 +11,17 @@ public final class FullTextPathTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - FullTextPath model = BinaryData.fromString("{\"path\":\"vldspa\",\"language\":\"jbkkdmflvestmjl\"}") - .toObject(FullTextPath.class); - Assertions.assertEquals("vldspa", model.path()); - Assertions.assertEquals("jbkkdmflvestmjl", model.language()); + FullTextPath model + = BinaryData.fromString("{\"path\":\"yb\",\"language\":\"wpgdak\"}").toObject(FullTextPath.class); + Assertions.assertEquals("yb", model.path()); + Assertions.assertEquals("wpgdak", model.language()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FullTextPath model = new FullTextPath().withPath("vldspa").withLanguage("jbkkdmflvestmjl"); + FullTextPath model = new FullTextPath().withPath("yb").withLanguage("wpgdak"); model = BinaryData.fromObject(model).toObject(FullTextPath.class); - Assertions.assertEquals("vldspa", model.path()); - Assertions.assertEquals("jbkkdmflvestmjl", model.language()); + Assertions.assertEquals("yb", model.path()); + Assertions.assertEquals("wpgdak", model.language()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FullTextPolicyTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FullTextPolicyTests.java index 49433b322136..963e970b6f1e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FullTextPolicyTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/FullTextPolicyTests.java @@ -14,21 +14,21 @@ public final class FullTextPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FullTextPolicy model = BinaryData.fromString( - "{\"defaultLanguage\":\"ibyfmo\",\"fullTextPaths\":[{\"path\":\"rkjpvdwxfzwii\",\"language\":\"zjb\"},{\"path\":\"yzsxjrkambtrne\",\"language\":\"mnvuqe\"}]}") + "{\"defaultLanguage\":\"aslzkwr\",\"fullTextPaths\":[{\"path\":\"ycqucwyh\",\"language\":\"nomdrkywuhpsv\"},{\"path\":\"uurutlwexxwlalni\",\"language\":\"zsrzpgepq\"}]}") .toObject(FullTextPolicy.class); - Assertions.assertEquals("ibyfmo", model.defaultLanguage()); - Assertions.assertEquals("rkjpvdwxfzwii", model.fullTextPaths().get(0).path()); - Assertions.assertEquals("zjb", model.fullTextPaths().get(0).language()); + Assertions.assertEquals("aslzkwr", model.defaultLanguage()); + Assertions.assertEquals("ycqucwyh", model.fullTextPaths().get(0).path()); + Assertions.assertEquals("nomdrkywuhpsv", model.fullTextPaths().get(0).language()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FullTextPolicy model = new FullTextPolicy().withDefaultLanguage("ibyfmo") - .withFullTextPaths(Arrays.asList(new FullTextPath().withPath("rkjpvdwxfzwii").withLanguage("zjb"), - new FullTextPath().withPath("yzsxjrkambtrne").withLanguage("mnvuqe"))); + FullTextPolicy model = new FullTextPolicy().withDefaultLanguage("aslzkwr") + .withFullTextPaths(Arrays.asList(new FullTextPath().withPath("ycqucwyh").withLanguage("nomdrkywuhpsv"), + new FullTextPath().withPath("uurutlwexxwlalni").withLanguage("zsrzpgepq"))); model = BinaryData.fromObject(model).toObject(FullTextPolicy.class); - Assertions.assertEquals("ibyfmo", model.defaultLanguage()); - Assertions.assertEquals("rkjpvdwxfzwii", model.fullTextPaths().get(0).path()); - Assertions.assertEquals("zjb", model.fullTextPaths().get(0).language()); + Assertions.assertEquals("aslzkwr", model.defaultLanguage()); + Assertions.assertEquals("ycqucwyh", model.fullTextPaths().get(0).path()); + Assertions.assertEquals("nomdrkywuhpsv", model.fullTextPaths().get(0).language()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GarnetClusterResourcePatchPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GarnetClusterResourcePatchPropertiesTests.java new file mode 100644 index 000000000000..ad263ad4304f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GarnetClusterResourcePatchPropertiesTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.ClusterType; +import com.azure.resourcemanager.cosmos.models.GarnetAuthenticationType; +import com.azure.resourcemanager.cosmos.models.GarnetClusterResourcePatchProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class GarnetClusterResourcePatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GarnetClusterResourcePatchProperties model = BinaryData.fromString( + "{\"clusterType\":\"Production\",\"extensions\":[\"obuizaz\",\"elwgvydjufbnkl\",\"laxp\"],\"authenticationMethod\":\"Entra\",\"persistence\":true}") + .toObject(GarnetClusterResourcePatchProperties.class); + Assertions.assertEquals(ClusterType.PRODUCTION, model.clusterType()); + Assertions.assertEquals("obuizaz", model.extensions().get(0)); + Assertions.assertEquals(GarnetAuthenticationType.ENTRA, model.authenticationMethod()); + Assertions.assertTrue(model.persistence()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GarnetClusterResourcePatchProperties model + = new GarnetClusterResourcePatchProperties().withClusterType(ClusterType.PRODUCTION) + .withExtensions(Arrays.asList("obuizaz", "elwgvydjufbnkl", "laxp")) + .withAuthenticationMethod(GarnetAuthenticationType.ENTRA) + .withPersistence(true); + model = BinaryData.fromObject(model).toObject(GarnetClusterResourcePatchProperties.class); + Assertions.assertEquals(ClusterType.PRODUCTION, model.clusterType()); + Assertions.assertEquals("obuizaz", model.extensions().get(0)); + Assertions.assertEquals(GarnetAuthenticationType.ENTRA, model.authenticationMethod()); + Assertions.assertTrue(model.persistence()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GarnetClusterResourcePatchTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GarnetClusterResourcePatchTests.java new file mode 100644 index 000000000000..0b6a203507c8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GarnetClusterResourcePatchTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.ClusterType; +import com.azure.resourcemanager.cosmos.models.GarnetAuthenticationType; +import com.azure.resourcemanager.cosmos.models.GarnetClusterResourcePatch; +import com.azure.resourcemanager.cosmos.models.GarnetClusterResourcePatchProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class GarnetClusterResourcePatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GarnetClusterResourcePatch model = BinaryData.fromString( + "{\"properties\":{\"clusterType\":\"Production\",\"extensions\":[\"cdosqkptj\",\"gkifmmainwh\",\"d\"],\"authenticationMethod\":\"Entra\",\"persistence\":false}}") + .toObject(GarnetClusterResourcePatch.class); + Assertions.assertEquals(ClusterType.PRODUCTION, model.properties().clusterType()); + Assertions.assertEquals("cdosqkptj", model.properties().extensions().get(0)); + Assertions.assertEquals(GarnetAuthenticationType.ENTRA, model.properties().authenticationMethod()); + Assertions.assertFalse(model.properties().persistence()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GarnetClusterResourcePatch model = new GarnetClusterResourcePatch() + .withProperties(new GarnetClusterResourcePatchProperties().withClusterType(ClusterType.PRODUCTION) + .withExtensions(Arrays.asList("cdosqkptj", "gkifmmainwh", "d")) + .withAuthenticationMethod(GarnetAuthenticationType.ENTRA) + .withPersistence(false)); + model = BinaryData.fromObject(model).toObject(GarnetClusterResourcePatch.class); + Assertions.assertEquals(ClusterType.PRODUCTION, model.properties().clusterType()); + Assertions.assertEquals("cdosqkptj", model.properties().extensions().get(0)); + Assertions.assertEquals(GarnetAuthenticationType.ENTRA, model.properties().authenticationMethod()); + Assertions.assertFalse(model.properties().persistence()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GarnetClusterResourcePropertiesEndPointsItemTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GarnetClusterResourcePropertiesEndPointsItemTests.java new file mode 100644 index 000000000000..2337f0a54885 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GarnetClusterResourcePropertiesEndPointsItemTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.GarnetClusterResourcePropertiesEndPointsItem; +import org.junit.jupiter.api.Assertions; + +public final class GarnetClusterResourcePropertiesEndPointsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GarnetClusterResourcePropertiesEndPointsItem model + = BinaryData.fromString("{\"ipAddress\":\"vecb\",\"port\":1461984569}") + .toObject(GarnetClusterResourcePropertiesEndPointsItem.class); + Assertions.assertEquals("vecb", model.ipAddress()); + Assertions.assertEquals(1461984569, model.port()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphApiComputeRegionalServiceResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphApiComputeRegionalServiceResourceTests.java index 568facbb1524..11ef11a0fd92 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphApiComputeRegionalServiceResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphApiComputeRegionalServiceResourceTests.java @@ -10,9 +10,8 @@ public final class GraphApiComputeRegionalServiceResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - GraphApiComputeRegionalServiceResource model = BinaryData - .fromString( - "{\"graphApiComputeEndpoint\":\"yznm\",\"name\":\"cdo\",\"location\":\"v\",\"status\":\"Updating\"}") + GraphApiComputeRegionalServiceResource model = BinaryData.fromString( + "{\"graphApiComputeEndpoint\":\"pgg\",\"name\":\"meyobqajejirvavr\",\"location\":\"gpogpl\",\"status\":\"Running\"}") .toObject(GraphApiComputeRegionalServiceResource.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphApiComputeServiceResourceCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphApiComputeServiceResourceCreateUpdateParametersTests.java index 41b06f72386c..e7e107b876be 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphApiComputeServiceResourceCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphApiComputeServiceResourceCreateUpdateParametersTests.java @@ -14,19 +14,19 @@ public final class GraphApiComputeServiceResourceCreateUpdateParametersTests { public void testDeserialize() throws Exception { GraphApiComputeServiceResourceCreateUpdateParameters model = BinaryData .fromString( - "{\"serviceType\":\"GraphAPICompute\",\"instanceSize\":\"Cosmos.D16s\",\"instanceCount\":1370089624}") + "{\"serviceType\":\"GraphAPICompute\",\"instanceSize\":\"Cosmos.D16s\",\"instanceCount\":1185975038}") .toObject(GraphApiComputeServiceResourceCreateUpdateParameters.class); Assertions.assertEquals(ServiceSize.COSMOS_D16S, model.instanceSize()); - Assertions.assertEquals(1370089624, model.instanceCount()); + Assertions.assertEquals(1185975038, model.instanceCount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { GraphApiComputeServiceResourceCreateUpdateParameters model = new GraphApiComputeServiceResourceCreateUpdateParameters().withInstanceSize(ServiceSize.COSMOS_D16S) - .withInstanceCount(1370089624); + .withInstanceCount(1185975038); model = BinaryData.fromObject(model).toObject(GraphApiComputeServiceResourceCreateUpdateParameters.class); Assertions.assertEquals(ServiceSize.COSMOS_D16S, model.instanceSize()); - Assertions.assertEquals(1370089624, model.instanceCount()); + Assertions.assertEquals(1185975038, model.instanceCount()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphApiComputeServiceResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphApiComputeServiceResourcePropertiesTests.java index afbd6fb8a0a8..ef98e82f6552 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphApiComputeServiceResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphApiComputeServiceResourcePropertiesTests.java @@ -13,10 +13,10 @@ public final class GraphApiComputeServiceResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GraphApiComputeServiceResourceProperties model = BinaryData.fromString( - "{\"serviceType\":\"GraphAPICompute\",\"graphApiComputeEndpoint\":\"kbjuckcatuqbhp\",\"locations\":[{\"graphApiComputeEndpoint\":\"xtpzdlyse\",\"name\":\"toakatprytgrhz\",\"location\":\"fdpfawrptvcsht\",\"status\":\"Creating\"},{\"graphApiComputeEndpoint\":\"ct\",\"name\":\"qgdirda\",\"location\":\"tzjgcfjfxtbwj\",\"status\":\"Updating\"},{\"graphApiComputeEndpoint\":\"uydgfttmdofgeoa\",\"name\":\"uoft\",\"location\":\"odwxmdajwiygmgs\",\"status\":\"Stopped\"}],\"creationTime\":\"2021-03-19T08:47:31Z\",\"instanceSize\":\"Cosmos.D16s\",\"instanceCount\":518703643,\"status\":\"Deleting\",\"tjva\":\"\\\"datafczljdnci\\\"\"}") + "{\"serviceType\":\"GraphAPICompute\",\"graphApiComputeEndpoint\":\"zhcwjgwa\",\"locations\":[{\"graphApiComputeEndpoint\":\"ofgrutvnp\",\"name\":\"xzivxp\",\"location\":\"zghhh\",\"status\":\"Running\"},{\"graphApiComputeEndpoint\":\"jd\",\"name\":\"jq\",\"location\":\"hnjvpmxnhtmzstql\",\"status\":\"Running\"},{\"graphApiComputeEndpoint\":\"rwvtlgxyfjswequf\",\"name\":\"yyopoaytwwgw\",\"location\":\"b\",\"status\":\"Stopped\"},{\"graphApiComputeEndpoint\":\"ufrkwjiemimdt\",\"name\":\"owewjskr\",\"location\":\"edddr\",\"status\":\"Deleting\"}],\"creationTime\":\"2021-03-02T06:29:02Z\",\"instanceSize\":\"Cosmos.D16s\",\"instanceCount\":665322326,\"status\":\"Running\",\"qyxfed\":\"\\\"dataigeeuwbr\\\"\",\"nxoqgv\":\"\\\"datanetdqw\\\"\"}") .toObject(GraphApiComputeServiceResourceProperties.class); Assertions.assertEquals(ServiceSize.COSMOS_D16S, model.instanceSize()); - Assertions.assertEquals(518703643, model.instanceCount()); - Assertions.assertEquals("kbjuckcatuqbhp", model.graphApiComputeEndpoint()); + Assertions.assertEquals(665322326, model.instanceCount()); + Assertions.assertEquals("zhcwjgwa", model.graphApiComputeEndpoint()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceCreateUpdateParametersTests.java new file mode 100644 index 000000000000..04f3b29e3599 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceCreateUpdateParametersTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.AutoscaleSettings; +import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; +import com.azure.resourcemanager.cosmos.models.GraphResource; +import com.azure.resourcemanager.cosmos.models.GraphResourceCreateUpdateParameters; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentityUserAssignedIdentities; +import com.azure.resourcemanager.cosmos.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class GraphResourceCreateUpdateParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GraphResourceCreateUpdateParameters model = BinaryData.fromString( + "{\"properties\":{\"resource\":{\"id\":\"foqouicybx\"},\"options\":{\"throughput\":1450745635,\"autoscaleSettings\":{\"maxThroughput\":1273142830}}},\"id\":\"oxciqopidoamcio\",\"name\":\"khazxkhnzbonlwn\",\"type\":\"egokdwbwhkszzcmr\",\"location\":\"xztvbtqgsfraoyzk\",\"tags\":{\"aw\":\"tlmngu\"},\"identity\":{\"principalId\":\"dsyuuximerqfob\",\"tenantId\":\"znkbykutwpfhpagm\",\"type\":\"None\",\"userAssignedIdentities\":{\"l\":{\"principalId\":\"nfd\",\"clientId\":\"oakgtdlmkkzev\"},\"m\":{\"principalId\":\"wpusdsttwvogv\",\"clientId\":\"ejdcngqqmoakuf\"},\"bminrfdwoyuhhzi\":{\"principalId\":\"rwr\",\"clientId\":\"rtwaenuuzko\"},\"hxicslfaoqz\":{\"principalId\":\"efozbhdms\",\"clientId\":\"mzqhoftrmaequi\"}}}}") + .toObject(GraphResourceCreateUpdateParameters.class); + Assertions.assertEquals("xztvbtqgsfraoyzk", model.location()); + Assertions.assertEquals("tlmngu", model.tags().get("aw")); + Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals("foqouicybx", model.resource().id()); + Assertions.assertEquals(1450745635, model.options().throughput()); + Assertions.assertEquals(1273142830, model.options().autoscaleSettings().maxThroughput()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GraphResourceCreateUpdateParameters model + = new GraphResourceCreateUpdateParameters().withLocation("xztvbtqgsfraoyzk") + .withTags(mapOf("aw", "tlmngu")) + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("l", new ManagedServiceIdentityUserAssignedIdentities(), "m", + new ManagedServiceIdentityUserAssignedIdentities(), "bminrfdwoyuhhzi", + new ManagedServiceIdentityUserAssignedIdentities(), "hxicslfaoqz", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource(new GraphResource().withId("foqouicybx")) + .withOptions(new CreateUpdateOptions().withThroughput(1450745635) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1273142830))); + model = BinaryData.fromObject(model).toObject(GraphResourceCreateUpdateParameters.class); + Assertions.assertEquals("xztvbtqgsfraoyzk", model.location()); + Assertions.assertEquals("tlmngu", model.tags().get("aw")); + Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals("foqouicybx", model.resource().id()); + Assertions.assertEquals(1450745635, model.options().throughput()); + Assertions.assertEquals(1273142830, model.options().autoscaleSettings().maxThroughput()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceCreateUpdatePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceCreateUpdatePropertiesTests.java new file mode 100644 index 000000000000..dee75cf3c874 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceCreateUpdatePropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.GraphResourceCreateUpdateProperties; +import com.azure.resourcemanager.cosmos.models.AutoscaleSettings; +import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; +import com.azure.resourcemanager.cosmos.models.GraphResource; +import org.junit.jupiter.api.Assertions; + +public final class GraphResourceCreateUpdatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GraphResourceCreateUpdateProperties model = BinaryData.fromString( + "{\"resource\":{\"id\":\"iyylhalnswhccsp\"},\"options\":{\"throughput\":1331736876,\"autoscaleSettings\":{\"maxThroughput\":2011273129}}}") + .toObject(GraphResourceCreateUpdateProperties.class); + Assertions.assertEquals("iyylhalnswhccsp", model.resource().id()); + Assertions.assertEquals(1331736876, model.options().throughput()); + Assertions.assertEquals(2011273129, model.options().autoscaleSettings().maxThroughput()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GraphResourceCreateUpdateProperties model + = new GraphResourceCreateUpdateProperties().withResource(new GraphResource().withId("iyylhalnswhccsp")) + .withOptions(new CreateUpdateOptions().withThroughput(1331736876) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(2011273129))); + model = BinaryData.fromObject(model).toObject(GraphResourceCreateUpdateProperties.class); + Assertions.assertEquals("iyylhalnswhccsp", model.resource().id()); + Assertions.assertEquals(1331736876, model.options().throughput()); + Assertions.assertEquals(2011273129, model.options().autoscaleSettings().maxThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetPropertiesOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetPropertiesOptionsTests.java new file mode 100644 index 000000000000..3999612ff24b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetPropertiesOptionsTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.GraphResourceGetPropertiesOptions; +import org.junit.jupiter.api.Assertions; + +public final class GraphResourceGetPropertiesOptionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GraphResourceGetPropertiesOptions model + = BinaryData.fromString("{\"throughput\":456630661,\"autoscaleSettings\":{\"maxThroughput\":1170623374}}") + .toObject(GraphResourceGetPropertiesOptions.class); + Assertions.assertEquals(456630661, model.throughput()); + Assertions.assertEquals(1170623374, model.autoscaleSettings().maxThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetPropertiesResourceTests.java new file mode 100644 index 000000000000..478686bd346b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetPropertiesResourceTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.GraphResourceGetPropertiesResource; +import org.junit.jupiter.api.Assertions; + +public final class GraphResourceGetPropertiesResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GraphResourceGetPropertiesResource model + = BinaryData.fromString("{\"id\":\"kfbtndoaongbjc\"}").toObject(GraphResourceGetPropertiesResource.class); + Assertions.assertEquals("kfbtndoaongbjc", model.id()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetPropertiesTests.java new file mode 100644 index 000000000000..64702902a680 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetPropertiesTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.GraphResourceGetProperties; +import org.junit.jupiter.api.Assertions; + +public final class GraphResourceGetPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GraphResourceGetProperties model = BinaryData.fromString( + "{\"resource\":{\"id\":\"ifrvtpu\"},\"options\":{\"throughput\":1082382983,\"autoscaleSettings\":{\"maxThroughput\":829159187}}}") + .toObject(GraphResourceGetProperties.class); + Assertions.assertEquals("ifrvtpu", model.resource().id()); + Assertions.assertEquals(1082382983, model.options().throughput()); + Assertions.assertEquals(829159187, model.options().autoscaleSettings().maxThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetResultsInnerTests.java new file mode 100644 index 000000000000..3ae9015d30ae --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceGetResultsInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.GraphResourceGetResultsInner; +import com.azure.resourcemanager.cosmos.models.ResourceIdentityType; +import org.junit.jupiter.api.Assertions; + +public final class GraphResourceGetResultsInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GraphResourceGetResultsInner model = BinaryData.fromString( + "{\"properties\":{\"resource\":{\"id\":\"tiagx\"},\"options\":{\"throughput\":300652105,\"autoscaleSettings\":{\"maxThroughput\":993241324}}},\"location\":\"sbzkf\",\"tags\":{\"dxrbuukzcle\":\"yvpnqicvinvkjj\",\"fn\":\"yhmlwpaztzp\",\"fz\":\"ckw\",\"feqztppriol\":\"whxxbuyqax\"},\"identity\":{\"principalId\":\"jaltolmnc\",\"tenantId\":\"obqwcsdbnwdcfh\",\"type\":\"None\",\"userAssignedIdentities\":{\"udutnco\":{\"principalId\":\"uvglsbjjcanvx\",\"clientId\":\"t\"},\"bgdknnqv\":{\"principalId\":\"r\",\"clientId\":\"qtvcofudflvkgj\"},\"uetae\":{\"principalId\":\"znqntoru\",\"clientId\":\"gsahmkycgrauw\"}}},\"id\":\"ruvdmov\",\"name\":\"mz\",\"type\":\"xwabmqoe\"}") + .toObject(GraphResourceGetResultsInner.class); + Assertions.assertEquals("sbzkf", model.location()); + Assertions.assertEquals("yvpnqicvinvkjj", model.tags().get("dxrbuukzcle")); + Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals("tiagx", model.resource().id()); + Assertions.assertEquals(300652105, model.options().throughput()); + Assertions.assertEquals(993241324, model.options().autoscaleSettings().maxThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceTests.java new file mode 100644 index 000000000000..e6144d3d6d56 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourceTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.GraphResource; +import org.junit.jupiter.api.Assertions; + +public final class GraphResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GraphResource model = BinaryData.fromString("{\"id\":\"tujitcjedft\"}").toObject(GraphResource.class); + Assertions.assertEquals("tujitcjedft", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GraphResource model = new GraphResource().withId("tujitcjedft"); + model = BinaryData.fromObject(model).toObject(GraphResource.class); + Assertions.assertEquals("tujitcjedft", model.id()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesListResultTests.java new file mode 100644 index 000000000000..6093aaf8f8fd --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GraphResourcesListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.implementation.models.GraphResourcesListResult; +import org.junit.jupiter.api.Assertions; + +public final class GraphResourcesListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GraphResourcesListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"resource\":{\"id\":\"woluhczbwemhair\"},\"options\":{\"throughput\":558001686,\"autoscaleSettings\":{\"maxThroughput\":444921706}}},\"location\":\"swe\",\"tags\":{\"xggicccnxqhuexmk\":\"w\",\"zrncsdt\":\"tlstvlzywem\",\"bsfgytguslfea\":\"lusiy\"},\"identity\":{\"principalId\":\"gq\",\"tenantId\":\"yhejhzisxgfp\",\"type\":\"None\",\"userAssignedIdentities\":{\"swibyr\":{\"principalId\":\"vk\",\"clientId\":\"pqvujzraehtwdwrf\"}}},\"id\":\"l\",\"name\":\"h\",\"type\":\"hfwpracstwit\"},{\"properties\":{\"resource\":{\"id\":\"evxccedcp\"},\"options\":{\"throughput\":317299302,\"autoscaleSettings\":{\"maxThroughput\":167865446}}},\"location\":\"zxltjcvn\",\"tags\":{\"byqunyow\":\"iugcxnavvwxq\",\"g\":\"wlmdjrkv\",\"j\":\"vfvpdbodaciz\"},\"identity\":{\"principalId\":\"krribdeibqi\",\"tenantId\":\"kghv\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"b\":{\"principalId\":\"krefajpjo\",\"clientId\":\"kqnyh\"}}},\"id\":\"tjivfxzsjabib\",\"name\":\"ystawfsdjpvkvp\",\"type\":\"jxbkzbzkdvn\"}],\"nextLink\":\"abudurgk\"}") + .toObject(GraphResourcesListResult.class); + Assertions.assertEquals("abudurgk", model.nextLink()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseCreateUpdateParametersTests.java index 8a94244d6898..0bf03c682022 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseCreateUpdateParametersTests.java @@ -23,47 +23,46 @@ public final class GremlinDatabaseCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinDatabaseCreateUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"id\":\"drwjiy\",\"restoreParameters\":{\"restoreSource\":\"fj\",\"restoreTimestampInUtc\":\"2021-12-04T16:49:47Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":1800883070,\"autoscaleSettings\":{\"maxThroughput\":629966604}}},\"id\":\"r\",\"name\":\"qnt\",\"type\":\"nawthvm\",\"location\":\"gnuyeamcmhu\",\"tags\":{\"pqtwloesqrggvrb\":\"ecehokw\",\"aciduwjleip\":\"yrukoi\",\"yxpzruzythqk\":\"lh\"},\"identity\":{\"principalId\":\"bg\",\"tenantId\":\"ellv\",\"type\":\"None\",\"userAssignedIdentities\":{\"uvrzmzqmzjqrb\":{\"principalId\":\"nitmujdtvmclyymf\",\"clientId\":\"mjpddnyxf\"}}}}") + "{\"properties\":{\"resource\":{\"id\":\"rcigtzjcvbxq\",\"restoreParameters\":{\"restoreSource\":\"snsso\",\"restoreTimestampInUtc\":\"2021-08-20T00:22:26Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":882366238,\"autoscaleSettings\":{\"maxThroughput\":1914716275}}},\"id\":\"fcvvy\",\"name\":\"slpuxgcbdsva\",\"type\":\"nptw\",\"location\":\"kx\",\"tags\":{\"ldiuhzzgqlm\":\"zwugxyqvnjobfel\"},\"identity\":{\"principalId\":\"wz\",\"tenantId\":\"udjpxpqht\",\"type\":\"None\",\"userAssignedIdentities\":{\"ikpazf\":{\"principalId\":\"krezsdsuxheqd\",\"clientId\":\"ruxspinymmqgwok\"}}}}") .toObject(GremlinDatabaseCreateUpdateParameters.class); - Assertions.assertEquals("gnuyeamcmhu", model.location()); - Assertions.assertEquals("ecehokw", model.tags().get("pqtwloesqrggvrb")); + Assertions.assertEquals("kx", model.location()); + Assertions.assertEquals("zwugxyqvnjobfel", model.tags().get("ldiuhzzgqlm")); Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("drwjiy", model.resource().id()); - Assertions.assertEquals("fj", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-04T16:49:47Z"), + Assertions.assertEquals("rcigtzjcvbxq", model.resource().id()); + Assertions.assertEquals("snsso", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-20T00:22:26Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(1800883070, model.options().throughput()); - Assertions.assertEquals(629966604, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(882366238, model.options().throughput()); + Assertions.assertEquals(1914716275, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - GremlinDatabaseCreateUpdateParameters model = new GremlinDatabaseCreateUpdateParameters() - .withLocation("gnuyeamcmhu") - .withTags(mapOf("pqtwloesqrggvrb", "ecehokw", "aciduwjleip", "yrukoi", "yxpzruzythqk", "lh")) + GremlinDatabaseCreateUpdateParameters model = new GremlinDatabaseCreateUpdateParameters().withLocation("kx") + .withTags(mapOf("ldiuhzzgqlm", "zwugxyqvnjobfel")) .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("uvrzmzqmzjqrb", new ManagedServiceIdentityUserAssignedIdentities()))) - .withResource(new GremlinDatabaseResource().withId("drwjiy") - .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("fj") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-12-04T16:49:47Z")) + .withUserAssignedIdentities(mapOf("ikpazf", new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource(new GremlinDatabaseResource().withId("rcigtzjcvbxq") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("snsso") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-08-20T00:22:26Z")) .withRestoreWithTtlDisabled(true)) .withCreateMode(CreateMode.RESTORE)) - .withOptions(new CreateUpdateOptions().withThroughput(1800883070) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(629966604))); + .withOptions(new CreateUpdateOptions().withThroughput(882366238) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1914716275))); model = BinaryData.fromObject(model).toObject(GremlinDatabaseCreateUpdateParameters.class); - Assertions.assertEquals("gnuyeamcmhu", model.location()); - Assertions.assertEquals("ecehokw", model.tags().get("pqtwloesqrggvrb")); + Assertions.assertEquals("kx", model.location()); + Assertions.assertEquals("zwugxyqvnjobfel", model.tags().get("ldiuhzzgqlm")); Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("drwjiy", model.resource().id()); - Assertions.assertEquals("fj", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-04T16:49:47Z"), + Assertions.assertEquals("rcigtzjcvbxq", model.resource().id()); + Assertions.assertEquals("snsso", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-20T00:22:26Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(1800883070, model.options().throughput()); - Assertions.assertEquals(629966604, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(882366238, model.options().throughput()); + Assertions.assertEquals(1914716275, model.options().autoscaleSettings().maxThroughput()); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseCreateUpdatePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseCreateUpdatePropertiesTests.java index d0b75074ca03..f26a6f0e3fb0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseCreateUpdatePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseCreateUpdatePropertiesTests.java @@ -18,36 +18,36 @@ public final class GremlinDatabaseCreateUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinDatabaseCreateUpdateProperties model = BinaryData.fromString( - "{\"resource\":{\"id\":\"pv\",\"restoreParameters\":{\"restoreSource\":\"yfoeb\",\"restoreTimestampInUtc\":\"2021-06-23T21:38:35Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":2029904789,\"autoscaleSettings\":{\"maxThroughput\":486422900}}}") + "{\"resource\":{\"id\":\"mjxuvjipfdvhaxd\",\"restoreParameters\":{\"restoreSource\":\"ae\",\"restoreTimestampInUtc\":\"2021-05-04T18:05:41Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"},\"options\":{\"throughput\":641187974,\"autoscaleSettings\":{\"maxThroughput\":498485505}}}") .toObject(GremlinDatabaseCreateUpdateProperties.class); - Assertions.assertEquals("pv", model.resource().id()); - Assertions.assertEquals("yfoeb", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-23T21:38:35Z"), + Assertions.assertEquals("mjxuvjipfdvhaxd", model.resource().id()); + Assertions.assertEquals("ae", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T18:05:41Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); - Assertions.assertEquals(2029904789, model.options().throughput()); - Assertions.assertEquals(486422900, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); + Assertions.assertEquals(641187974, model.options().throughput()); + Assertions.assertEquals(498485505, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { GremlinDatabaseCreateUpdateProperties model = new GremlinDatabaseCreateUpdateProperties() - .withResource(new GremlinDatabaseResource().withId("pv") - .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("yfoeb") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-06-23T21:38:35Z")) + .withResource(new GremlinDatabaseResource().withId("mjxuvjipfdvhaxd") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("ae") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-05-04T18:05:41Z")) .withRestoreWithTtlDisabled(false)) - .withCreateMode(CreateMode.DEFAULT)) - .withOptions(new CreateUpdateOptions().withThroughput(2029904789) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(486422900))); + .withCreateMode(CreateMode.RESTORE)) + .withOptions(new CreateUpdateOptions().withThroughput(641187974) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(498485505))); model = BinaryData.fromObject(model).toObject(GremlinDatabaseCreateUpdateProperties.class); - Assertions.assertEquals("pv", model.resource().id()); - Assertions.assertEquals("yfoeb", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-23T21:38:35Z"), + Assertions.assertEquals("mjxuvjipfdvhaxd", model.resource().id()); + Assertions.assertEquals("ae", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T18:05:41Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); - Assertions.assertEquals(2029904789, model.options().throughput()); - Assertions.assertEquals(486422900, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); + Assertions.assertEquals(641187974, model.options().throughput()); + Assertions.assertEquals(498485505, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetPropertiesOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetPropertiesOptionsTests.java index 0cba28fc379f..ab4cd48c1fa9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetPropertiesOptionsTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetPropertiesOptionsTests.java @@ -12,9 +12,9 @@ public final class GremlinDatabaseGetPropertiesOptionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinDatabaseGetPropertiesOptions model - = BinaryData.fromString("{\"throughput\":153061632,\"autoscaleSettings\":{\"maxThroughput\":185461650}}") + = BinaryData.fromString("{\"throughput\":297293023,\"autoscaleSettings\":{\"maxThroughput\":356088444}}") .toObject(GremlinDatabaseGetPropertiesOptions.class); - Assertions.assertEquals(153061632, model.throughput()); - Assertions.assertEquals(185461650, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(297293023, model.throughput()); + Assertions.assertEquals(356088444, model.autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetPropertiesResourceTests.java index 74fa66ddf0de..26eca2366051 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetPropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetPropertiesResourceTests.java @@ -14,13 +14,13 @@ public final class GremlinDatabaseGetPropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinDatabaseGetPropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"rt\",\"_ts\":30.747408,\"_etag\":\"meboywhczzq\",\"id\":\"hmngqb\",\"restoreParameters\":{\"restoreSource\":\"gis\",\"restoreTimestampInUtc\":\"2021-07-11T10:10:53Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"}") + "{\"_rid\":\"lwzrg\",\"_ts\":26.501434,\"_etag\":\"einkfsc\",\"id\":\"fncjwvua\",\"restoreParameters\":{\"restoreSource\":\"wtltngvmreuptrk\",\"restoreTimestampInUtc\":\"2021-10-19T03:33:45Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"}") .toObject(GremlinDatabaseGetPropertiesResource.class); - Assertions.assertEquals("hmngqb", model.id()); - Assertions.assertEquals("gis", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-11T10:10:53Z"), + Assertions.assertEquals("fncjwvua", model.id()); + Assertions.assertEquals("wtltngvmreuptrk", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-19T03:33:45Z"), model.restoreParameters().restoreTimestampInUtc()); - Assertions.assertFalse(model.restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); + Assertions.assertTrue(model.restoreParameters().restoreWithTtlDisabled()); + Assertions.assertEquals(CreateMode.RESTORE, model.createMode()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetPropertiesTests.java index 7fb365dffb67..2bd64e4a8751 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetPropertiesTests.java @@ -14,15 +14,15 @@ public final class GremlinDatabaseGetPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinDatabaseGetProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"e\",\"_ts\":69.32202,\"_etag\":\"wllbv\",\"id\":\"wzsfftedousnktjt\",\"restoreParameters\":{\"restoreSource\":\"vaqogfkbebauzl\",\"restoreTimestampInUtc\":\"2021-08-02T08:39:17Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":1361888855,\"autoscaleSettings\":{\"maxThroughput\":335089535}}}") + "{\"resource\":{\"_rid\":\"ul\",\"_ts\":33.446144,\"_etag\":\"qtmojhvrztnvgy\",\"id\":\"hqrdgrtwmewjzlpy\",\"restoreParameters\":{\"restoreSource\":\"azzwjcay\",\"restoreTimestampInUtc\":\"2021-09-19T19:02:57Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":170381300,\"autoscaleSettings\":{\"maxThroughput\":1074401951}}}") .toObject(GremlinDatabaseGetProperties.class); - Assertions.assertEquals("wzsfftedousnktjt", model.resource().id()); - Assertions.assertEquals("vaqogfkbebauzl", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-02T08:39:17Z"), + Assertions.assertEquals("hqrdgrtwmewjzlpy", model.resource().id()); + Assertions.assertEquals("azzwjcay", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-19T19:02:57Z"), model.resource().restoreParameters().restoreTimestampInUtc()); - Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(1361888855, model.options().throughput()); - Assertions.assertEquals(335089535, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); + Assertions.assertEquals(170381300, model.options().throughput()); + Assertions.assertEquals(1074401951, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetResultsInnerTests.java index 861bd0d98290..8e3fc2419517 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetResultsInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseGetResultsInnerTests.java @@ -15,18 +15,18 @@ public final class GremlinDatabaseGetResultsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinDatabaseGetResultsInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"cprgukxrztiochl\",\"_ts\":78.70605,\"_etag\":\"mqrud\",\"id\":\"izcbfzmcrunfhiuc\",\"restoreParameters\":{\"restoreSource\":\"bcpaqktkrumzued\",\"restoreTimestampInUtc\":\"2021-05-21T20:17:50Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":1116543550,\"autoscaleSettings\":{\"maxThroughput\":113581490}}},\"location\":\"xqggvqr\",\"tags\":{\"jhffbxrqrkij\":\"hlwcjsqg\",\"wmwwmjswen\":\"euqlsdxeqztv\",\"ecleqioulndhzyo\":\"wwa\"},\"identity\":{\"principalId\":\"ht\",\"tenantId\":\"lhsvidmytzlnglxp\",\"type\":\"None\",\"userAssignedIdentities\":{\"ywv\":{\"principalId\":\"n\",\"clientId\":\"cswqa\"},\"hpmwhqnucsk\":{\"principalId\":\"igvjrktp\",\"clientId\":\"eukyaw\"},\"uoeedwjcci\":{\"principalId\":\"sidsjtd\",\"clientId\":\"bninjgazlsvbzfc\"},\"riyehqbeivdlhy\":{\"principalId\":\"hsy\",\"clientId\":\"rdrenxo\"}}},\"id\":\"bdbfgrlp\",\"name\":\"nytjlk\",\"type\":\"smmpathubt\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"vdshxcdedsuen\",\"_ts\":68.75867,\"_etag\":\"cgjtfrnquktrfn\",\"id\":\"lnlrxsmy\",\"restoreParameters\":{\"restoreSource\":\"wntfmtbgwjdxwna\",\"restoreTimestampInUtc\":\"2021-02-21T00:14:22Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":861132036,\"autoscaleSettings\":{\"maxThroughput\":1696179049}}},\"location\":\"etw\",\"tags\":{\"qseuzuukykcyqhy\":\"z\",\"fop\":\"qzzdcykeyste\",\"azgbsqgpe\":\"z\",\"fut\":\"q\"},\"identity\":{\"principalId\":\"vozglqjbk\",\"tenantId\":\"zcl\",\"type\":\"None\",\"userAssignedIdentities\":{\"kvfruwkudr\":{\"principalId\":\"wmn\",\"clientId\":\"ovdwzqauxzanh\"},\"mjauwcgx\":{\"principalId\":\"pftxudqyeme\",\"clientId\":\"naucmcirtnee\"},\"asmxubvfbngf\":{\"principalId\":\"noh\",\"clientId\":\"tranizerwgu\"}}},\"id\":\"cefhpriylfmpzt\",\"name\":\"aud\",\"type\":\"vhl\"}") .toObject(GremlinDatabaseGetResultsInner.class); - Assertions.assertEquals("xqggvqr", model.location()); - Assertions.assertEquals("hlwcjsqg", model.tags().get("jhffbxrqrkij")); + Assertions.assertEquals("etw", model.location()); + Assertions.assertEquals("z", model.tags().get("qseuzuukykcyqhy")); Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("izcbfzmcrunfhiuc", model.resource().id()); - Assertions.assertEquals("bcpaqktkrumzued", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-21T20:17:50Z"), + Assertions.assertEquals("lnlrxsmy", model.resource().id()); + Assertions.assertEquals("wntfmtbgwjdxwna", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-21T00:14:22Z"), model.resource().restoreParameters().restoreTimestampInUtc()); - Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); - Assertions.assertEquals(1116543550, model.options().throughput()); - Assertions.assertEquals(113581490, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(861132036, model.options().throughput()); + Assertions.assertEquals(1696179049, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseListResultTests.java index 443fc464294f..6f078ff6cac9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseListResultTests.java @@ -12,8 +12,8 @@ public final class GremlinDatabaseListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinDatabaseListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"qjilaywkdcwmqsyr\",\"_ts\":61.337734,\"_etag\":\"xdqaolfylnkkb\",\"id\":\"pjvlywltmfwo\",\"restoreParameters\":{\"restoreSource\":\"whlwy\",\"restoreTimestampInUtc\":\"2021-10-02T22:35:37Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":1537756175,\"autoscaleSettings\":{\"maxThroughput\":1272834373}}},\"location\":\"untgxdn\",\"tags\":{\"oifuvnyttzgixgy\":\"ttie\"},\"identity\":{\"principalId\":\"lgmgbe\",\"tenantId\":\"qtxnrflkndrndpg\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"umljcirvpef\":{\"principalId\":\"aqotwfhipxwgsabv\",\"clientId\":\"powzafcz\"},\"ajlnsjhwjuyxx\":{\"principalId\":\"dvei\",\"clientId\":\"tjnsx\"},\"tghyksarcdr\":{\"principalId\":\"qvmvuaytuadxkxe\",\"clientId\":\"wp\"},\"dqqjwkrhwzdano\":{\"principalId\":\"sluvlzladltxkpb\",\"clientId\":\"v\"}}},\"id\":\"sgglmv\",\"name\":\"katuztjctib\",\"type\":\"vbkaehxs\"},{\"properties\":{\"resource\":{\"_rid\":\"dfwakwseivmak\",\"_ts\":28.402704,\"_etag\":\"owljuxlkbectvtfj\",\"id\":\"skdchmaiubavl\",\"restoreParameters\":{\"restoreSource\":\"vgmfalkzazmgok\",\"restoreTimestampInUtc\":\"2021-02-16T20:34:57Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":2102147684,\"autoscaleSettings\":{\"maxThroughput\":403583573}}},\"location\":\"rthqe\",\"tags\":{\"iezeagm\":\"qrtvaoznqni\",\"lzmb\":\"eituugedhfpjs\",\"fsyrledjc\":\"syjdeolctae\"},\"identity\":{\"principalId\":\"bvt\",\"tenantId\":\"gdxzvsgeafgfoseh\",\"type\":\"None\",\"userAssignedIdentities\":{\"jlpzeqtoyrp\":{\"principalId\":\"zppkk\",\"clientId\":\"aesky\"},\"w\":{\"principalId\":\"xlaj\",\"clientId\":\"lpquevhamfow\"}}},\"id\":\"mkekxpkzwaqxo\",\"name\":\"qovchiqbp\",\"type\":\"vf\"},{\"properties\":{\"resource\":{\"_rid\":\"ztekxbyjgmsfep\",\"_ts\":22.349136,\"_etag\":\"pqadagrhrdicxdwy\",\"id\":\"fowxwyovcxjsgbi\",\"restoreParameters\":{\"restoreSource\":\"kdveksb\",\"restoreTimestampInUtc\":\"2021-11-28T15:34:09Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":1223925739,\"autoscaleSettings\":{\"maxThroughput\":227802050}}},\"location\":\"ib\",\"tags\":{\"wlkaaggkrehbfrnu\":\"jdusspyszekb\",\"qtaadusrexxfavsq\":\"bffljfiimreoag\",\"zilfmnlikps\":\"udo\"},\"identity\":{\"principalId\":\"feypofqpmb\",\"tenantId\":\"qgsdr\",\"type\":\"None\",\"userAssignedIdentities\":{\"mqilrixysfnimsqy\":{\"principalId\":\"ophgerh\",\"clientId\":\"vgohtw\"},\"zduewihapfjii\":{\"principalId\":\"wmhkruwaedrympml\",\"clientId\":\"in\"}}},\"id\":\"jdiq\",\"name\":\"liejhpc\",\"type\":\"bi\"},{\"properties\":{\"resource\":{\"_rid\":\"bwceivbvzip\",\"_ts\":64.75766,\"_etag\":\"oooxzpradmskxk\",\"id\":\"pdgzigjsugswhg\",\"restoreParameters\":{\"restoreSource\":\"dkwwn\",\"restoreTimestampInUtc\":\"2021-03-20T20:45:52Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":1160864146,\"autoscaleSettings\":{\"maxThroughput\":394441796}}},\"location\":\"wsxbgnvkervqc\",\"tags\":{\"bdsrgfajglzrsu\":\"dhrsxqvzvsp\",\"jdvqy\":\"klrxhjnltce\",\"qkwaruwd\":\"ie\",\"xbibanbaupw\":\"vqzxoebwg\"},\"identity\":{\"principalId\":\"pak\",\"tenantId\":\"zkxbzrpejplss\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"gwl\":{\"principalId\":\"kgsuxunrswgk\",\"clientId\":\"hboyikebhuhks\"},\"fejyvdwtfxptpqa\":{\"principalId\":\"hueoijyzcqyp\",\"clientId\":\"zufgs\"}}},\"id\":\"mkncfgybmxsnxo\",\"name\":\"uullojkp\",\"type\":\"yhgww\"}],\"nextLink\":\"uxdbdljzgdyrcvuq\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"fqoixwgiksbbvt\",\"_ts\":21.356148,\"_etag\":\"p\",\"id\":\"gwphchgjtnht\",\"restoreParameters\":{\"restoreSource\":\"acihmbfntu\",\"restoreTimestampInUtc\":\"2021-04-22T18:22:46Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":1637002946,\"autoscaleSettings\":{\"maxThroughput\":1245824360}}},\"location\":\"c\",\"tags\":{\"zwxuqgovsx\":\"gomtm\",\"mkkhtgfredml\":\"wwztj\"},\"identity\":{\"principalId\":\"rllccnaovjowazhp\",\"tenantId\":\"acomlyotg\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"bxeetqujxcxxqn\":{\"principalId\":\"rqorcgen\",\"clientId\":\"c\"},\"ehqqrsilcchs\":{\"principalId\":\"qjkedwqurc\",\"clientId\":\"jmrvvxwjongz\"}}},\"id\":\"xk\",\"name\":\"nsbvr\",\"type\":\"aqgvto\"},{\"properties\":{\"resource\":{\"_rid\":\"fuctejrthcf\",\"_ts\":96.257805,\"_etag\":\"lyubqjrostvrjeq\",\"id\":\"tzzbeq\",\"restoreParameters\":{\"restoreSource\":\"rxalxrdha\",\"restoreTimestampInUtc\":\"2021-10-03T17:08:10Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"},\"options\":{\"throughput\":1746131078,\"autoscaleSettings\":{\"maxThroughput\":41736944}}},\"location\":\"wk\",\"tags\":{\"jkqxetqmmli\":\"anxkvvcsemsvuv\",\"xnwxdch\":\"rj\",\"hzlxpgfquw\":\"ojxl\"},\"identity\":{\"principalId\":\"iibelwcerw\",\"tenantId\":\"bpjxljtxbusqtb\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"wqrgxfllmqi\":{\"principalId\":\"sdzhgbdgzpagsec\",\"clientId\":\"db\"},\"xpymdjfuaxro\":{\"principalId\":\"ezoell\",\"clientId\":\"kiiwvmtu\"},\"x\":{\"principalId\":\"qpilrgu\",\"clientId\":\"anlduwzorxsb\"}}},\"id\":\"klxymxkqvfqepdxc\",\"name\":\"tuubwyvpjb\",\"type\":\"wcpjqduqgi\"},{\"properties\":{\"resource\":{\"_rid\":\"ydfbwlj\",\"_ts\":81.41402,\"_etag\":\"erkjddv\",\"id\":\"gliegftcvbiif\",\"restoreParameters\":{\"restoreSource\":\"dwgdn\",\"restoreTimestampInUtc\":\"2021-05-22T03:32:58Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":457297052,\"autoscaleSettings\":{\"maxThroughput\":1268752565}}},\"location\":\"zldbglzoutbaaqg\",\"tags\":{\"nzjotvmr\":\"ajclyzgsnorbjg\",\"ayfluiyuosnu\":\"khlobvvjbhvhdi\",\"hbuubpy\":\"dtelvhyibdrqrs\"},\"identity\":{\"principalId\":\"tjoxztfw\",\"tenantId\":\"chvczev\",\"type\":\"None\",\"userAssignedIdentities\":{\"gkrepdqhqyhw\":{\"principalId\":\"gfyvrtpqpe\",\"clientId\":\"z\"},\"hgreohtwhlpuz\":{\"principalId\":\"e\",\"clientId\":\"xqabckmzeoxi\"},\"rbf\":{\"principalId\":\"ceezn\",\"clientId\":\"ng\"}}},\"id\":\"yxzlbciphmse\",\"name\":\"roqr\",\"type\":\"dktxfv\"}],\"nextLink\":\"feeqgpkrietbgnix\"}") .toObject(GremlinDatabaseListResult.class); - Assertions.assertEquals("uxdbdljzgdyrcvuq", model.nextLink()); + Assertions.assertEquals("feeqgpkrietbgnix", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseResourceTests.java index adeb3c23beea..18011036c16f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinDatabaseResourceTests.java @@ -15,29 +15,29 @@ public final class GremlinDatabaseResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinDatabaseResource model = BinaryData.fromString( - "{\"id\":\"id\",\"restoreParameters\":{\"restoreSource\":\"lrmpwctofldse\",\"restoreTimestampInUtc\":\"2020-12-26T00:57:10Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"}") + "{\"id\":\"wo\",\"restoreParameters\":{\"restoreSource\":\"s\",\"restoreTimestampInUtc\":\"2021-07-10T06:15:54Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"}") .toObject(GremlinDatabaseResource.class); - Assertions.assertEquals("id", model.id()); - Assertions.assertEquals("lrmpwctofldse", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-26T00:57:10Z"), + Assertions.assertEquals("wo", model.id()); + Assertions.assertEquals("s", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-10T06:15:54Z"), model.restoreParameters().restoreTimestampInUtc()); - Assertions.assertFalse(model.restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); + Assertions.assertTrue(model.restoreParameters().restoreWithTtlDisabled()); + Assertions.assertEquals(CreateMode.RESTORE, model.createMode()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - GremlinDatabaseResource model = new GremlinDatabaseResource().withId("id") - .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("lrmpwctofldse") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2020-12-26T00:57:10Z")) - .withRestoreWithTtlDisabled(false)) - .withCreateMode(CreateMode.DEFAULT); + GremlinDatabaseResource model = new GremlinDatabaseResource().withId("wo") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("s") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-07-10T06:15:54Z")) + .withRestoreWithTtlDisabled(true)) + .withCreateMode(CreateMode.RESTORE); model = BinaryData.fromObject(model).toObject(GremlinDatabaseResource.class); - Assertions.assertEquals("id", model.id()); - Assertions.assertEquals("lrmpwctofldse", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-26T00:57:10Z"), + Assertions.assertEquals("wo", model.id()); + Assertions.assertEquals("s", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-10T06:15:54Z"), model.restoreParameters().restoreTimestampInUtc()); - Assertions.assertFalse(model.restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); + Assertions.assertTrue(model.restoreParameters().restoreWithTtlDisabled()); + Assertions.assertEquals(CreateMode.RESTORE, model.createMode()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinGraphGetPropertiesOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinGraphGetPropertiesOptionsTests.java index fc0f7f93514c..8e99ab1bab2f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinGraphGetPropertiesOptionsTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinGraphGetPropertiesOptionsTests.java @@ -12,9 +12,9 @@ public final class GremlinGraphGetPropertiesOptionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinGraphGetPropertiesOptions model - = BinaryData.fromString("{\"throughput\":5095655,\"autoscaleSettings\":{\"maxThroughput\":1076674596}}") + = BinaryData.fromString("{\"throughput\":1212875689,\"autoscaleSettings\":{\"maxThroughput\":1924585618}}") .toObject(GremlinGraphGetPropertiesOptions.class); - Assertions.assertEquals(5095655, model.throughput()); - Assertions.assertEquals(1076674596, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1212875689, model.throughput()); + Assertions.assertEquals(1924585618, model.autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleAssignmentListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleAssignmentListResultTests.java index b0b62b119352..85185d3e80a5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleAssignmentListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleAssignmentListResultTests.java @@ -12,11 +12,11 @@ public final class GremlinRoleAssignmentListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinRoleAssignmentListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"roleDefinitionId\":\"lrufssjygh\",\"scope\":\"xrkbhammgmqfmef\",\"principalId\":\"qcpdwjgquxwey\",\"provisioningState\":\"andkd\"},\"id\":\"jhunhghcg\",\"name\":\"wnrrnquoxso\",\"type\":\"ireimseobf\"},{\"properties\":{\"roleDefinitionId\":\"tcyilbvz\",\"scope\":\"xcjzlquze\",\"principalId\":\"kjxebj\",\"provisioningState\":\"zinzabwmvogljsvl\"},\"id\":\"idnwceha\",\"name\":\"idoyzl\",\"type\":\"giomqo\"},{\"properties\":{\"roleDefinitionId\":\"pia\",\"scope\":\"pfsergdtpeqna\",\"principalId\":\"heqwbpqqncjubkh\",\"provisioningState\":\"zfymcwmbupyvqyvl\"},\"id\":\"iipsejbsvsiaies\",\"name\":\"hddzydisnuepy\",\"type\":\"yjln\"},{\"properties\":{\"roleDefinitionId\":\"xottdiia\",\"scope\":\"qibzji\",\"principalId\":\"ee\",\"provisioningState\":\"ph\"},\"id\":\"vcjwqwoqsratj\",\"name\":\"dhzybsp\",\"type\":\"jhfrzgdkkagv\"}],\"nextLink\":\"khsusmmorf\"}") + "{\"value\":[{\"properties\":{\"roleDefinitionId\":\"uiocuselqkrsazr\",\"scope\":\"uddq\",\"principalId\":\"tffisjmr\",\"provisioningState\":\"hmwdmdlgyqixokw\"},\"id\":\"awhva\",\"name\":\"nqf\",\"type\":\"qdlcvmyolc\"},{\"properties\":{\"roleDefinitionId\":\"jchtvsnvlaqd\",\"scope\":\"yzawatu\",\"principalId\":\"kokb\",\"provisioningState\":\"othymgobl\"},\"id\":\"snwgwimaa\",\"name\":\"eakhtmhobcya\",\"type\":\"rfvqtvkhgvo\"},{\"properties\":{\"roleDefinitionId\":\"kfnaoaqymhc\",\"scope\":\"opuowyrnskbyhqu\",\"principalId\":\"zygxvha\",\"provisioningState\":\"xecxqnwh\"},\"id\":\"ozawmvgxsmpk\",\"name\":\"pwirfljfewxqouo\",\"type\":\"ud\"}],\"nextLink\":\"ckaprhknqiijge\"}") .toObject(GremlinRoleAssignmentListResult.class); - Assertions.assertEquals("lrufssjygh", model.value().get(0).roleDefinitionId()); - Assertions.assertEquals("xrkbhammgmqfmef", model.value().get(0).scope()); - Assertions.assertEquals("qcpdwjgquxwey", model.value().get(0).principalId()); - Assertions.assertEquals("khsusmmorf", model.nextLink()); + Assertions.assertEquals("uiocuselqkrsazr", model.value().get(0).roleDefinitionId()); + Assertions.assertEquals("uddq", model.value().get(0).scope()); + Assertions.assertEquals("tffisjmr", model.value().get(0).principalId()); + Assertions.assertEquals("ckaprhknqiijge", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleAssignmentResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleAssignmentResourceInnerTests.java index f653fcf525fb..f2ac59b7c8be 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleAssignmentResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleAssignmentResourceInnerTests.java @@ -12,21 +12,21 @@ public final class GremlinRoleAssignmentResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinRoleAssignmentResourceInner model = BinaryData.fromString( - "{\"properties\":{\"roleDefinitionId\":\"xb\",\"scope\":\"xjxjoe\",\"principalId\":\"qxrkdknko\",\"provisioningState\":\"ktmbozomtzami\"},\"id\":\"igwcdgzsezn\",\"name\":\"xke\",\"type\":\"ai\"}") + "{\"properties\":{\"roleDefinitionId\":\"hzbh\",\"scope\":\"oolkolirhhm\",\"principalId\":\"usuzgfjzcvaaxo\",\"provisioningState\":\"lahfxwccokdxk\"},\"id\":\"mkczynuhhoqe\",\"name\":\"shavljqkx\",\"type\":\"rqolnthbb\"}") .toObject(GremlinRoleAssignmentResourceInner.class); - Assertions.assertEquals("xb", model.roleDefinitionId()); - Assertions.assertEquals("xjxjoe", model.scope()); - Assertions.assertEquals("qxrkdknko", model.principalId()); + Assertions.assertEquals("hzbh", model.roleDefinitionId()); + Assertions.assertEquals("oolkolirhhm", model.scope()); + Assertions.assertEquals("usuzgfjzcvaaxo", model.principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - GremlinRoleAssignmentResourceInner model = new GremlinRoleAssignmentResourceInner().withRoleDefinitionId("xb") - .withScope("xjxjoe") - .withPrincipalId("qxrkdknko"); + GremlinRoleAssignmentResourceInner model = new GremlinRoleAssignmentResourceInner().withRoleDefinitionId("hzbh") + .withScope("oolkolirhhm") + .withPrincipalId("usuzgfjzcvaaxo"); model = BinaryData.fromObject(model).toObject(GremlinRoleAssignmentResourceInner.class); - Assertions.assertEquals("xb", model.roleDefinitionId()); - Assertions.assertEquals("xjxjoe", model.scope()); - Assertions.assertEquals("qxrkdknko", model.principalId()); + Assertions.assertEquals("hzbh", model.roleDefinitionId()); + Assertions.assertEquals("oolkolirhhm", model.scope()); + Assertions.assertEquals("usuzgfjzcvaaxo", model.principalId()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleAssignmentResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleAssignmentResourcePropertiesTests.java index aaf7bde0a4ab..9f324cc1009b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleAssignmentResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleAssignmentResourcePropertiesTests.java @@ -12,22 +12,22 @@ public final class GremlinRoleAssignmentResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinRoleAssignmentResourceProperties model = BinaryData.fromString( - "{\"roleDefinitionId\":\"abmdlqj\",\"scope\":\"dp\",\"principalId\":\"xlhupmomihzbdnp\",\"provisioningState\":\"kcdpreyxelyi\"}") + "{\"roleDefinitionId\":\"gzukw\",\"scope\":\"nzkjthfceyjn\",\"principalId\":\"mlfuyfjbp\",\"provisioningState\":\"ddhlrufzcqyj\"}") .toObject(GremlinRoleAssignmentResourceProperties.class); - Assertions.assertEquals("abmdlqj", model.roleDefinitionId()); - Assertions.assertEquals("dp", model.scope()); - Assertions.assertEquals("xlhupmomihzbdnp", model.principalId()); + Assertions.assertEquals("gzukw", model.roleDefinitionId()); + Assertions.assertEquals("nzkjthfceyjn", model.scope()); + Assertions.assertEquals("mlfuyfjbp", model.principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { GremlinRoleAssignmentResourceProperties model - = new GremlinRoleAssignmentResourceProperties().withRoleDefinitionId("abmdlqj") - .withScope("dp") - .withPrincipalId("xlhupmomihzbdnp"); + = new GremlinRoleAssignmentResourceProperties().withRoleDefinitionId("gzukw") + .withScope("nzkjthfceyjn") + .withPrincipalId("mlfuyfjbp"); model = BinaryData.fromObject(model).toObject(GremlinRoleAssignmentResourceProperties.class); - Assertions.assertEquals("abmdlqj", model.roleDefinitionId()); - Assertions.assertEquals("dp", model.scope()); - Assertions.assertEquals("xlhupmomihzbdnp", model.principalId()); + Assertions.assertEquals("gzukw", model.roleDefinitionId()); + Assertions.assertEquals("nzkjthfceyjn", model.scope()); + Assertions.assertEquals("mlfuyfjbp", model.principalId()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleDefinitionListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleDefinitionListResultTests.java index 803bbe8fcdbe..c8e7d84daeb8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleDefinitionListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleDefinitionListResultTests.java @@ -13,15 +13,15 @@ public final class GremlinRoleDefinitionListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinRoleDefinitionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"id\":\"qxjoshohtotryeg\",\"roleName\":\"h\",\"type\":\"CustomRole\",\"assignableScopes\":[\"znlw\",\"bfokxkhu\",\"ze\"],\"permissions\":[{\"id\":\"jblcdrmyfcemftz\",\"dataActions\":[\"kya\",\"ugekdfqn\",\"ttw\"],\"notDataActions\":[\"rczfjjnnuxxr\",\"kmhmnulwempdc\",\"frhjulrsulwzp\",\"lusnawmhhgzotfr\"]},{\"id\":\"rgkoekvzwxxyx\",\"dataActions\":[\"hctxbxmolpcqyd\",\"y\",\"vskiczd\",\"rjeizik\"],\"notDataActions\":[\"boohxbms\",\"ycqsxr\",\"d\"]}]},\"id\":\"wuyqaeo\",\"name\":\"pjhgejkb\",\"type\":\"hhdau\"}],\"nextLink\":\"hoo\"}") + "{\"value\":[{\"properties\":{\"id\":\"fkyezolgjzm\",\"roleName\":\"uydoccnx\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"bui\",\"dh\",\"atecaa\",\"sdohz\"],\"permissions\":[{\"id\":\"bdaombwi\",\"dataActions\":[\"d\",\"l\",\"ktl\"],\"notDataActions\":[\"wavvqxuajgcqwuly\",\"kgfcfdruws\",\"kxx\",\"clhuulriqbyokv\"]},{\"id\":\"bzsxebrslttfy\",\"dataActions\":[\"jwsuoardnag\"],\"notDataActions\":[\"ufpbpgnrhol\",\"ujbfwxiplkys\",\"l\",\"yjprxslw\"]}]},\"id\":\"mcvht\",\"name\":\"bzjhfvhuwzb\",\"type\":\"pcqzg\"},{\"properties\":{\"id\":\"tjecohm\",\"roleName\":\"vlrrskapbxwieexu\",\"type\":\"CustomRole\",\"assignableScopes\":[\"ltfokyksyim\"],\"permissions\":[{\"id\":\"r\",\"dataActions\":[\"xzznnui\",\"ersejeg\",\"rkjguwrjmwvvbt\"],\"notDataActions\":[\"xximwgxq\"]},{\"id\":\"ekotjgxi\",\"dataActions\":[\"kyfh\"],\"notDataActions\":[\"jaqupbyynvskpaj\",\"mgeu\"]},{\"id\":\"xmjbxcbccwkqmtxa\",\"dataActions\":[\"iscr\"],\"notDataActions\":[\"gftrqrejdaahuqim\",\"dahlfxlmuifmuadj\",\"fsn\"]},{\"id\":\"kiioshj\",\"dataActions\":[\"etybnxgzt\",\"cg\"],\"notDataActions\":[\"chfjvmywjzebe\"]}]},\"id\":\"vlbefvwclj\",\"name\":\"xpyl\",\"type\":\"woxzgwpsyxji\"},{\"properties\":{\"id\":\"pdvrbkerdkdkga\",\"roleName\":\"wjxildfkcefeyg\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"isf\",\"naybdjnxu\",\"entq\"],\"permissions\":[{\"id\":\"hymxymulwivqtow\",\"dataActions\":[\"sycoybajasqub\",\"ajcywhjqw\"],\"notDataActions\":[\"qo\",\"tfxcpupuk\",\"ymjzpwdlvwtiws\"]}]},\"id\":\"sa\",\"name\":\"nhqnampp\",\"type\":\"ltassaekewna\"},{\"properties\":{\"id\":\"jb\",\"roleName\":\"jlcyizy\",\"type\":\"CustomRole\",\"assignableScopes\":[\"od\"],\"permissions\":[{\"id\":\"sxxb\",\"dataActions\":[\"sqlv\"],\"notDataActions\":[\"pwgoljt\",\"xnmxsdobygoogxqa\",\"j\",\"vaz\"]},{\"id\":\"fucsaodjnosdkvi\",\"dataActions\":[\"sgm\",\"trnzpducdaaktu\",\"ktz\"],\"notDataActions\":[\"myfp\",\"dowkppnwyytfv\"]}]},\"id\":\"tfjikffffgkuh\",\"name\":\"nwhvuldbkkejj\",\"type\":\"jigawgaz\"}],\"nextLink\":\"jqifhujjsbcml\"}") .toObject(GremlinRoleDefinitionListResult.class); - Assertions.assertEquals("qxjoshohtotryeg", model.value().get(0).idPropertiesId()); - Assertions.assertEquals("h", model.value().get(0).roleName()); - Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.value().get(0).typePropertiesType()); - Assertions.assertEquals("znlw", model.value().get(0).assignableScopes().get(0)); - Assertions.assertEquals("jblcdrmyfcemftz", model.value().get(0).permissions().get(0).id()); - Assertions.assertEquals("kya", model.value().get(0).permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("rczfjjnnuxxr", model.value().get(0).permissions().get(0).notDataActions().get(0)); - Assertions.assertEquals("hoo", model.nextLink()); + Assertions.assertEquals("fkyezolgjzm", model.value().get(0).idPropertiesId()); + Assertions.assertEquals("uydoccnx", model.value().get(0).roleName()); + Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.value().get(0).typePropertiesType()); + Assertions.assertEquals("bui", model.value().get(0).assignableScopes().get(0)); + Assertions.assertEquals("bdaombwi", model.value().get(0).permissions().get(0).id()); + Assertions.assertEquals("d", model.value().get(0).permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("wavvqxuajgcqwuly", model.value().get(0).permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("jqifhujjsbcml", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleDefinitionResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleDefinitionResourceInnerTests.java index 9d55527df2b0..0e8fe90fbedc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleDefinitionResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleDefinitionResourceInnerTests.java @@ -15,38 +15,38 @@ public final class GremlinRoleDefinitionResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinRoleDefinitionResourceInner model = BinaryData.fromString( - "{\"properties\":{\"id\":\"wpiwxeiicrmpep\",\"roleName\":\"dm\",\"type\":\"CustomRole\",\"assignableScopes\":[\"vs\",\"ws\",\"gkjgya\"],\"permissions\":[{\"id\":\"sekwefc\",\"dataActions\":[\"nwoqartwy\",\"qicladv\",\"tdavuqmcbymsfobj\"],\"notDataActions\":[\"vjezcjumvpsim\",\"oyoiglkmiqw\",\"nracli\"]},{\"id\":\"fqpspkladyd\",\"dataActions\":[\"autw\",\"kexzgpmnmabeddqi\"],\"notDataActions\":[\"d\",\"pfqfpc\",\"stcl\"]}]},\"id\":\"rvwerfwxbsmtb\",\"name\":\"jj\",\"type\":\"h\"}") + "{\"properties\":{\"id\":\"qkevzgj\",\"roleName\":\"anhx\",\"type\":\"CustomRole\",\"assignableScopes\":[\"zetwwzjwotnx\"],\"permissions\":[{\"id\":\"glhrfo\",\"dataActions\":[\"ecrsnh\"],\"notDataActions\":[\"elqxovppqi\",\"ukklvzrlr\"]},{\"id\":\"ccmetjsczivfqb\",\"dataActions\":[\"sdsyenzsie\",\"scplhyvd\",\"xlyzkxit\"],\"notDataActions\":[\"ezsvkolrupjov\",\"ozsaye\",\"razwzlpzbt\",\"uykykipfsd\"]}]},\"id\":\"pfnocm\",\"name\":\"ezacfpztga\",\"type\":\"wyqejgaao\"}") .toObject(GremlinRoleDefinitionResourceInner.class); - Assertions.assertEquals("wpiwxeiicrmpep", model.idPropertiesId()); - Assertions.assertEquals("dm", model.roleName()); + Assertions.assertEquals("qkevzgj", model.idPropertiesId()); + Assertions.assertEquals("anhx", model.roleName()); Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.typePropertiesType()); - Assertions.assertEquals("vs", model.assignableScopes().get(0)); - Assertions.assertEquals("sekwefc", model.permissions().get(0).id()); - Assertions.assertEquals("nwoqartwy", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("vjezcjumvpsim", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("zetwwzjwotnx", model.assignableScopes().get(0)); + Assertions.assertEquals("glhrfo", model.permissions().get(0).id()); + Assertions.assertEquals("ecrsnh", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("elqxovppqi", model.permissions().get(0).notDataActions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { GremlinRoleDefinitionResourceInner model - = new GremlinRoleDefinitionResourceInner().withIdPropertiesId("wpiwxeiicrmpep") - .withRoleName("dm") + = new GremlinRoleDefinitionResourceInner().withIdPropertiesId("qkevzgj") + .withRoleName("anhx") .withTypePropertiesType(RoleDefinitionType.CUSTOM_ROLE) - .withAssignableScopes(Arrays.asList("vs", "ws", "gkjgya")) + .withAssignableScopes(Arrays.asList("zetwwzjwotnx")) .withPermissions(Arrays.asList( - new Permission().withId("sekwefc") - .withDataActions(Arrays.asList("nwoqartwy", "qicladv", "tdavuqmcbymsfobj")) - .withNotDataActions(Arrays.asList("vjezcjumvpsim", "oyoiglkmiqw", "nracli")), - new Permission().withId("fqpspkladyd") - .withDataActions(Arrays.asList("autw", "kexzgpmnmabeddqi")) - .withNotDataActions(Arrays.asList("d", "pfqfpc", "stcl")))); + new Permission().withId("glhrfo") + .withDataActions(Arrays.asList("ecrsnh")) + .withNotDataActions(Arrays.asList("elqxovppqi", "ukklvzrlr")), + new Permission().withId("ccmetjsczivfqb") + .withDataActions(Arrays.asList("sdsyenzsie", "scplhyvd", "xlyzkxit")) + .withNotDataActions(Arrays.asList("ezsvkolrupjov", "ozsaye", "razwzlpzbt", "uykykipfsd")))); model = BinaryData.fromObject(model).toObject(GremlinRoleDefinitionResourceInner.class); - Assertions.assertEquals("wpiwxeiicrmpep", model.idPropertiesId()); - Assertions.assertEquals("dm", model.roleName()); + Assertions.assertEquals("qkevzgj", model.idPropertiesId()); + Assertions.assertEquals("anhx", model.roleName()); Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.typePropertiesType()); - Assertions.assertEquals("vs", model.assignableScopes().get(0)); - Assertions.assertEquals("sekwefc", model.permissions().get(0).id()); - Assertions.assertEquals("nwoqartwy", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("vjezcjumvpsim", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("zetwwzjwotnx", model.assignableScopes().get(0)); + Assertions.assertEquals("glhrfo", model.permissions().get(0).id()); + Assertions.assertEquals("ecrsnh", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("elqxovppqi", model.permissions().get(0).notDataActions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleDefinitionResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleDefinitionResourcePropertiesTests.java index ae75d5733052..a034e310835c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleDefinitionResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/GremlinRoleDefinitionResourcePropertiesTests.java @@ -15,44 +15,38 @@ public final class GremlinRoleDefinitionResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GremlinRoleDefinitionResourceProperties model = BinaryData.fromString( - "{\"id\":\"ifkwdvbtbrekqhs\",\"roleName\":\"tfpwpqbyejuw\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"igmghginztx\",\"ujkhnjcmrnkfmkh\"],\"permissions\":[{\"id\":\"mlm\",\"dataActions\":[\"qtqea\",\"j\"],\"notDataActions\":[\"r\",\"gpokddxejhhkvgu\",\"vtptbk\"]},{\"id\":\"kqynspgbvo\",\"dataActions\":[\"kkwvdxaexqokmyr\",\"jialz\",\"nobrqlpb\"],\"notDataActions\":[\"rpzuyudivbx\",\"hsqe\",\"eonqelwgdhuru\",\"y\"]},{\"id\":\"arogatmolji\",\"dataActions\":[\"pinm\",\"vfkn\",\"erzztrkn\",\"j\"],\"notDataActions\":[\"gdy\",\"nhrxlel\",\"jhkeizcp\"]},{\"id\":\"tdmiwjekptyca\",\"dataActions\":[\"jzcqymlcfnz\",\"mhsurlgwqkpmm\",\"pstauol\",\"wiubmomsgvv\"],\"notDataActions\":[\"vlrlohewjjmajn\",\"dfl\",\"ionsw\",\"eq\"]}]}") + "{\"id\":\"tgkppgkqzkcyzmff\",\"roleName\":\"dyfcix\",\"type\":\"CustomRole\",\"assignableScopes\":[\"vhoej\",\"oiutgwrmkahpq\"],\"permissions\":[{\"id\":\"ntacih\",\"dataActions\":[\"gmipnmliqmvlbhik\",\"aqgrv\",\"pomxpu\",\"dtsdfjy\"],\"notDataActions\":[\"ocwiqbuoutmpyzgl\",\"ofjsbgbwwzvdaj\",\"wnncfmaciqg\"]},{\"id\":\"rlhiqlwixvtbo\",\"dataActions\":[\"xtndopgjttbasua\",\"ap\",\"lndbeaqbkixv\",\"lwynpbbfqvzfj\"],\"notDataActions\":[\"ugzfeuzjl\"]}]}") .toObject(GremlinRoleDefinitionResourceProperties.class); - Assertions.assertEquals("ifkwdvbtbrekqhs", model.id()); - Assertions.assertEquals("tfpwpqbyejuw", model.roleName()); - Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.type()); - Assertions.assertEquals("igmghginztx", model.assignableScopes().get(0)); - Assertions.assertEquals("mlm", model.permissions().get(0).id()); - Assertions.assertEquals("qtqea", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("r", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("tgkppgkqzkcyzmff", model.id()); + Assertions.assertEquals("dyfcix", model.roleName()); + Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.type()); + Assertions.assertEquals("vhoej", model.assignableScopes().get(0)); + Assertions.assertEquals("ntacih", model.permissions().get(0).id()); + Assertions.assertEquals("gmipnmliqmvlbhik", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("ocwiqbuoutmpyzgl", model.permissions().get(0).notDataActions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { GremlinRoleDefinitionResourceProperties model - = new GremlinRoleDefinitionResourceProperties().withId("ifkwdvbtbrekqhs") - .withRoleName("tfpwpqbyejuw") - .withType(RoleDefinitionType.BUILT_IN_ROLE) - .withAssignableScopes(Arrays.asList("igmghginztx", "ujkhnjcmrnkfmkh")) + = new GremlinRoleDefinitionResourceProperties().withId("tgkppgkqzkcyzmff") + .withRoleName("dyfcix") + .withType(RoleDefinitionType.CUSTOM_ROLE) + .withAssignableScopes(Arrays.asList("vhoej", "oiutgwrmkahpq")) .withPermissions(Arrays.asList( - new Permission().withId("mlm") - .withDataActions(Arrays.asList("qtqea", "j")) - .withNotDataActions(Arrays.asList("r", "gpokddxejhhkvgu", "vtptbk")), - new Permission().withId("kqynspgbvo") - .withDataActions(Arrays.asList("kkwvdxaexqokmyr", "jialz", "nobrqlpb")) - .withNotDataActions(Arrays.asList("rpzuyudivbx", "hsqe", "eonqelwgdhuru", "y")), - new Permission().withId("arogatmolji") - .withDataActions(Arrays.asList("pinm", "vfkn", "erzztrkn", "j")) - .withNotDataActions(Arrays.asList("gdy", "nhrxlel", "jhkeizcp")), - new Permission().withId("tdmiwjekptyca") - .withDataActions(Arrays.asList("jzcqymlcfnz", "mhsurlgwqkpmm", "pstauol", "wiubmomsgvv")) - .withNotDataActions(Arrays.asList("vlrlohewjjmajn", "dfl", "ionsw", "eq")))); + new Permission().withId("ntacih") + .withDataActions(Arrays.asList("gmipnmliqmvlbhik", "aqgrv", "pomxpu", "dtsdfjy")) + .withNotDataActions(Arrays.asList("ocwiqbuoutmpyzgl", "ofjsbgbwwzvdaj", "wnncfmaciqg")), + new Permission().withId("rlhiqlwixvtbo") + .withDataActions(Arrays.asList("xtndopgjttbasua", "ap", "lndbeaqbkixv", "lwynpbbfqvzfj")) + .withNotDataActions(Arrays.asList("ugzfeuzjl")))); model = BinaryData.fromObject(model).toObject(GremlinRoleDefinitionResourceProperties.class); - Assertions.assertEquals("ifkwdvbtbrekqhs", model.id()); - Assertions.assertEquals("tfpwpqbyejuw", model.roleName()); - Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.type()); - Assertions.assertEquals("igmghginztx", model.assignableScopes().get(0)); - Assertions.assertEquals("mlm", model.permissions().get(0).id()); - Assertions.assertEquals("qtqea", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("r", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("tgkppgkqzkcyzmff", model.id()); + Assertions.assertEquals("dyfcix", model.roleName()); + Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.type()); + Assertions.assertEquals("vhoej", model.assignableScopes().get(0)); + Assertions.assertEquals("ntacih", model.permissions().get(0).id()); + Assertions.assertEquals("gmipnmliqmvlbhik", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("ocwiqbuoutmpyzgl", model.permissions().get(0).notDataActions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/IncludedPathTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/IncludedPathTests.java index d5178236ec57..adf35b8e6409 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/IncludedPathTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/IncludedPathTests.java @@ -16,23 +16,25 @@ public final class IncludedPathTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncludedPath model = BinaryData.fromString( - "{\"path\":\"u\",\"indexes\":[{\"dataType\":\"LineString\",\"precision\":293589117,\"kind\":\"Spatial\"}]}") + "{\"path\":\"aumweoohguufu\",\"indexes\":[{\"dataType\":\"LineString\",\"precision\":1654543073,\"kind\":\"Hash\"},{\"dataType\":\"MultiPolygon\",\"precision\":943860065,\"kind\":\"Spatial\"},{\"dataType\":\"String\",\"precision\":60989181,\"kind\":\"Hash\"}]}") .toObject(IncludedPath.class); - Assertions.assertEquals("u", model.path()); + Assertions.assertEquals("aumweoohguufu", model.path()); Assertions.assertEquals(DataType.LINE_STRING, model.indexes().get(0).dataType()); - Assertions.assertEquals(293589117, model.indexes().get(0).precision()); - Assertions.assertEquals(IndexKind.SPATIAL, model.indexes().get(0).kind()); + Assertions.assertEquals(1654543073, model.indexes().get(0).precision()); + Assertions.assertEquals(IndexKind.HASH, model.indexes().get(0).kind()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IncludedPath model = new IncludedPath().withPath("u") + IncludedPath model = new IncludedPath().withPath("aumweoohguufu") .withIndexes(Arrays.asList( - new Indexes().withDataType(DataType.LINE_STRING).withPrecision(293589117).withKind(IndexKind.SPATIAL))); + new Indexes().withDataType(DataType.LINE_STRING).withPrecision(1654543073).withKind(IndexKind.HASH), + new Indexes().withDataType(DataType.MULTI_POLYGON).withPrecision(943860065).withKind(IndexKind.SPATIAL), + new Indexes().withDataType(DataType.STRING).withPrecision(60989181).withKind(IndexKind.HASH))); model = BinaryData.fromObject(model).toObject(IncludedPath.class); - Assertions.assertEquals("u", model.path()); + Assertions.assertEquals("aumweoohguufu", model.path()); Assertions.assertEquals(DataType.LINE_STRING, model.indexes().get(0).dataType()); - Assertions.assertEquals(293589117, model.indexes().get(0).precision()); - Assertions.assertEquals(IndexKind.SPATIAL, model.indexes().get(0).kind()); + Assertions.assertEquals(1654543073, model.indexes().get(0).precision()); + Assertions.assertEquals(IndexKind.HASH, model.indexes().get(0).kind()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/IndexesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/IndexesTests.java index 5c12a90f5038..9563140b3a91 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/IndexesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/IndexesTests.java @@ -13,19 +13,19 @@ public final class IndexesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Indexes model = BinaryData.fromString("{\"dataType\":\"String\",\"precision\":1197375061,\"kind\":\"Hash\"}") + Indexes model = BinaryData.fromString("{\"dataType\":\"String\",\"precision\":1974218119,\"kind\":\"Hash\"}") .toObject(Indexes.class); Assertions.assertEquals(DataType.STRING, model.dataType()); - Assertions.assertEquals(1197375061, model.precision()); + Assertions.assertEquals(1974218119, model.precision()); Assertions.assertEquals(IndexKind.HASH, model.kind()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Indexes model = new Indexes().withDataType(DataType.STRING).withPrecision(1197375061).withKind(IndexKind.HASH); + Indexes model = new Indexes().withDataType(DataType.STRING).withPrecision(1974218119).withKind(IndexKind.HASH); model = BinaryData.fromObject(model).toObject(Indexes.class); Assertions.assertEquals(DataType.STRING, model.dataType()); - Assertions.assertEquals(1197375061, model.precision()); + Assertions.assertEquals(1974218119, model.precision()); Assertions.assertEquals(IndexKind.HASH, model.kind()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/KeyWrapMetadataTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/KeyWrapMetadataTests.java index 65083fee12b1..ec8d8003fcf3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/KeyWrapMetadataTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/KeyWrapMetadataTests.java @@ -12,24 +12,24 @@ public final class KeyWrapMetadataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { KeyWrapMetadata model = BinaryData.fromString( - "{\"name\":\"tpkiwkkbnujry\",\"type\":\"tylbfpncurdoiw\",\"value\":\"thtywub\",\"algorithm\":\"bihwqknfdnt\"}") + "{\"name\":\"qxtjjfzqlqhyca\",\"type\":\"dggxdbeesmi\",\"value\":\"nlrariaawiuagy\",\"algorithm\":\"qfby\"}") .toObject(KeyWrapMetadata.class); - Assertions.assertEquals("tpkiwkkbnujry", model.name()); - Assertions.assertEquals("tylbfpncurdoiw", model.type()); - Assertions.assertEquals("thtywub", model.value()); - Assertions.assertEquals("bihwqknfdnt", model.algorithm()); + Assertions.assertEquals("qxtjjfzqlqhyca", model.name()); + Assertions.assertEquals("dggxdbeesmi", model.type()); + Assertions.assertEquals("nlrariaawiuagy", model.value()); + Assertions.assertEquals("qfby", model.algorithm()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - KeyWrapMetadata model = new KeyWrapMetadata().withName("tpkiwkkbnujry") - .withType("tylbfpncurdoiw") - .withValue("thtywub") - .withAlgorithm("bihwqknfdnt"); + KeyWrapMetadata model = new KeyWrapMetadata().withName("qxtjjfzqlqhyca") + .withType("dggxdbeesmi") + .withValue("nlrariaawiuagy") + .withAlgorithm("qfby"); model = BinaryData.fromObject(model).toObject(KeyWrapMetadata.class); - Assertions.assertEquals("tpkiwkkbnujry", model.name()); - Assertions.assertEquals("tylbfpncurdoiw", model.type()); - Assertions.assertEquals("thtywub", model.value()); - Assertions.assertEquals("bihwqknfdnt", model.algorithm()); + Assertions.assertEquals("qxtjjfzqlqhyca", model.name()); + Assertions.assertEquals("dggxdbeesmi", model.type()); + Assertions.assertEquals("nlrariaawiuagy", model.value()); + Assertions.assertEquals("qfby", model.algorithm()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ListBackupsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ListBackupsTests.java new file mode 100644 index 000000000000..126a7c3accfe --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ListBackupsTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.implementation.models.ListBackups; +import org.junit.jupiter.api.Assertions; + +public final class ListBackupsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ListBackups model = BinaryData.fromString( + "{\"value\":[{\"backupId\":\"nogehlufbort\",\"backupState\":\"Initiated\",\"backupStartTimestamp\":\"2021-02-07T17:17:30Z\",\"backupStopTimestamp\":\"2021-09-12T21:08:11Z\",\"backupExpiryTimestamp\":\"2021-05-21T08:29:15Z\"}],\"nextLink\":\"vbxxyjisskobqoc\"}") + .toObject(ListBackups.class); + Assertions.assertEquals("vbxxyjisskobqoc", model.nextLink()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ListCommandsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ListCommandsTests.java new file mode 100644 index 000000000000..511126717d38 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ListCommandsTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.implementation.models.ListCommands; +import org.junit.jupiter.api.Assertions; + +public final class ListCommandsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ListCommands model = BinaryData.fromString( + "{\"value\":[{\"command\":\"qkzjuqwqaj\",\"commandId\":\"zxpixhyo\",\"arguments\":\"\\\"datanfdbgsoscienezf\\\"\",\"host\":\"ennmf\",\"isAdmin\":true,\"cassandraStopStart\":false,\"readWrite\":true,\"result\":\"kwwnthropmdud\",\"status\":\"Finished\",\"outputFile\":\"rzt\"},{\"command\":\"tjhffecqkoqy\",\"commandId\":\"ergaghpuzx\",\"arguments\":\"\\\"datayehhfdyldhg\\\"\",\"host\":\"d\",\"isAdmin\":true,\"cassandraStopStart\":false,\"readWrite\":true,\"result\":\"htdereun\",\"status\":\"Done\",\"outputFile\":\"zwhpjlwyxedz\"},{\"command\":\"xrfomcke\",\"commandId\":\"my\",\"arguments\":\"\\\"dataopxfjjtpdyzo\\\"\",\"host\":\"xfptofh\",\"isAdmin\":true,\"cassandraStopStart\":true,\"readWrite\":true,\"result\":\"gvad\",\"status\":\"Done\",\"outputFile\":\"wv\"}],\"nextLink\":\"jpytp\"}") + .toObject(ListCommands.class); + Assertions.assertEquals("jpytp", model.nextLink()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/LocationGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/LocationGetResultInnerTests.java index 36f87b49379a..df85d63b5ac8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/LocationGetResultInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/LocationGetResultInnerTests.java @@ -11,7 +11,7 @@ public final class LocationGetResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LocationGetResultInner model = BinaryData.fromString( - "{\"properties\":{\"supportsAvailabilityZone\":false,\"isResidencyRestricted\":true,\"backupStorageRedundancies\":[\"Zone\"],\"isSubscriptionRegionAccessAllowedForRegular\":true,\"isSubscriptionRegionAccessAllowedForAz\":false,\"status\":\"Creating\"},\"id\":\"ejdaahuqimld\",\"name\":\"hlf\",\"type\":\"lmuifmua\"}") + "{\"properties\":{\"supportsAvailabilityZone\":true,\"isResidencyRestricted\":false,\"backupStorageRedundancies\":[\"Zone\",\"Zone\"],\"isSubscriptionRegionAccessAllowedForRegular\":false,\"isSubscriptionRegionAccessAllowedForAz\":true,\"status\":\"InternallyReady\"},\"id\":\"nejzltkaszfjsxs\",\"name\":\"bduxapgrcq\",\"type\":\"bmvrdjomlnwsbv\"}") .toObject(LocationGetResultInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/LocationListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/LocationListResultTests.java index 555da07672b4..7fdbe4c55d93 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/LocationListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/LocationListResultTests.java @@ -12,8 +12,8 @@ public final class LocationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LocationListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"supportsAvailabilityZone\":true,\"isResidencyRestricted\":true,\"backupStorageRedundancies\":[\"Geo\",\"Local\"],\"isSubscriptionRegionAccessAllowedForRegular\":false,\"isSubscriptionRegionAccessAllowedForAz\":false,\"status\":\"Creating\"},\"id\":\"hfjv\",\"name\":\"ywjzebecuvlbefvw\",\"type\":\"ljkxpylrwoxz\"},{\"properties\":{\"supportsAvailabilityZone\":true,\"isResidencyRestricted\":true,\"backupStorageRedundancies\":[\"Geo\",\"Geo\",\"Local\",\"Local\"],\"isSubscriptionRegionAccessAllowedForRegular\":true,\"isSubscriptionRegionAccessAllowedForAz\":false,\"status\":\"Updating\"},\"id\":\"dkdkgawqwjxi\",\"name\":\"dfkcef\",\"type\":\"ygzqpjoisfmn\"}],\"nextLink\":\"bdjnxume\"}") + "{\"value\":[{\"properties\":{\"supportsAvailabilityZone\":true,\"isResidencyRestricted\":true,\"backupStorageRedundancies\":[\"Zone\",\"Local\",\"Zone\",\"Local\"],\"isSubscriptionRegionAccessAllowedForRegular\":true,\"isSubscriptionRegionAccessAllowedForAz\":true,\"status\":\"Updating\"},\"id\":\"kltvdhqnufbx\",\"name\":\"e\",\"type\":\"i\"},{\"properties\":{\"supportsAvailabilityZone\":true,\"isResidencyRestricted\":true,\"backupStorageRedundancies\":[\"Geo\",\"Geo\",\"Zone\",\"Geo\"],\"isSubscriptionRegionAccessAllowedForRegular\":false,\"isSubscriptionRegionAccessAllowedForAz\":true,\"status\":\"Initializing\"},\"id\":\"uwudhuaor\",\"name\":\"jkehwvumosqi\",\"type\":\"c\"}],\"nextLink\":\"qprlobruge\"}") .toObject(LocationListResult.class); - Assertions.assertEquals("bdjnxume", model.nextLink()); + Assertions.assertEquals("qprlobruge", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/LocationPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/LocationPropertiesTests.java index 29c710ff28ef..40f3f838fdb2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/LocationPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/LocationPropertiesTests.java @@ -11,7 +11,7 @@ public final class LocationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LocationProperties model = BinaryData.fromString( - "{\"supportsAvailabilityZone\":false,\"isResidencyRestricted\":false,\"backupStorageRedundancies\":[\"Zone\",\"Zone\",\"Geo\"],\"isSubscriptionRegionAccessAllowedForRegular\":false,\"isSubscriptionRegionAccessAllowedForAz\":true,\"status\":\"Succeeded\"}") + "{\"supportsAvailabilityZone\":false,\"isResidencyRestricted\":true,\"backupStorageRedundancies\":[\"Zone\"],\"isSubscriptionRegionAccessAllowedForRegular\":false,\"isSubscriptionRegionAccessAllowedForAz\":false,\"status\":\"Canceled\"}") .toObject(LocationProperties.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedCassandraManagedServiceIdentityTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedCassandraManagedServiceIdentityTests.java index b66ab6dacd2e..1e971eea05b8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedCassandraManagedServiceIdentityTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedCassandraManagedServiceIdentityTests.java @@ -13,16 +13,16 @@ public final class ManagedCassandraManagedServiceIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedCassandraManagedServiceIdentity model = BinaryData - .fromString("{\"principalId\":\"wgoljtzx\",\"tenantId\":\"xsdobygoogxqapjx\",\"type\":\"SystemAssigned\"}") + .fromString("{\"principalId\":\"rdxrizagbbgiarks\",\"tenantId\":\"pgdqxwabzrw\",\"type\":\"None\"}") .toObject(ManagedCassandraManagedServiceIdentity.class); - Assertions.assertEquals(ManagedCassandraResourceIdentityType.SYSTEM_ASSIGNED, model.type()); + Assertions.assertEquals(ManagedCassandraResourceIdentityType.NONE, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagedCassandraManagedServiceIdentity model = new ManagedCassandraManagedServiceIdentity() - .withType(ManagedCassandraResourceIdentityType.SYSTEM_ASSIGNED); + ManagedCassandraManagedServiceIdentity model + = new ManagedCassandraManagedServiceIdentity().withType(ManagedCassandraResourceIdentityType.NONE); model = BinaryData.fromObject(model).toObject(ManagedCassandraManagedServiceIdentity.class); - Assertions.assertEquals(ManagedCassandraResourceIdentityType.SYSTEM_ASSIGNED, model.type()); + Assertions.assertEquals(ManagedCassandraResourceIdentityType.NONE, model.type()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedCassandraReaperStatusTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedCassandraReaperStatusTests.java index a4e8011055a2..d8285e0590c6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedCassandraReaperStatusTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedCassandraReaperStatusTests.java @@ -12,10 +12,10 @@ public final class ManagedCassandraReaperStatusTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedCassandraReaperStatus model = BinaryData.fromString( - "{\"healthy\":true,\"repairRunIds\":{\"qtvkh\":\"htmhobcyanrf\",\"aqymhcctopuowyr\":\"voogxkfna\",\"hajpxecxqnwhsc\":\"skbyhquhczygx\",\"npwirfljf\":\"zawmvgxsmp\"},\"repairSchedules\":{\"nmckaprhkn\":\"qouoxu\"}}") + "{\"healthy\":true,\"repairRunIds\":{\"nrnjrcuf\":\"scdx\",\"fdtncmspsanma\":\"bgacnr\",\"hlq\":\"eubkqiqmlf\",\"uugkw\":\"skkqjmxptuei\"},\"repairSchedules\":{\"kxukguehvvpxjoe\":\"mrpahuuonj\",\"lleuidpmtonvhgn\":\"cjo\",\"apmumm\":\"tmeplhbpj\"}}") .toObject(ManagedCassandraReaperStatus.class); Assertions.assertTrue(model.healthy()); - Assertions.assertEquals("htmhobcyanrf", model.repairRunIds().get("qtvkh")); - Assertions.assertEquals("qouoxu", model.repairSchedules().get("nmckaprhkn")); + Assertions.assertEquals("scdx", model.repairRunIds().get("nrnjrcuf")); + Assertions.assertEquals("mrpahuuonj", model.repairSchedules().get("kxukguehvvpxjoe")); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedServiceIdentityTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedServiceIdentityTests.java index 2e52fcbbc1af..e448a43ddce0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedServiceIdentityTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedServiceIdentityTests.java @@ -16,20 +16,17 @@ public final class ManagedServiceIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"npiucgygevqznty\",\"tenantId\":\"rbpizc\",\"type\":\"None\",\"userAssignedIdentities\":{\"sjttgzfbish\":{\"principalId\":\"pyd\",\"clientId\":\"yhxdeoejzicwi\"},\"xw\":{\"principalId\":\"khaj\",\"clientId\":\"yeamdphagalpb\"},\"jeputtmrywn\":{\"principalId\":\"pwhonowkg\",\"clientId\":\"wankixzbi\"},\"qqn\":{\"principalId\":\"oqftiyqzrnkcq\",\"clientId\":\"xlwhzlsicoh\"}}}") + "{\"principalId\":\"r\",\"tenantId\":\"sdpydnfyhxdeoejz\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"agalpbuxwgipwhon\":{\"principalId\":\"jttgzf\",\"clientId\":\"shcbkhajdeyeamdp\"}}}") .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ResourceIdentityType.NONE, model.type()); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ResourceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("sjttgzfbish", new ManagedServiceIdentityUserAssignedIdentities(), "xw", - new ManagedServiceIdentityUserAssignedIdentities(), "jeputtmrywn", - new ManagedServiceIdentityUserAssignedIdentities(), "qqn", - new ManagedServiceIdentityUserAssignedIdentities())); + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("agalpbuxwgipwhon", new ManagedServiceIdentityUserAssignedIdentities())); model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ResourceIdentityType.NONE, model.type()); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedServiceIdentityUserAssignedIdentitiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedServiceIdentityUserAssignedIdentitiesTests.java index 0cff2abe33a6..542e0012af7b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedServiceIdentityUserAssignedIdentitiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ManagedServiceIdentityUserAssignedIdentitiesTests.java @@ -11,7 +11,7 @@ public final class ManagedServiceIdentityUserAssignedIdentitiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedServiceIdentityUserAssignedIdentities model - = BinaryData.fromString("{\"principalId\":\"lryav\",\"clientId\":\"heun\"}") + = BinaryData.fromString("{\"principalId\":\"kgshwa\",\"clientId\":\"ixzbinjeputtmryw\"}") .toObject(ManagedServiceIdentityUserAssignedIdentities.class); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewDefinitionTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewDefinitionTests.java new file mode 100644 index 000000000000..5685af37be24 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewDefinitionTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.MaterializedViewDefinition; +import org.junit.jupiter.api.Assertions; + +public final class MaterializedViewDefinitionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaterializedViewDefinition model = BinaryData.fromString( + "{\"sourceCollectionRid\":\"nashcxlp\",\"sourceCollectionId\":\"jerbdkelvidizozs\",\"definition\":\"bccxjmonfdgn\",\"throughputBucketForBuild\":152962682}") + .toObject(MaterializedViewDefinition.class); + Assertions.assertEquals("jerbdkelvidizozs", model.sourceCollectionId()); + Assertions.assertEquals("bccxjmonfdgn", model.definition()); + Assertions.assertEquals(152962682, model.throughputBucketForBuild()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MaterializedViewDefinition model = new MaterializedViewDefinition().withSourceCollectionId("jerbdkelvidizozs") + .withDefinition("bccxjmonfdgn") + .withThroughputBucketForBuild(152962682); + model = BinaryData.fromObject(model).toObject(MaterializedViewDefinition.class); + Assertions.assertEquals("jerbdkelvidizozs", model.sourceCollectionId()); + Assertions.assertEquals("bccxjmonfdgn", model.definition()); + Assertions.assertEquals(152962682, model.throughputBucketForBuild()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewDetailsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewDetailsTests.java new file mode 100644 index 000000000000..843a4519fbc5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewDetailsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.MaterializedViewDetails; +import org.junit.jupiter.api.Assertions; + +public final class MaterializedViewDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaterializedViewDetails model = BinaryData.fromString("{\"id\":\"puuw\",\"_rid\":\"tvuqjctzenkeifzz\"}") + .toObject(MaterializedViewDetails.class); + Assertions.assertEquals("puuw", model.id()); + Assertions.assertEquals("tvuqjctzenkeifzz", model.rid()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MaterializedViewDetails model = new MaterializedViewDetails().withId("puuw").withRid("tvuqjctzenkeifzz"); + model = BinaryData.fromObject(model).toObject(MaterializedViewDetails.class); + Assertions.assertEquals("puuw", model.id()); + Assertions.assertEquals("tvuqjctzenkeifzz", model.rid()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsBuilderRegionalServiceResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsBuilderRegionalServiceResourceTests.java index d7b61920a0a1..13e1de13b088 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsBuilderRegionalServiceResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsBuilderRegionalServiceResourceTests.java @@ -11,7 +11,7 @@ public final class MaterializedViewsBuilderRegionalServiceResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MaterializedViewsBuilderRegionalServiceResource model - = BinaryData.fromString("{\"name\":\"pfpdof\",\"location\":\"kclbtxluevsol\",\"status\":\"Error\"}") + = BinaryData.fromString("{\"name\":\"hvtuwyjsqwzsz\",\"location\":\"zjg\",\"status\":\"Creating\"}") .toObject(MaterializedViewsBuilderRegionalServiceResource.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsBuilderServiceResourceCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsBuilderServiceResourceCreateUpdateParametersTests.java index db9a7a0f0448..5c7403919d9a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsBuilderServiceResourceCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsBuilderServiceResourceCreateUpdateParametersTests.java @@ -13,21 +13,21 @@ public final class MaterializedViewsBuilderServiceResourceCreateUpdateParameters @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MaterializedViewsBuilderServiceResourceCreateUpdateParameters model = BinaryData.fromString( - "{\"serviceType\":\"MaterializedViewsBuilder\",\"instanceSize\":\"Cosmos.D16s\",\"instanceCount\":1078954757}") + "{\"serviceType\":\"MaterializedViewsBuilder\",\"instanceSize\":\"Cosmos.D8s\",\"instanceCount\":804575113}") .toObject(MaterializedViewsBuilderServiceResourceCreateUpdateParameters.class); - Assertions.assertEquals(ServiceSize.COSMOS_D16S, model.instanceSize()); - Assertions.assertEquals(1078954757, model.instanceCount()); + Assertions.assertEquals(ServiceSize.COSMOS_D8S, model.instanceSize()); + Assertions.assertEquals(804575113, model.instanceCount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MaterializedViewsBuilderServiceResourceCreateUpdateParameters model = new MaterializedViewsBuilderServiceResourceCreateUpdateParameters() - .withInstanceSize(ServiceSize.COSMOS_D16S) - .withInstanceCount(1078954757); + .withInstanceSize(ServiceSize.COSMOS_D8S) + .withInstanceCount(804575113); model = BinaryData.fromObject(model) .toObject(MaterializedViewsBuilderServiceResourceCreateUpdateParameters.class); - Assertions.assertEquals(ServiceSize.COSMOS_D16S, model.instanceSize()); - Assertions.assertEquals(1078954757, model.instanceCount()); + Assertions.assertEquals(ServiceSize.COSMOS_D8S, model.instanceSize()); + Assertions.assertEquals(804575113, model.instanceCount()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsBuilderServiceResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsBuilderServiceResourcePropertiesTests.java index f9aaffba7915..8f13ed6f17a0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsBuilderServiceResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsBuilderServiceResourcePropertiesTests.java @@ -13,9 +13,9 @@ public final class MaterializedViewsBuilderServiceResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MaterializedViewsBuilderServiceResourceProperties model = BinaryData.fromString( - "{\"serviceType\":\"MaterializedViewsBuilder\",\"locations\":[{\"name\":\"xuwhttn\",\"location\":\"s\",\"status\":\"Error\"}],\"creationTime\":\"2021-09-12T11:29:30Z\",\"instanceSize\":\"Cosmos.D16s\",\"instanceCount\":1378368314,\"status\":\"Deleting\",\"gvo\":\"\\\"dataekpdzzmssg\\\"\",\"cwztlvvws\":\"\\\"datayejidbdqzsqun\\\"\",\"pwpwfkcauxuva\":\"\\\"datamrkkyjtr\\\"\"}") + "{\"serviceType\":\"MaterializedViewsBuilder\",\"locations\":[{\"name\":\"hxnrn\",\"location\":\"inaegesbx\",\"status\":\"Updating\"},{\"name\":\"mjmoplu\",\"location\":\"ykkfhsovadkrm\",\"status\":\"Deleting\"},{\"name\":\"qpdkesjqbzkqmx\",\"location\":\"o\",\"status\":\"Updating\"}],\"creationTime\":\"2021-04-12T14:42:56Z\",\"instanceSize\":\"Cosmos.D16s\",\"instanceCount\":2046149630,\"status\":\"Creating\",\"ikwsbzrhdugq\":\"\\\"datanrr\\\"\",\"ru\":\"\\\"datahtrgz\\\"\",\"nczk\":\"\\\"datajfhrjhiycbause\\\"\"}") .toObject(MaterializedViewsBuilderServiceResourceProperties.class); Assertions.assertEquals(ServiceSize.COSMOS_D16S, model.instanceSize()); - Assertions.assertEquals(1378368314, model.instanceCount()); + Assertions.assertEquals(2046149630, model.instanceCount()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsPropertiesTests.java new file mode 100644 index 000000000000..a2d4537a1af0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MaterializedViewsPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.MaterializedViewsProperties; +import org.junit.jupiter.api.Assertions; + +public final class MaterializedViewsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MaterializedViewsProperties model = BinaryData.fromString("{\"throughputBucketForBuild\":2067869753}") + .toObject(MaterializedViewsProperties.class); + Assertions.assertEquals(2067869753, model.throughputBucketForBuild()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MaterializedViewsProperties model = new MaterializedViewsProperties().withThroughputBucketForBuild(2067869753); + model = BinaryData.fromObject(model).toObject(MaterializedViewsProperties.class); + Assertions.assertEquals(2067869753, model.throughputBucketForBuild()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MergeParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MergeParametersTests.java new file mode 100644 index 000000000000..93f9f36779a0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MergeParametersTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.MergeParameters; +import org.junit.jupiter.api.Assertions; + +public final class MergeParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MergeParameters model = BinaryData.fromString("{\"isDryRun\":false}").toObject(MergeParameters.class); + Assertions.assertFalse(model.isDryRun()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MergeParameters model = new MergeParameters().withIsDryRun(false); + model = BinaryData.fromObject(model).toObject(MergeParameters.class); + Assertions.assertFalse(model.isDryRun()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricAvailabilityTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricAvailabilityTests.java index 025e20498128..8846d16713d2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricAvailabilityTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricAvailabilityTests.java @@ -10,7 +10,7 @@ public final class MetricAvailabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MetricAvailability model = BinaryData.fromString("{\"timeGrain\":\"alm\",\"retention\":\"tdaaygdvwvg\"}") + MetricAvailability model = BinaryData.fromString("{\"timeGrain\":\"wiipfpub\",\"retention\":\"bwwift\"}") .toObject(MetricAvailability.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricDefinitionInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricDefinitionInnerTests.java index 92f0deca9d3f..8d2ae24ce32f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricDefinitionInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricDefinitionInnerTests.java @@ -11,7 +11,7 @@ public final class MetricDefinitionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MetricDefinitionInner model = BinaryData.fromString( - "{\"metricAvailabilities\":[{\"timeGrain\":\"kallatmel\",\"retention\":\"ipicc\"}],\"primaryAggregationType\":\"Average\",\"unit\":\"Seconds\",\"resourceUri\":\"gvvcnayrhyr\",\"name\":{\"value\":\"mueedndrdvstk\",\"localizedValue\":\"qtc\"}}") + "{\"metricAvailabilities\":[{\"timeGrain\":\"dyh\",\"retention\":\"kkpwdreqnovvq\"},{\"timeGrain\":\"vljxywsu\",\"retention\":\"yrs\"}],\"primaryAggregationType\":\"Average\",\"unit\":\"Milliseconds\",\"resourceUri\":\"adgvraeaene\",\"name\":{\"value\":\"arrwlquu\",\"localizedValue\":\"fqka\"}}") .toObject(MetricDefinitionInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricDefinitionsListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricDefinitionsListResultTests.java index 502f81f2fcfa..e70ad726a8d2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricDefinitionsListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricDefinitionsListResultTests.java @@ -12,8 +12,8 @@ public final class MetricDefinitionsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MetricDefinitionsListResult model = BinaryData.fromString( - "{\"value\":[{\"metricAvailabilities\":[{\"timeGrain\":\"ihleos\",\"retention\":\"w\"}],\"primaryAggregationType\":\"Average\",\"unit\":\"Percent\",\"resourceUri\":\"zrpzb\",\"name\":{\"value\":\"kqqzqioxiysu\",\"localizedValue\":\"zynkedya\"}},{\"metricAvailabilities\":[{\"timeGrain\":\"hqmibzyhwit\",\"retention\":\"ypyynpcdpumnzg\"},{\"timeGrain\":\"z\",\"retention\":\"abikns\"},{\"timeGrain\":\"gj\",\"retention\":\"bldtlww\"},{\"timeGrain\":\"kdmtncvokotll\",\"retention\":\"yhgsy\"}],\"primaryAggregationType\":\"Total\",\"unit\":\"Seconds\",\"resourceUri\":\"tdtbnnhadooc\",\"name\":{\"value\":\"cikhnv\",\"localizedValue\":\"mqg\"}}],\"nextLink\":\"queziky\"}") + "{\"value\":[{\"metricAvailabilities\":[{\"timeGrain\":\"bzdopcj\",\"retention\":\"nhdldwmgxcx\"},{\"timeGrain\":\"lpmutwuoegrpkhj\",\"retention\":\"iyq\"},{\"timeGrain\":\"uicpd\",\"retention\":\"kzzlvmbmpaxmodf\"},{\"timeGrain\":\"efyw\",\"retention\":\"pfvmwyhrfou\"}],\"primaryAggregationType\":\"Average\",\"unit\":\"BytesPerSecond\",\"resourceUri\":\"cpwi\",\"name\":{\"value\":\"qtmnubexkpzk\",\"localizedValue\":\"ondjmq\"}},{\"metricAvailabilities\":[{\"timeGrain\":\"pomgkopkwhojvp\",\"retention\":\"qgxy\"},{\"timeGrain\":\"ocmbqfqvmkcxoza\",\"retention\":\"helxprglya\"},{\"timeGrain\":\"dckcbc\",\"retention\":\"jrjxgciqibrhosx\"},{\"timeGrain\":\"qrhzoymibmrqyib\",\"retention\":\"wfluszdt\"}],\"primaryAggregationType\":\"Minimum\",\"unit\":\"Milliseconds\",\"resourceUri\":\"fyyvoq\",\"name\":{\"value\":\"iexpbtgiwbwo\",\"localizedValue\":\"washr\"}},{\"metricAvailabilities\":[{\"timeGrain\":\"cnqxwbpokulpi\",\"retention\":\"waasip\"},{\"timeGrain\":\"iobyu\",\"retention\":\"rpqlp\"}],\"primaryAggregationType\":\"Total\",\"unit\":\"Bytes\",\"resourceUri\":\"qgbdbuta\",\"name\":{\"value\":\"btkuwhh\",\"localizedValue\":\"ykojoxafnndlpic\"}}],\"nextLink\":\"o\"}") .toObject(MetricDefinitionsListResult.class); - Assertions.assertEquals("queziky", model.nextLink()); + Assertions.assertEquals("o", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricInnerTests.java index fde34f61d9b6..2da8429f3c30 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricInnerTests.java @@ -11,7 +11,7 @@ public final class MetricInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MetricInner model = BinaryData.fromString( - "{\"startTime\":\"2021-07-06T01:32:33Z\",\"endTime\":\"2021-06-02T05:04:16Z\",\"timeGrain\":\"bmrqyibahwfl\",\"unit\":\"Percent\",\"name\":{\"value\":\"mhrkwofyyvoqacp\",\"localizedValue\":\"xpbtgiwbwo\"},\"metricValues\":[{\"_count\":1338594793,\"average\":61.9866823175496,\"maximum\":49.6017449534356,\"minimum\":35.52594883946759,\"timestamp\":\"2021-03-19T14:05:07Z\",\"total\":2.4764070060804277},{\"_count\":1343129600,\"average\":12.424545451086889,\"maximum\":23.07563330276191,\"minimum\":47.42460299713477,\"timestamp\":\"2021-06-01T21:52:28Z\",\"total\":4.018076144198646}]}") + "{\"startTime\":\"2021-02-28T12:22:55Z\",\"endTime\":\"2021-08-01T10:38:27Z\",\"timeGrain\":\"mhhv\",\"unit\":\"Count\",\"name\":{\"value\":\"odkwobd\",\"localizedValue\":\"xtibqdxbxwakbog\"},\"metricValues\":[{\"_count\":1269136735,\"average\":13.895257666234183,\"maximum\":21.810188669422804,\"minimum\":94.81962104695374,\"timestamp\":\"2021-08-01T11:38:37Z\",\"total\":27.59383457209792},{\"_count\":1806634279,\"average\":98.58384394163143,\"maximum\":51.88689344448709,\"minimum\":42.35877941353421,\"timestamp\":\"2021-08-06T08:25:16Z\",\"total\":37.51089551988813},{\"_count\":2007013655,\"average\":46.69014915075782,\"maximum\":93.69577137935529,\"minimum\":53.90231701439472,\"timestamp\":\"2021-11-26T11:00:38Z\",\"total\":65.6134486697413}]}") .toObject(MetricInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricListResultTests.java index c6d6c468c63c..6c686f377e68 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricListResultTests.java @@ -12,8 +12,8 @@ public final class MetricListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MetricListResult model = BinaryData.fromString( - "{\"value\":[{\"startTime\":\"2021-10-20T12:14:16Z\",\"endTime\":\"2021-03-21T05:49:29Z\",\"timeGrain\":\"dmhdlxyjr\",\"unit\":\"Milliseconds\",\"name\":{\"value\":\"fcnihgwq\",\"localizedValue\":\"nedgfbc\"},\"metricValues\":[{\"_count\":151041842,\"average\":78.52908201023732,\"maximum\":58.073881623316545,\"minimum\":38.069842350064896,\"timestamp\":\"2021-04-28T18:47:47Z\",\"total\":15.12183207239718},{\"_count\":1383619855,\"average\":27.78968787713474,\"maximum\":43.367403188188604,\"minimum\":51.562118966524096,\"timestamp\":\"2021-11-16T11:11:20Z\",\"total\":80.83018456005253},{\"_count\":2011097883,\"average\":2.460101993129904,\"maximum\":11.221188833678308,\"minimum\":34.65494027360759,\"timestamp\":\"2021-06-08T21:18:20Z\",\"total\":42.992957308677106}]},{\"startTime\":\"2021-03-21T02:55:47Z\",\"endTime\":\"2021-11-03T10:17:12Z\",\"timeGrain\":\"grpkhjwniyqs\",\"unit\":\"Seconds\",\"name\":{\"value\":\"dggkzzlvmbmpa\",\"localizedValue\":\"odfvuefywsbp\"},\"metricValues\":[{\"_count\":1662682497,\"average\":75.03486769119422,\"maximum\":28.787531770587293,\"minimum\":26.084009122611395,\"timestamp\":\"2021-05-16T02:46:56Z\",\"total\":54.56533564195275},{\"_count\":1209208693,\"average\":41.382002377761154,\"maximum\":89.09841673694949,\"minimum\":79.8884985584721,\"timestamp\":\"2021-08-17T13:21:55Z\",\"total\":46.320225847623654}]},{\"startTime\":\"2021-01-01T12:42:30Z\",\"endTime\":\"2021-10-14T06:39:18Z\",\"timeGrain\":\"jmquxvypomgk\",\"unit\":\"Milliseconds\",\"name\":{\"value\":\"ojvpa\",\"localizedValue\":\"gxysmocmbqfqvm\"},\"metricValues\":[{\"_count\":2143349080,\"average\":52.55340906945693,\"maximum\":82.19695982524165,\"minimum\":34.47438960512931,\"timestamp\":\"2021-09-12T22:12:38Z\",\"total\":28.114033331649146},{\"_count\":1462356590,\"average\":36.943459270294156,\"maximum\":58.70571355880576,\"minimum\":92.55703167577185,\"timestamp\":\"2021-07-29T12:26:41Z\",\"total\":58.71667883183185}]}],\"nextLink\":\"ibrhosxsdqr\"}") + "{\"value\":[{\"startTime\":\"2021-01-19T22:33:55Z\",\"endTime\":\"2021-01-23T19:50:46Z\",\"timeGrain\":\"ssl\",\"unit\":\"Milliseconds\",\"name\":{\"value\":\"dnbbglzps\",\"localizedValue\":\"ydmcwyhzdxssa\"},\"metricValues\":[{\"_count\":122725512,\"average\":61.3564516932404,\"maximum\":2.5464103691215323,\"minimum\":10.515478352876817,\"timestamp\":\"2021-03-29T08:07:43Z\",\"total\":16.816961672090336},{\"_count\":1832906038,\"average\":49.11586332043476,\"maximum\":69.97067445555928,\"minimum\":15.783084431019867,\"timestamp\":\"2021-05-06T19:17:41Z\",\"total\":76.39560219152891},{\"_count\":632905935,\"average\":87.1656167861897,\"maximum\":13.18253509993551,\"minimum\":38.24791651574861,\"timestamp\":\"2021-02-01T14:07:01Z\",\"total\":73.49203195630956},{\"_count\":931979220,\"average\":56.13333824147031,\"maximum\":20.222528894450797,\"minimum\":33.72214282322261,\"timestamp\":\"2021-07-17T08:24:42Z\",\"total\":60.8199846335478}]},{\"startTime\":\"2021-05-03T05:05:06Z\",\"endTime\":\"2021-04-28T07:00:50Z\",\"timeGrain\":\"zpyqsemwab\",\"unit\":\"Milliseconds\",\"name\":{\"value\":\"hszhedplvwiwu\",\"localizedValue\":\"wmbesldnkw\"},\"metricValues\":[{\"_count\":1628886770,\"average\":26.38806206888773,\"maximum\":29.06893015991301,\"minimum\":88.01080662404338,\"timestamp\":\"2021-10-31T14:02:16Z\",\"total\":0.5053473740073366}]}],\"nextLink\":\"ikvmkqzeqqk\"}") .toObject(MetricListResult.class); - Assertions.assertEquals("ibrhosxsdqr", model.nextLink()); + Assertions.assertEquals("ikvmkqzeqqk", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricNameTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricNameTests.java index a1a7bb5d1279..3b03a5246194 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricNameTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricNameTests.java @@ -10,7 +10,7 @@ public final class MetricNameTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MetricName model = BinaryData.fromString("{\"value\":\"byuqerpqlp\",\"localizedValue\":\"cciuqgbdbutau\"}") + MetricName model = BinaryData.fromString("{\"value\":\"l\",\"localizedValue\":\"muwlauwzizxbm\"}") .toObject(MetricName.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricValueTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricValueTests.java index 8b2281f5554a..4f035a6dbc06 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricValueTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MetricValueTests.java @@ -11,7 +11,7 @@ public final class MetricValueTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MetricValue model = BinaryData.fromString( - "{\"_count\":1736041382,\"average\":26.84480982437242,\"maximum\":67.51288030100136,\"minimum\":96.25353948241538,\"timestamp\":\"2021-08-07T17:01:26Z\",\"total\":27.563245298986118}") + "{\"_count\":2123049773,\"average\":71.0532838258196,\"maximum\":95.067817287676,\"minimum\":36.579743591782034,\"timestamp\":\"2021-07-03T19:13:03Z\",\"total\":3.0550660486482473}") .toObject(MetricValue.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBCollectionGetPropertiesOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBCollectionGetPropertiesOptionsTests.java index 1193bbb11414..5d0f73602e88 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBCollectionGetPropertiesOptionsTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBCollectionGetPropertiesOptionsTests.java @@ -12,9 +12,9 @@ public final class MongoDBCollectionGetPropertiesOptionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoDBCollectionGetPropertiesOptions model - = BinaryData.fromString("{\"throughput\":663204273,\"autoscaleSettings\":{\"maxThroughput\":809500058}}") + = BinaryData.fromString("{\"throughput\":417170517,\"autoscaleSettings\":{\"maxThroughput\":327752705}}") .toObject(MongoDBCollectionGetPropertiesOptions.class); - Assertions.assertEquals(663204273, model.throughput()); - Assertions.assertEquals(809500058, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(417170517, model.throughput()); + Assertions.assertEquals(327752705, model.autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseCreateUpdateParametersTests.java index da0579df61c4..adbbd0a93f58 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseCreateUpdateParametersTests.java @@ -23,48 +23,48 @@ public final class MongoDBDatabaseCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoDBDatabaseCreateUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"id\":\"jzoywjxhp\",\"restoreParameters\":{\"restoreSource\":\"ontacnpq\",\"restoreTimestampInUtc\":\"2020-12-27T20:17:23Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":1093452654,\"autoscaleSettings\":{\"maxThroughput\":2123752302}}},\"id\":\"oogwxhnsduugwb\",\"name\":\"e\",\"type\":\"fqkfuarenl\",\"location\":\"htkln\",\"tags\":{\"yfedevjbo\":\"fvv\",\"minqcym\":\"lcqxypokk\"},\"identity\":{\"principalId\":\"gn\",\"tenantId\":\"xxewu\",\"type\":\"None\",\"userAssignedIdentities\":{\"tddmf\":{\"principalId\":\"bchaqd\",\"clientId\":\"qecrqctmxx\"},\"roevyt\":{\"principalId\":\"uytxzvtznapxban\",\"clientId\":\"vvoxczytprwnw\"},\"lobdxna\":{\"principalId\":\"okrrrouuxv\",\"clientId\":\"asbcrymodizrx\"}}}}") + "{\"properties\":{\"resource\":{\"id\":\"jhzn\",\"restoreParameters\":{\"restoreSource\":\"uatmzwcjjncqtj\",\"restoreTimestampInUtc\":\"2021-03-13T06:57:20Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":1580680245,\"autoscaleSettings\":{\"maxThroughput\":1718175668}}},\"id\":\"bxn\",\"name\":\"ebwgga\",\"type\":\"tzlswvaj\",\"location\":\"utlxjoqzasunwqrj\",\"tags\":{\"r\":\"gqhaohcmbuocn\"},\"identity\":{\"principalId\":\"bpyr\",\"tenantId\":\"ameb\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"v\":{\"principalId\":\"fkmroc\",\"clientId\":\"e\"},\"unssxlghieegjl\":{\"principalId\":\"tod\",\"clientId\":\"pyapucygvoav\"}}}}") .toObject(MongoDBDatabaseCreateUpdateParameters.class); - Assertions.assertEquals("htkln", model.location()); - Assertions.assertEquals("fvv", model.tags().get("yfedevjbo")); - Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("jzoywjxhp", model.resource().id()); - Assertions.assertEquals("ontacnpq", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-27T20:17:23Z"), + Assertions.assertEquals("utlxjoqzasunwqrj", model.location()); + Assertions.assertEquals("gqhaohcmbuocn", model.tags().get("r")); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("jhzn", model.resource().id()); + Assertions.assertEquals("uatmzwcjjncqtj", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T06:57:20Z"), model.resource().restoreParameters().restoreTimestampInUtc()); - Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); - Assertions.assertEquals(1093452654, model.options().throughput()); - Assertions.assertEquals(2123752302, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1580680245, model.options().throughput()); + Assertions.assertEquals(1718175668, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MongoDBDatabaseCreateUpdateParameters model = new MongoDBDatabaseCreateUpdateParameters().withLocation("htkln") - .withTags(mapOf("yfedevjbo", "fvv", "minqcym", "lcqxypokk")) - .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("tddmf", new ManagedServiceIdentityUserAssignedIdentities(), "roevyt", - new ManagedServiceIdentityUserAssignedIdentities(), "lobdxna", - new ManagedServiceIdentityUserAssignedIdentities()))) - .withResource(new MongoDBDatabaseResource().withId("jzoywjxhp") - .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("ontacnpq") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2020-12-27T20:17:23Z")) - .withRestoreWithTtlDisabled(false)) - .withCreateMode(CreateMode.DEFAULT)) - .withOptions(new CreateUpdateOptions().withThroughput(1093452654) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(2123752302))); + MongoDBDatabaseCreateUpdateParameters model + = new MongoDBDatabaseCreateUpdateParameters().withLocation("utlxjoqzasunwqrj") + .withTags(mapOf("r", "gqhaohcmbuocn")) + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("v", new ManagedServiceIdentityUserAssignedIdentities(), + "unssxlghieegjl", new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource(new MongoDBDatabaseResource().withId("jhzn") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("uatmzwcjjncqtj") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-03-13T06:57:20Z")) + .withRestoreWithTtlDisabled(true)) + .withCreateMode(CreateMode.DEFAULT)) + .withOptions(new CreateUpdateOptions().withThroughput(1580680245) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1718175668))); model = BinaryData.fromObject(model).toObject(MongoDBDatabaseCreateUpdateParameters.class); - Assertions.assertEquals("htkln", model.location()); - Assertions.assertEquals("fvv", model.tags().get("yfedevjbo")); - Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("jzoywjxhp", model.resource().id()); - Assertions.assertEquals("ontacnpq", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-27T20:17:23Z"), + Assertions.assertEquals("utlxjoqzasunwqrj", model.location()); + Assertions.assertEquals("gqhaohcmbuocn", model.tags().get("r")); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("jhzn", model.resource().id()); + Assertions.assertEquals("uatmzwcjjncqtj", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T06:57:20Z"), model.resource().restoreParameters().restoreTimestampInUtc()); - Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); - Assertions.assertEquals(1093452654, model.options().throughput()); - Assertions.assertEquals(2123752302, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1580680245, model.options().throughput()); + Assertions.assertEquals(1718175668, model.options().autoscaleSettings().maxThroughput()); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseCreateUpdatePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseCreateUpdatePropertiesTests.java index ba0872abc345..e60ee25dd428 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseCreateUpdatePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseCreateUpdatePropertiesTests.java @@ -18,36 +18,36 @@ public final class MongoDBDatabaseCreateUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoDBDatabaseCreateUpdateProperties model = BinaryData.fromString( - "{\"resource\":{\"id\":\"pmkmlmvevfx\",\"restoreParameters\":{\"restoreSource\":\"jhbzxliohrdddtf\",\"restoreTimestampInUtc\":\"2021-11-23T21:44:53Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":796010051,\"autoscaleSettings\":{\"maxThroughput\":646542935}}}") + "{\"resource\":{\"id\":\"vvpa\",\"restoreParameters\":{\"restoreSource\":\"sgb\",\"restoreTimestampInUtc\":\"2021-05-01T22:40:49Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"},\"options\":{\"throughput\":1233685838,\"autoscaleSettings\":{\"maxThroughput\":1115507640}}}") .toObject(MongoDBDatabaseCreateUpdateProperties.class); - Assertions.assertEquals("pmkmlmvevfx", model.resource().id()); - Assertions.assertEquals("jhbzxliohrdddtf", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-23T21:44:53Z"), + Assertions.assertEquals("vvpa", model.resource().id()); + Assertions.assertEquals("sgb", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-01T22:40:49Z"), model.resource().restoreParameters().restoreTimestampInUtc()); - Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(796010051, model.options().throughput()); - Assertions.assertEquals(646542935, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1233685838, model.options().throughput()); + Assertions.assertEquals(1115507640, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MongoDBDatabaseCreateUpdateProperties model = new MongoDBDatabaseCreateUpdateProperties() - .withResource(new MongoDBDatabaseResource().withId("pmkmlmvevfx") - .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("jhbzxliohrdddtf") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-11-23T21:44:53Z")) - .withRestoreWithTtlDisabled(true)) + .withResource(new MongoDBDatabaseResource().withId("vvpa") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("sgb") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-05-01T22:40:49Z")) + .withRestoreWithTtlDisabled(false)) .withCreateMode(CreateMode.RESTORE)) - .withOptions(new CreateUpdateOptions().withThroughput(796010051) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(646542935))); + .withOptions(new CreateUpdateOptions().withThroughput(1233685838) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1115507640))); model = BinaryData.fromObject(model).toObject(MongoDBDatabaseCreateUpdateProperties.class); - Assertions.assertEquals("pmkmlmvevfx", model.resource().id()); - Assertions.assertEquals("jhbzxliohrdddtf", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-23T21:44:53Z"), + Assertions.assertEquals("vvpa", model.resource().id()); + Assertions.assertEquals("sgb", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-01T22:40:49Z"), model.resource().restoreParameters().restoreTimestampInUtc()); - Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(796010051, model.options().throughput()); - Assertions.assertEquals(646542935, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1233685838, model.options().throughput()); + Assertions.assertEquals(1115507640, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetPropertiesOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetPropertiesOptionsTests.java index afd2928e3115..1e596e47d371 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetPropertiesOptionsTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetPropertiesOptionsTests.java @@ -12,9 +12,9 @@ public final class MongoDBDatabaseGetPropertiesOptionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoDBDatabaseGetPropertiesOptions model - = BinaryData.fromString("{\"throughput\":1368151986,\"autoscaleSettings\":{\"maxThroughput\":1307940064}}") + = BinaryData.fromString("{\"throughput\":1319773587,\"autoscaleSettings\":{\"maxThroughput\":2112492135}}") .toObject(MongoDBDatabaseGetPropertiesOptions.class); - Assertions.assertEquals(1368151986, model.throughput()); - Assertions.assertEquals(1307940064, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1319773587, model.throughput()); + Assertions.assertEquals(2112492135, model.autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetPropertiesResourceTests.java index 49f127a6a168..09e024eeb647 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetPropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetPropertiesResourceTests.java @@ -14,13 +14,13 @@ public final class MongoDBDatabaseGetPropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoDBDatabaseGetPropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"ckzmkwklsnox\",\"_ts\":22.2983,\"_etag\":\"e\",\"id\":\"alhhjnhgwydyynfs\",\"restoreParameters\":{\"restoreSource\":\"gbv\",\"restoreTimestampInUtc\":\"2021-09-12T06:08:07Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"}") + "{\"_rid\":\"tysprqsgnzxojpsl\",\"_ts\":39.574043,\"_etag\":\"pli\",\"id\":\"fiqwoy\",\"restoreParameters\":{\"restoreSource\":\"apcohhouc\",\"restoreTimestampInUtc\":\"2021-09-24T18:50:09Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"}") .toObject(MongoDBDatabaseGetPropertiesResource.class); - Assertions.assertEquals("alhhjnhgwydyynfs", model.id()); - Assertions.assertEquals("gbv", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-12T06:08:07Z"), + Assertions.assertEquals("fiqwoy", model.id()); + Assertions.assertEquals("apcohhouc", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-24T18:50:09Z"), model.restoreParameters().restoreTimestampInUtc()); - Assertions.assertTrue(model.restoreParameters().restoreWithTtlDisabled()); + Assertions.assertFalse(model.restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.createMode()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetPropertiesTests.java index 532a363b093f..25986bd52c02 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetPropertiesTests.java @@ -14,15 +14,15 @@ public final class MongoDBDatabaseGetPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoDBDatabaseGetProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"elyetndnbf\",\"_ts\":39.570755,\"_etag\":\"agfl\",\"id\":\"lgmtrwahzjmucf\",\"restoreParameters\":{\"restoreSource\":\"r\",\"restoreTimestampInUtc\":\"2021-04-22T08:33:43Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":44892577,\"autoscaleSettings\":{\"maxThroughput\":1486534232}}}") + "{\"resource\":{\"_rid\":\"eakxcptsoqfyi\",\"_ts\":5.842119,\"_etag\":\"chkrttzr\",\"id\":\"zisgykiuemvanb\",\"restoreParameters\":{\"restoreSource\":\"hmnr\",\"restoreTimestampInUtc\":\"2021-03-27T04:52:59Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"},\"options\":{\"throughput\":1069752468,\"autoscaleSettings\":{\"maxThroughput\":233230140}}}") .toObject(MongoDBDatabaseGetProperties.class); - Assertions.assertEquals("lgmtrwahzjmucf", model.resource().id()); - Assertions.assertEquals("r", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-22T08:33:43Z"), + Assertions.assertEquals("zisgykiuemvanb", model.resource().id()); + Assertions.assertEquals("hmnr", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-27T04:52:59Z"), model.resource().restoreParameters().restoreTimestampInUtc()); - Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(44892577, model.options().throughput()); - Assertions.assertEquals(1486534232, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1069752468, model.options().throughput()); + Assertions.assertEquals(233230140, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetResultsInnerTests.java index 1c498fe20b38..1b2be6e5fd70 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetResultsInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseGetResultsInnerTests.java @@ -15,18 +15,18 @@ public final class MongoDBDatabaseGetResultsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoDBDatabaseGetResultsInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"ntkwcegy\",\"_ts\":44.610237,\"_etag\":\"nseqacjjvp\",\"id\":\"lguooqjagmd\",\"restoreParameters\":{\"restoreSource\":\"ueio\",\"restoreTimestampInUtc\":\"2021-09-13T08:16:10Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":361835019,\"autoscaleSettings\":{\"maxThroughput\":807818343}}},\"location\":\"lq\",\"tags\":{\"gdirazf\":\"lmotoebnfxofvcj\",\"bmdujtmvcopexc\":\"xejw\"},\"identity\":{\"principalId\":\"rbuhhlky\",\"tenantId\":\"tqsrogtuwkff\",\"type\":\"None\",\"userAssignedIdentities\":{\"xnfuijtkbusqogs\":{\"principalId\":\"sidfv\",\"clientId\":\"g\"},\"qxfzyjqttvwk\":{\"principalId\":\"kayi\",\"clientId\":\"sharujtj\"},\"guaucmfdjwnla\":{\"principalId\":\"hjpenuygbq\",\"clientId\":\"qekewvnqvcd\"},\"sserxhtvsoxhlwn\":{\"principalId\":\"un\",\"clientId\":\"ikczvvitacgxmf\"}}},\"id\":\"j\",\"name\":\"qrsxyp\",\"type\":\"uuuybnchrsziz\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"aurkihcirlde\",\"_ts\":59.72503,\"_etag\":\"c\",\"id\":\"xnbkkj\",\"restoreParameters\":{\"restoreSource\":\"rnnqb\",\"restoreTimestampInUtc\":\"2021-07-25T16:20:48Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":187168175,\"autoscaleSettings\":{\"maxThroughput\":812541611}}},\"location\":\"gypxrxvbfihwuhvc\",\"tags\":{\"bxrblmliowxihspn\":\"s\"},\"identity\":{\"principalId\":\"agnepzwaklsb\",\"tenantId\":\"qqqagwwrxaomzi\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"qoyueayfbpcmsplb\":{\"principalId\":\"zezkhhltnjadh\",\"clientId\":\"aw\"},\"gdhxi\":{\"principalId\":\"rueqthwm\",\"clientId\":\"mbscbbx\"},\"jelaqacigele\":{\"principalId\":\"lopedbwdpyqyyb\",\"clientId\":\"bmdnafcbqwre\"}}},\"id\":\"d\",\"name\":\"vqvwzkjopwbe\",\"type\":\"nrlkwzdqy\"}") .toObject(MongoDBDatabaseGetResultsInner.class); - Assertions.assertEquals("lq", model.location()); - Assertions.assertEquals("lmotoebnfxofvcj", model.tags().get("gdirazf")); - Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("lguooqjagmd", model.resource().id()); - Assertions.assertEquals("ueio", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T08:16:10Z"), + Assertions.assertEquals("gypxrxvbfihwuhvc", model.location()); + Assertions.assertEquals("s", model.tags().get("bxrblmliowxihspn")); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("xnbkkj", model.resource().id()); + Assertions.assertEquals("rnnqb", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-25T16:20:48Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(361835019, model.options().throughput()); - Assertions.assertEquals(807818343, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); + Assertions.assertEquals(187168175, model.options().throughput()); + Assertions.assertEquals(812541611, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseListResultTests.java index 63ae27532804..f75c3d97037a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseListResultTests.java @@ -12,8 +12,8 @@ public final class MongoDBDatabaseListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoDBDatabaseListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"p\",\"_ts\":41.84596,\"_etag\":\"uicdhzbdybwwg\",\"id\":\"d\",\"restoreParameters\":{\"restoreSource\":\"idmhmwf\",\"restoreTimestampInUtc\":\"2021-07-03T11:38:53Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"},\"options\":{\"throughput\":323271862,\"autoscaleSettings\":{\"maxThroughput\":2065822308}}},\"location\":\"rv\",\"tags\":{\"aimmoiroqb\":\"oxoyyukp\",\"yyrmfsvbp\":\"shbraga\"},\"identity\":{\"principalId\":\"opfppdbwnupgah\",\"tenantId\":\"um\",\"type\":\"None\",\"userAssignedIdentities\":{\"hbzehewho\":{\"principalId\":\"cfdmmcpugmehqe\",\"clientId\":\"u\"},\"r\":{\"principalId\":\"nlbqnbldxeaclg\",\"clientId\":\"horimkr\"}}},\"id\":\"oucs\",\"name\":\"fldpuviyfc\",\"type\":\"abeolhbhlvbm\"},{\"properties\":{\"resource\":{\"_rid\":\"bsxtkcudfbsfarfs\",\"_ts\":31.941235,\"_etag\":\"kjxnqpvwgfstmhq\",\"id\":\"kizmdksaoafclu\",\"restoreParameters\":{\"restoreSource\":\"xmycjimryvwgcw\",\"restoreTimestampInUtc\":\"2020-12-22T05:57:37Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":886481009,\"autoscaleSettings\":{\"maxThroughput\":1998191116}}},\"location\":\"efoh\",\"tags\":{\"mtkhlowkxxpvbr\":\"vopwndyqleallk\",\"lhikcyychunsj\":\"fjmzsyzfho\",\"hv\":\"pjrtws\"},\"identity\":{\"principalId\":\"c\",\"tenantId\":\"vtrrmhwrbfdpyflu\",\"type\":\"None\",\"userAssignedIdentities\":{\"hmem\":{\"principalId\":\"r\",\"clientId\":\"uyzlw\"},\"zjkmmykyujxs\":{\"principalId\":\"oclu\",\"clientId\":\"pqmem\"}}},\"id\":\"hsrrryejylmbkz\",\"name\":\"dnigrfihot\",\"type\":\"e\"},{\"properties\":{\"resource\":{\"_rid\":\"uzzjgnrefq\",\"_ts\":96.89618,\"_etag\":\"toihiqakydi\",\"id\":\"fb\",\"restoreParameters\":{\"restoreSource\":\"pzdqtvhcspod\",\"restoreTimestampInUtc\":\"2021-04-20T18:33:38Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":1609575404,\"autoscaleSettings\":{\"maxThroughput\":282582251}}},\"location\":\"jfulbmoic\",\"tags\":{\"viqsowsaaelcattc\":\"pnfpubntnbat\",\"gfggcvkyylizrzbj\":\"uhplrvkmjcwmjv\",\"ztlvtmvagbwidqlv\":\"sfxsf\"},\"identity\":{\"principalId\":\"oveofizrvjfnmj\",\"tenantId\":\"lwyzgib\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"vtzejetjklnti\":{\"principalId\":\"lfojuidjp\",\"clientId\":\"yjucejikzoeo\"},\"c\":{\"principalId\":\"juzkdbqz\",\"clientId\":\"xrzvhqjwtrhtgvgz\"},\"ynuchlgmltxd\":{\"principalId\":\"kolawjmjsmwrokc\",\"clientId\":\"fzzzwyjafitlhg\"},\"gdphtvdula\":{\"principalId\":\"mozusgzvlnsnnjz\",\"clientId\":\"afolpymwamxqzrag\"}}},\"id\":\"lejchcsr\",\"name\":\"zknmzlanrupd\",\"type\":\"vnphc\"},{\"properties\":{\"resource\":{\"_rid\":\"pjhmqrhvthl\",\"_ts\":63.386166,\"_etag\":\"c\",\"id\":\"smlzzhzdtxetlgy\",\"restoreParameters\":{\"restoreSource\":\"qvlnnpxybafiqgea\",\"restoreTimestampInUtc\":\"2021-04-01T17:42:37Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":727559870,\"autoscaleSettings\":{\"maxThroughput\":344545687}}},\"location\":\"lidwcwvmzegjon\",\"tags\":{\"spzhzmtksjc\":\"irwgdnqzbrf\",\"lkeuac\":\"tdigsxcdglj\",\"dgycxnmskwhqjjy\":\"tomflrytswfpf\",\"dwqslsrhmpqvw\":\"lurlpshhkvp\"},\"identity\":{\"principalId\":\"ondcbrw\",\"tenantId\":\"uvqejosovyrrle\",\"type\":\"None\",\"userAssignedIdentities\":{\"dlvykfrex\":{\"principalId\":\"qtljqobbpihehc\",\"clientId\":\"ybmrqbrjbbmp\"}}},\"id\":\"s\",\"name\":\"qwjksghudgz\",\"type\":\"xog\"}],\"nextLink\":\"gsv\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"iwrqofulopmjnl\",\"_ts\":16.09947,\"_etag\":\"cbjpibkephuu\",\"id\":\"erctatoyin\",\"restoreParameters\":{\"restoreSource\":\"brlc\",\"restoreTimestampInUtc\":\"2020-12-20T16:54:51Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":1725097508,\"autoscaleSettings\":{\"maxThroughput\":1591492757}}},\"location\":\"rucvcrrpcjttbs\",\"tags\":{\"ghktuidvrm\":\"eaqnrmvvfkoxm\"},\"identity\":{\"principalId\":\"pdwwexymzvlazi\",\"tenantId\":\"hpwvqsgnyyuu\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"fhfv\":{\"principalId\":\"rpmey\",\"clientId\":\"pkpatlbijpzgsks\"},\"gbrt\":{\"principalId\":\"mknbnxwcdommpv\",\"clientId\":\"awz\"}}},\"id\":\"iac\",\"name\":\"kiexhajlfnthiq\",\"type\":\"yuttdiygbpvnwswm\"},{\"properties\":{\"resource\":{\"_rid\":\"ctwwgzw\",\"_ts\":5.5388927,\"_etag\":\"ecvo\",\"id\":\"ygzyvneezaifght\",\"restoreParameters\":{\"restoreSource\":\"qtlffhzbk\",\"restoreTimestampInUtc\":\"2021-06-18T18:40:18Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"},\"options\":{\"throughput\":1595321893,\"autoscaleSettings\":{\"maxThroughput\":441869182}}},\"location\":\"oe\",\"tags\":{\"jhqt\":\"giyetesypvidbz\",\"vnynkb\":\"b\"},\"identity\":{\"principalId\":\"njuhpsprkzya\",\"tenantId\":\"ia\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"tu\":{\"principalId\":\"bwqroohtuovm\",\"clientId\":\"nur\"},\"jxl\":{\"principalId\":\"hihpvecmsl\",\"clientId\":\"bl\"},\"eukdqkkyih\":{\"principalId\":\"sjuscvsfxigctmg\",\"clientId\":\"upbezqccydrt\"},\"waoaguhi\":{\"principalId\":\"geqmgqzgwldoych\",\"clientId\":\"lcecfeh\"}}},\"id\":\"llizs\",\"name\":\"ac\",\"type\":\"jvhrweft\"},{\"properties\":{\"resource\":{\"_rid\":\"jp\",\"_ts\":12.886447,\"_etag\":\"ehaepwamcxtc\",\"id\":\"hupeuknijduy\",\"restoreParameters\":{\"restoreSource\":\"pydjfboc\",\"restoreTimestampInUtc\":\"2021-01-30T00:30:57Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":1432323564,\"autoscaleSettings\":{\"maxThroughput\":1704635084}}},\"location\":\"hl\",\"tags\":{\"cdixmx\":\"flgbhgau\",\"sryjqgdkfno\":\"f\",\"vjhvefgwbm\":\"oeoq\",\"faymxbulpz\":\"jchnta\"},\"identity\":{\"principalId\":\"b\",\"tenantId\":\"kyojwyvfk\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"xqw\":{\"principalId\":\"hxsgxj\",\"clientId\":\"mzrrscubiwsdrn\"},\"mcyefoyzbam\":{\"principalId\":\"iffjxcjrm\",\"clientId\":\"abwibvjogjo\"}}},\"id\":\"neo\",\"name\":\"vfkakpold\",\"type\":\"vevboclzh\"}],\"nextLink\":\"knyuxgvttxpn\"}") .toObject(MongoDBDatabaseListResult.class); - Assertions.assertEquals("gsv", model.nextLink()); + Assertions.assertEquals("knyuxgvttxpn", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseResourceTests.java index 11b5ceb29b2c..e026feaadd34 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoDBDatabaseResourceTests.java @@ -15,11 +15,11 @@ public final class MongoDBDatabaseResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoDBDatabaseResource model = BinaryData.fromString( - "{\"id\":\"dlpukhpyrne\",\"restoreParameters\":{\"restoreSource\":\"cpeogkhnmgbrou\",\"restoreTimestampInUtc\":\"2021-02-15T01:41:05Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"}") + "{\"id\":\"x\",\"restoreParameters\":{\"restoreSource\":\"dcgdzbenribca\",\"restoreTimestampInUtc\":\"2021-07-11T04:51:02Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"}") .toObject(MongoDBDatabaseResource.class); - Assertions.assertEquals("dlpukhpyrne", model.id()); - Assertions.assertEquals("cpeogkhnmgbrou", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-15T01:41:05Z"), + Assertions.assertEquals("x", model.id()); + Assertions.assertEquals("dcgdzbenribca", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-11T04:51:02Z"), model.restoreParameters().restoreTimestampInUtc()); Assertions.assertFalse(model.restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.createMode()); @@ -27,15 +27,15 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MongoDBDatabaseResource model = new MongoDBDatabaseResource().withId("dlpukhpyrne") - .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("cpeogkhnmgbrou") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-02-15T01:41:05Z")) + MongoDBDatabaseResource model = new MongoDBDatabaseResource().withId("x") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("dcgdzbenribca") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-07-11T04:51:02Z")) .withRestoreWithTtlDisabled(false)) .withCreateMode(CreateMode.RESTORE); model = BinaryData.fromObject(model).toObject(MongoDBDatabaseResource.class); - Assertions.assertEquals("dlpukhpyrne", model.id()); - Assertions.assertEquals("cpeogkhnmgbrou", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-15T01:41:05Z"), + Assertions.assertEquals("x", model.id()); + Assertions.assertEquals("dcgdzbenribca", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-11T04:51:02Z"), model.restoreParameters().restoreTimestampInUtc()); Assertions.assertFalse(model.restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.createMode()); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoIndexOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoIndexOptionsTests.java index 86a5980e7c0d..7fde8054dade 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoIndexOptionsTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoIndexOptionsTests.java @@ -11,17 +11,17 @@ public final class MongoIndexOptionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MongoIndexOptions model = BinaryData.fromString("{\"expireAfterSeconds\":1960012272,\"unique\":true}") + MongoIndexOptions model = BinaryData.fromString("{\"expireAfterSeconds\":1054159255,\"unique\":true}") .toObject(MongoIndexOptions.class); - Assertions.assertEquals(1960012272, model.expireAfterSeconds()); + Assertions.assertEquals(1054159255, model.expireAfterSeconds()); Assertions.assertTrue(model.unique()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MongoIndexOptions model = new MongoIndexOptions().withExpireAfterSeconds(1960012272).withUnique(true); + MongoIndexOptions model = new MongoIndexOptions().withExpireAfterSeconds(1054159255).withUnique(true); model = BinaryData.fromObject(model).toObject(MongoIndexOptions.class); - Assertions.assertEquals(1960012272, model.expireAfterSeconds()); + Assertions.assertEquals(1054159255, model.expireAfterSeconds()); Assertions.assertTrue(model.unique()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleAssignmentListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleAssignmentListResultTests.java index 6f9c315e20a9..ef59cc988ca2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleAssignmentListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleAssignmentListResultTests.java @@ -12,11 +12,11 @@ public final class MongoMIRoleAssignmentListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoMIRoleAssignmentListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"roleDefinitionId\":\"ozkgyfpeoehg\",\"scope\":\"qmskkixv\",\"principalId\":\"jxplh\",\"provisioningState\":\"vasyntv\"},\"id\":\"yielb\",\"name\":\"rvvbqvknmpecqxg\",\"type\":\"qa\"},{\"properties\":{\"roleDefinitionId\":\"ubnsnstlpwq\",\"scope\":\"nxjkhtupsvyouw\",\"principalId\":\"iyxfwkztsmsfbevy\",\"provisioningState\":\"znfhkqytk\"},\"id\":\"adopgfzdgjfc\",\"name\":\"crsvloyyhi\",\"type\":\"qkzjuqwqaj\"}],\"nextLink\":\"zxpixhyo\"}") + "{\"value\":[{\"properties\":{\"roleDefinitionId\":\"mzqlnaag\",\"scope\":\"i\",\"principalId\":\"fqiywhxpsb\",\"provisioningState\":\"ialezaydpu\"},\"id\":\"degefxlieggoto\",\"name\":\"mhssfnwh\",\"type\":\"kahhec\"}],\"nextLink\":\"fmkcu\"}") .toObject(MongoMIRoleAssignmentListResult.class); - Assertions.assertEquals("ozkgyfpeoehg", model.value().get(0).roleDefinitionId()); - Assertions.assertEquals("qmskkixv", model.value().get(0).scope()); - Assertions.assertEquals("jxplh", model.value().get(0).principalId()); - Assertions.assertEquals("zxpixhyo", model.nextLink()); + Assertions.assertEquals("mzqlnaag", model.value().get(0).roleDefinitionId()); + Assertions.assertEquals("i", model.value().get(0).scope()); + Assertions.assertEquals("fqiywhxpsb", model.value().get(0).principalId()); + Assertions.assertEquals("fmkcu", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleAssignmentResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleAssignmentResourceInnerTests.java index 683cfca721d8..e26e1ebc60f5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleAssignmentResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleAssignmentResourceInnerTests.java @@ -12,22 +12,21 @@ public final class MongoMIRoleAssignmentResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoMIRoleAssignmentResourceInner model = BinaryData.fromString( - "{\"properties\":{\"roleDefinitionId\":\"tznxlu\",\"scope\":\"ujqbbgsimwejl\",\"principalId\":\"kbpjzobdwbcpra\",\"provisioningState\":\"kuhydtnaczkfwfat\"},\"id\":\"wphn\",\"name\":\"kivdwgtqcume\",\"type\":\"saaqgoq\"}") + "{\"properties\":{\"roleDefinitionId\":\"i\",\"scope\":\"ktqoze\",\"principalId\":\"rsrj\",\"provisioningState\":\"kbrauxboufq\"},\"id\":\"qbjxgjwsrerukbuu\",\"name\":\"ri\",\"type\":\"wkwkjxlaacedikqe\"}") .toObject(MongoMIRoleAssignmentResourceInner.class); - Assertions.assertEquals("tznxlu", model.roleDefinitionId()); - Assertions.assertEquals("ujqbbgsimwejl", model.scope()); - Assertions.assertEquals("kbpjzobdwbcpra", model.principalId()); + Assertions.assertEquals("i", model.roleDefinitionId()); + Assertions.assertEquals("ktqoze", model.scope()); + Assertions.assertEquals("rsrj", model.principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MongoMIRoleAssignmentResourceInner model - = new MongoMIRoleAssignmentResourceInner().withRoleDefinitionId("tznxlu") - .withScope("ujqbbgsimwejl") - .withPrincipalId("kbpjzobdwbcpra"); + MongoMIRoleAssignmentResourceInner model = new MongoMIRoleAssignmentResourceInner().withRoleDefinitionId("i") + .withScope("ktqoze") + .withPrincipalId("rsrj"); model = BinaryData.fromObject(model).toObject(MongoMIRoleAssignmentResourceInner.class); - Assertions.assertEquals("tznxlu", model.roleDefinitionId()); - Assertions.assertEquals("ujqbbgsimwejl", model.scope()); - Assertions.assertEquals("kbpjzobdwbcpra", model.principalId()); + Assertions.assertEquals("i", model.roleDefinitionId()); + Assertions.assertEquals("ktqoze", model.scope()); + Assertions.assertEquals("rsrj", model.principalId()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleAssignmentResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleAssignmentResourcePropertiesTests.java index 648d26e31d4f..54a3b4ff5193 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleAssignmentResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleAssignmentResourcePropertiesTests.java @@ -12,22 +12,22 @@ public final class MongoMIRoleAssignmentResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoMIRoleAssignmentResourceProperties model = BinaryData.fromString( - "{\"roleDefinitionId\":\"iuycsbskowk\",\"scope\":\"hzhrbkhtm\",\"principalId\":\"wiuasfg\",\"provisioningState\":\"ucyhfaimq\"}") + "{\"roleDefinitionId\":\"s\",\"scope\":\"zbevgbnrommkiqh\",\"principalId\":\"w\",\"provisioningState\":\"zyjj\"}") .toObject(MongoMIRoleAssignmentResourceProperties.class); - Assertions.assertEquals("iuycsbskowk", model.roleDefinitionId()); - Assertions.assertEquals("hzhrbkhtm", model.scope()); - Assertions.assertEquals("wiuasfg", model.principalId()); + Assertions.assertEquals("s", model.roleDefinitionId()); + Assertions.assertEquals("zbevgbnrommkiqh", model.scope()); + Assertions.assertEquals("w", model.principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MongoMIRoleAssignmentResourceProperties model - = new MongoMIRoleAssignmentResourceProperties().withRoleDefinitionId("iuycsbskowk") - .withScope("hzhrbkhtm") - .withPrincipalId("wiuasfg"); + = new MongoMIRoleAssignmentResourceProperties().withRoleDefinitionId("s") + .withScope("zbevgbnrommkiqh") + .withPrincipalId("w"); model = BinaryData.fromObject(model).toObject(MongoMIRoleAssignmentResourceProperties.class); - Assertions.assertEquals("iuycsbskowk", model.roleDefinitionId()); - Assertions.assertEquals("hzhrbkhtm", model.scope()); - Assertions.assertEquals("wiuasfg", model.principalId()); + Assertions.assertEquals("s", model.roleDefinitionId()); + Assertions.assertEquals("zbevgbnrommkiqh", model.scope()); + Assertions.assertEquals("w", model.principalId()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleDefinitionListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleDefinitionListResultTests.java index 28d9442d38fd..1c2485628959 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleDefinitionListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleDefinitionListResultTests.java @@ -13,15 +13,15 @@ public final class MongoMIRoleDefinitionListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoMIRoleDefinitionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"id\":\"p\",\"roleName\":\"iwifhbk\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"ohqcl\",\"aihtgsiqikvllrh\"],\"permissions\":[{\"id\":\"lxkoi\",\"dataActions\":[\"rawrqkzawbunmp\",\"klwzlw\",\"epr\"],\"notDataActions\":[\"zltkaszfj\",\"xscbduxapgrcqe\",\"mvrdjomlnwsbv\"]}]},\"id\":\"lsflxk\",\"name\":\"esdfedsb\",\"type\":\"zancoinmp\"},{\"properties\":{\"id\":\"cqidkltvdhqnufbx\",\"roleName\":\"iibntojo\",\"type\":\"CustomRole\",\"assignableScopes\":[\"y\",\"hu\"],\"permissions\":[{\"id\":\"uwudhuaor\",\"dataActions\":[\"ehwvumosqirc\",\"mqprlobru\",\"ejcvjkjyczcmta\",\"elajdyol\"],\"notDataActions\":[\"yxqfmzsizzhravr\"]},{\"id\":\"kjymgqbgcxh\",\"dataActions\":[\"gzxlermkmerghski\",\"hnp\",\"pkcbkfukdljq\"],\"notDataActions\":[\"sdydshkp\",\"fyaloowwzizzny\"]}]},\"id\":\"pqzstifgufyjf\",\"name\":\"kqiyvnd\",\"type\":\"okgw\"}],\"nextLink\":\"ymzqhrqpfzl\"}") + "{\"value\":[{\"properties\":{\"id\":\"ggchxvlqgf\",\"roleName\":\"vecic\",\"type\":\"CustomRole\",\"assignableScopes\":[\"irlzbipiunn\"],\"permissions\":[{\"id\":\"zzzkuer\",\"dataActions\":[\"jomipvw\",\"a\",\"jttwykoxv\",\"wofxxdplrel\"],\"notDataActions\":[\"gahcbt\"]},{\"id\":\"lbpxrhrfjenrazwe\",\"dataActions\":[\"tlhqas\",\"tostjixyzsecig\"],\"notDataActions\":[\"wjtacfvv\",\"dp\",\"bpzfomcsaugbrh\"]},{\"id\":\"wltkfysuntethklx\",\"dataActions\":[\"vasyyhgqok\",\"bmsrkix\"],\"notDataActions\":[\"hw\"]}]},\"id\":\"qomaqsyilpzzbrw\",\"name\":\"rzozsxagyso\",\"type\":\"liiksybv\"},{\"properties\":{\"id\":\"nhylsbhujcy\",\"roleName\":\"llmxvpstiz\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"ql\"],\"permissions\":[{\"id\":\"vaidy\",\"dataActions\":[\"htrrqwfy\"],\"notDataActions\":[\"t\",\"jjrnogykugdlavsa\"]},{\"id\":\"thkslgeuufkb\",\"dataActions\":[\"bxjblajybdnb\",\"csbto\",\"sazdjmofsvpz\",\"gnywxu\"],\"notDataActions\":[\"fj\"]}]},\"id\":\"gwtmszcf\",\"name\":\"zqpeqr\",\"type\":\"gfurdpagknx\"},{\"properties\":{\"id\":\"vrgihl\",\"roleName\":\"ffew\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"jcgeipqxxsdyaf\",\"tydsmm\"],\"permissions\":[{\"id\":\"clejqzhpv\",\"dataActions\":[\"badjze\",\"llgfy\",\"gtqscjpvqerq\"],\"notDataActions\":[\"mwdz\",\"zlhcu\"]}]},\"id\":\"lqpwwvmb\",\"name\":\"ecfwlbghnkfrw\",\"type\":\"oh\"}],\"nextLink\":\"dsnjzpchiypb\"}") .toObject(MongoMIRoleDefinitionListResult.class); - Assertions.assertEquals("p", model.value().get(0).idPropertiesId()); - Assertions.assertEquals("iwifhbk", model.value().get(0).roleName()); - Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.value().get(0).typePropertiesType()); - Assertions.assertEquals("ohqcl", model.value().get(0).assignableScopes().get(0)); - Assertions.assertEquals("lxkoi", model.value().get(0).permissions().get(0).id()); - Assertions.assertEquals("rawrqkzawbunmp", model.value().get(0).permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("zltkaszfj", model.value().get(0).permissions().get(0).notDataActions().get(0)); - Assertions.assertEquals("ymzqhrqpfzl", model.nextLink()); + Assertions.assertEquals("ggchxvlqgf", model.value().get(0).idPropertiesId()); + Assertions.assertEquals("vecic", model.value().get(0).roleName()); + Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.value().get(0).typePropertiesType()); + Assertions.assertEquals("irlzbipiunn", model.value().get(0).assignableScopes().get(0)); + Assertions.assertEquals("zzzkuer", model.value().get(0).permissions().get(0).id()); + Assertions.assertEquals("jomipvw", model.value().get(0).permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("gahcbt", model.value().get(0).permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("dsnjzpchiypb", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleDefinitionResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleDefinitionResourceInnerTests.java index 1c09764d5703..cb2f972d7f7f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleDefinitionResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleDefinitionResourceInnerTests.java @@ -15,42 +15,43 @@ public final class MongoMIRoleDefinitionResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoMIRoleDefinitionResourceInner model = BinaryData.fromString( - "{\"properties\":{\"id\":\"ctr\",\"roleName\":\"dsxebuhsxrz\",\"type\":\"CustomRole\",\"assignableScopes\":[\"al\",\"yckhefrbhseue\"],\"permissions\":[{\"id\":\"xebjl\",\"dataActions\":[\"aytujraxdtpryjm\",\"tnsewou\",\"ly\",\"s\"],\"notDataActions\":[\"ljurkeposehqqylm\",\"ctwjwdsdlzm\",\"xerxxxoteehk\",\"owgomvvhxowp\"]},{\"id\":\"apnpxraqawbmp\",\"dataActions\":[\"eylqlocvvujexayg\"],\"notDataActions\":[\"kgjn\",\"zpaslavxjfiuo\",\"pieidzlvssqy\",\"jopackyhydv\"]},{\"id\":\"mfngpmillxgjsci\",\"dataActions\":[\"soriobijeiydyeu\",\"nhbokayrgwybrio\",\"dweoftnorwaigsi\"],\"notDataActions\":[\"qkmv\",\"a\",\"xvzfffhtjnwos\"]},{\"id\":\"fjxtvlxxzqfc\",\"dataActions\":[\"iomxeezw\",\"hjmbji\",\"egmxdbsohc\"],\"notDataActions\":[\"yvdkgdetszw\",\"anzbjekwuyckyvn\",\"nsm\"]}]},\"id\":\"fiwjbctvbp\",\"name\":\"ujqjtotdxp\",\"type\":\"scsl\"}") + "{\"properties\":{\"id\":\"grh\",\"roleName\":\"tslgsazuqznghx\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"jsdkpvnrvzwpffxs\"],\"permissions\":[{\"id\":\"tmveho\",\"dataActions\":[\"yuvbgtzqzqweu\",\"dybnairvhpqsvb\",\"eoge\",\"trcnqnvnc\"],\"notDataActions\":[\"csjvjnkoiznzsqbi\",\"aaugic\"]},{\"id\":\"jtmvwrmjxyvuo\",\"dataActions\":[\"czbassqfyylwpp\",\"ygkbzb\"],\"notDataActions\":[\"sybxhqvov\",\"pmhttuvsqjsrvjnq\",\"aqg\",\"qbfkceincnrecjbi\"]},{\"id\":\"evsfgdrmnsz\",\"dataActions\":[\"mjsqsvzvm\",\"t\",\"wghndaevhgs\"],\"notDataActions\":[\"vgseuf\"]},{\"id\":\"v\",\"dataActions\":[\"uz\",\"ilmciwu\"],\"notDataActions\":[\"ekypyovljl\",\"zdlbybpaxhpz\",\"s\",\"v\"]}]},\"id\":\"wbh\",\"name\":\"nzgesfhs\",\"type\":\"ag\"}") .toObject(MongoMIRoleDefinitionResourceInner.class); - Assertions.assertEquals("ctr", model.idPropertiesId()); - Assertions.assertEquals("dsxebuhsxrz", model.roleName()); - Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.typePropertiesType()); - Assertions.assertEquals("al", model.assignableScopes().get(0)); - Assertions.assertEquals("xebjl", model.permissions().get(0).id()); - Assertions.assertEquals("aytujraxdtpryjm", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("ljurkeposehqqylm", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("grh", model.idPropertiesId()); + Assertions.assertEquals("tslgsazuqznghx", model.roleName()); + Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.typePropertiesType()); + Assertions.assertEquals("jsdkpvnrvzwpffxs", model.assignableScopes().get(0)); + Assertions.assertEquals("tmveho", model.permissions().get(0).id()); + Assertions.assertEquals("yuvbgtzqzqweu", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("csjvjnkoiznzsqbi", model.permissions().get(0).notDataActions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MongoMIRoleDefinitionResourceInner model = new MongoMIRoleDefinitionResourceInner().withIdPropertiesId("ctr") - .withRoleName("dsxebuhsxrz") - .withTypePropertiesType(RoleDefinitionType.CUSTOM_ROLE) - .withAssignableScopes(Arrays.asList("al", "yckhefrbhseue")) - .withPermissions(Arrays.asList(new Permission().withId("xebjl") - .withDataActions(Arrays.asList("aytujraxdtpryjm", "tnsewou", "ly", "s")) - .withNotDataActions(Arrays.asList("ljurkeposehqqylm", "ctwjwdsdlzm", "xerxxxoteehk", "owgomvvhxowp")), - new Permission().withId("apnpxraqawbmp") - .withDataActions(Arrays.asList("eylqlocvvujexayg")) - .withNotDataActions(Arrays.asList("kgjn", "zpaslavxjfiuo", "pieidzlvssqy", "jopackyhydv")), - new Permission().withId("mfngpmillxgjsci") - .withDataActions(Arrays.asList("soriobijeiydyeu", "nhbokayrgwybrio", "dweoftnorwaigsi")) - .withNotDataActions(Arrays.asList("qkmv", "a", "xvzfffhtjnwos")), - new Permission().withId("fjxtvlxxzqfc") - .withDataActions(Arrays.asList("iomxeezw", "hjmbji", "egmxdbsohc")) - .withNotDataActions(Arrays.asList("yvdkgdetszw", "anzbjekwuyckyvn", "nsm")))); + MongoMIRoleDefinitionResourceInner model = new MongoMIRoleDefinitionResourceInner().withIdPropertiesId("grh") + .withRoleName("tslgsazuqznghx") + .withTypePropertiesType(RoleDefinitionType.BUILT_IN_ROLE) + .withAssignableScopes(Arrays.asList("jsdkpvnrvzwpffxs")) + .withPermissions(Arrays.asList( + new Permission().withId("tmveho") + .withDataActions(Arrays.asList("yuvbgtzqzqweu", "dybnairvhpqsvb", "eoge", "trcnqnvnc")) + .withNotDataActions(Arrays.asList("csjvjnkoiznzsqbi", "aaugic")), + new Permission().withId("jtmvwrmjxyvuo") + .withDataActions(Arrays.asList("czbassqfyylwpp", "ygkbzb")) + .withNotDataActions(Arrays.asList("sybxhqvov", "pmhttuvsqjsrvjnq", "aqg", "qbfkceincnrecjbi")), + new Permission().withId("evsfgdrmnsz") + .withDataActions(Arrays.asList("mjsqsvzvm", "t", "wghndaevhgs")) + .withNotDataActions(Arrays.asList("vgseuf")), + new Permission().withId("v") + .withDataActions(Arrays.asList("uz", "ilmciwu")) + .withNotDataActions(Arrays.asList("ekypyovljl", "zdlbybpaxhpz", "s", "v")))); model = BinaryData.fromObject(model).toObject(MongoMIRoleDefinitionResourceInner.class); - Assertions.assertEquals("ctr", model.idPropertiesId()); - Assertions.assertEquals("dsxebuhsxrz", model.roleName()); - Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.typePropertiesType()); - Assertions.assertEquals("al", model.assignableScopes().get(0)); - Assertions.assertEquals("xebjl", model.permissions().get(0).id()); - Assertions.assertEquals("aytujraxdtpryjm", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("ljurkeposehqqylm", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("grh", model.idPropertiesId()); + Assertions.assertEquals("tslgsazuqznghx", model.roleName()); + Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.typePropertiesType()); + Assertions.assertEquals("jsdkpvnrvzwpffxs", model.assignableScopes().get(0)); + Assertions.assertEquals("tmveho", model.permissions().get(0).id()); + Assertions.assertEquals("yuvbgtzqzqweu", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("csjvjnkoiznzsqbi", model.permissions().get(0).notDataActions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleDefinitionResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleDefinitionResourcePropertiesTests.java index 6ca4eccc2d05..ce3e46640a2a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleDefinitionResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoMIRoleDefinitionResourcePropertiesTests.java @@ -15,38 +15,44 @@ public final class MongoMIRoleDefinitionResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoMIRoleDefinitionResourceProperties model = BinaryData.fromString( - "{\"id\":\"uusiecktybh\",\"roleName\":\"xidhhxomil\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"d\"],\"permissions\":[{\"id\":\"jwi\",\"dataActions\":[\"rslaatep\",\"wuj\"],\"notDataActions\":[\"xqgqwlxrhgtvhv\",\"qqy\",\"bkkteo\",\"ejogmkor\"]},{\"id\":\"m\",\"dataActions\":[\"ofnqhlbs\"],\"notDataActions\":[\"nqliwkmzoj\",\"etyalht\",\"mknazgbjbhrpgiq\",\"ttcucrcm\"]}]}") + "{\"id\":\"hnezpbyfyv\",\"roleName\":\"pmggqgagenvqbug\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"foizorbloejz\"],\"permissions\":[{\"id\":\"gkqwvde\",\"dataActions\":[\"naphifkfrpmpl\",\"bpebrmj\"],\"notDataActions\":[\"p\",\"htbttpkimskhnkkh\",\"ykrsm\"]},{\"id\":\"cmelycpgokut\",\"dataActions\":[\"ybnzbnvmsh\",\"uzzlapyixlvzcgul\",\"ebxiauqsuptessj\",\"wjt\"],\"notDataActions\":[\"vblskxg\"]},{\"id\":\"a\",\"dataActions\":[\"slkvcvwp\",\"l\",\"jbvyezjwjkqo\"],\"notDataActions\":[\"hiieyozvr\",\"wfpucwnbcgqe\",\"gzjvbxqcbgoa\"]},{\"id\":\"tuuciagvkd\",\"dataActions\":[\"duklbjoafm\",\"fex\",\"lvoepknarse\"],\"notDataActions\":[\"csqoacbuqdgs\",\"pleqfgkxenvszglv\",\"akeszsuuvul\"]}]}") .toObject(MongoMIRoleDefinitionResourceProperties.class); - Assertions.assertEquals("uusiecktybh", model.id()); - Assertions.assertEquals("xidhhxomil", model.roleName()); + Assertions.assertEquals("hnezpbyfyv", model.id()); + Assertions.assertEquals("pmggqgagenvqbug", model.roleName()); Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.type()); - Assertions.assertEquals("d", model.assignableScopes().get(0)); - Assertions.assertEquals("jwi", model.permissions().get(0).id()); - Assertions.assertEquals("rslaatep", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("xqgqwlxrhgtvhv", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("foizorbloejz", model.assignableScopes().get(0)); + Assertions.assertEquals("gkqwvde", model.permissions().get(0).id()); + Assertions.assertEquals("naphifkfrpmpl", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("p", model.permissions().get(0).notDataActions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MongoMIRoleDefinitionResourceProperties model - = new MongoMIRoleDefinitionResourceProperties().withId("uusiecktybh") - .withRoleName("xidhhxomil") + = new MongoMIRoleDefinitionResourceProperties().withId("hnezpbyfyv") + .withRoleName("pmggqgagenvqbug") .withType(RoleDefinitionType.BUILT_IN_ROLE) - .withAssignableScopes(Arrays.asList("d")) + .withAssignableScopes(Arrays.asList("foizorbloejz")) .withPermissions(Arrays.asList( - new Permission().withId("jwi") - .withDataActions(Arrays.asList("rslaatep", "wuj")) - .withNotDataActions(Arrays.asList("xqgqwlxrhgtvhv", "qqy", "bkkteo", "ejogmkor")), - new Permission().withId("m") - .withDataActions(Arrays.asList("ofnqhlbs")) - .withNotDataActions(Arrays.asList("nqliwkmzoj", "etyalht", "mknazgbjbhrpgiq", "ttcucrcm")))); + new Permission().withId("gkqwvde") + .withDataActions(Arrays.asList("naphifkfrpmpl", "bpebrmj")) + .withNotDataActions(Arrays.asList("p", "htbttpkimskhnkkh", "ykrsm")), + new Permission().withId("cmelycpgokut") + .withDataActions(Arrays.asList("ybnzbnvmsh", "uzzlapyixlvzcgul", "ebxiauqsuptessj", "wjt")) + .withNotDataActions(Arrays.asList("vblskxg")), + new Permission().withId("a") + .withDataActions(Arrays.asList("slkvcvwp", "l", "jbvyezjwjkqo")) + .withNotDataActions(Arrays.asList("hiieyozvr", "wfpucwnbcgqe", "gzjvbxqcbgoa")), + new Permission().withId("tuuciagvkd") + .withDataActions(Arrays.asList("duklbjoafm", "fex", "lvoepknarse")) + .withNotDataActions(Arrays.asList("csqoacbuqdgs", "pleqfgkxenvszglv", "akeszsuuvul")))); model = BinaryData.fromObject(model).toObject(MongoMIRoleDefinitionResourceProperties.class); - Assertions.assertEquals("uusiecktybh", model.id()); - Assertions.assertEquals("xidhhxomil", model.roleName()); + Assertions.assertEquals("hnezpbyfyv", model.id()); + Assertions.assertEquals("pmggqgagenvqbug", model.roleName()); Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.type()); - Assertions.assertEquals("d", model.assignableScopes().get(0)); - Assertions.assertEquals("jwi", model.permissions().get(0).id()); - Assertions.assertEquals("rslaatep", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("xqgqwlxrhgtvhv", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("foizorbloejz", model.assignableScopes().get(0)); + Assertions.assertEquals("gkqwvde", model.permissions().get(0).id()); + Assertions.assertEquals("naphifkfrpmpl", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("p", model.permissions().get(0).notDataActions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRUToMongoRUCopyJobPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRUToMongoRUCopyJobPropertiesTests.java new file mode 100644 index 000000000000..8481c15d9eae --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRUToMongoRUCopyJobPropertiesTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CosmosDBMongoCollection; +import com.azure.resourcemanager.cosmos.models.CosmosDBSourceSinkDetails; +import com.azure.resourcemanager.cosmos.models.MongoRUToMongoRUCopyJobProperties; +import com.azure.resourcemanager.cosmos.models.MongoRUToMongoRUCopyJobTask; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MongoRUToMongoRUCopyJobPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MongoRUToMongoRUCopyJobProperties model = BinaryData.fromString( + "{\"jobType\":\"MongoRUToMongoRU\",\"sourceDetails\":{\"remoteAccountName\":\"v\"},\"destinationDetails\":{\"remoteAccountName\":\"c\"},\"tasks\":[{\"source\":{\"databaseName\":\"y\",\"collectionName\":\"hyrnxxmu\"},\"destination\":{\"databaseName\":\"edndr\",\"collectionName\":\"v\"},\"totalCount\":3986326733214005817,\"processedCount\":3301219158336825133},{\"source\":{\"databaseName\":\"chea\",\"collectionName\":\"mfmtdaaygdvw\"},\"destination\":{\"databaseName\":\"gpiohgwxrtfudxe\",\"collectionName\":\"xg\"},\"totalCount\":2932477024589855825,\"processedCount\":8204459365601972318}]}") + .toObject(MongoRUToMongoRUCopyJobProperties.class); + Assertions.assertEquals("v", model.sourceDetails().remoteAccountName()); + Assertions.assertEquals("c", model.destinationDetails().remoteAccountName()); + Assertions.assertEquals("y", model.tasks().get(0).source().databaseName()); + Assertions.assertEquals("hyrnxxmu", model.tasks().get(0).source().collectionName()); + Assertions.assertEquals("edndr", model.tasks().get(0).destination().databaseName()); + Assertions.assertEquals("v", model.tasks().get(0).destination().collectionName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MongoRUToMongoRUCopyJobProperties model + = new MongoRUToMongoRUCopyJobProperties() + .withSourceDetails(new CosmosDBSourceSinkDetails().withRemoteAccountName("v")) + .withDestinationDetails(new CosmosDBSourceSinkDetails().withRemoteAccountName("c")) + .withTasks(Arrays.asList(new MongoRUToMongoRUCopyJobTask() + .withSource(new CosmosDBMongoCollection().withDatabaseName("y").withCollectionName("hyrnxxmu")) + .withDestination(new CosmosDBMongoCollection().withDatabaseName("edndr").withCollectionName("v")), + new MongoRUToMongoRUCopyJobTask() + .withSource( + new CosmosDBMongoCollection().withDatabaseName("chea").withCollectionName("mfmtdaaygdvw")) + .withDestination(new CosmosDBMongoCollection().withDatabaseName("gpiohgwxrtfudxe") + .withCollectionName("xg")))); + model = BinaryData.fromObject(model).toObject(MongoRUToMongoRUCopyJobProperties.class); + Assertions.assertEquals("v", model.sourceDetails().remoteAccountName()); + Assertions.assertEquals("c", model.destinationDetails().remoteAccountName()); + Assertions.assertEquals("y", model.tasks().get(0).source().databaseName()); + Assertions.assertEquals("hyrnxxmu", model.tasks().get(0).source().collectionName()); + Assertions.assertEquals("edndr", model.tasks().get(0).destination().databaseName()); + Assertions.assertEquals("v", model.tasks().get(0).destination().collectionName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRUToMongoRUCopyJobTaskTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRUToMongoRUCopyJobTaskTests.java new file mode 100644 index 000000000000..aadf8f7d69f5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRUToMongoRUCopyJobTaskTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CosmosDBMongoCollection; +import com.azure.resourcemanager.cosmos.models.MongoRUToMongoRUCopyJobTask; +import org.junit.jupiter.api.Assertions; + +public final class MongoRUToMongoRUCopyJobTaskTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MongoRUToMongoRUCopyJobTask model = BinaryData.fromString( + "{\"source\":{\"databaseName\":\"mnpkukghimdblxg\",\"collectionName\":\"imfnjhfjx\"},\"destination\":{\"databaseName\":\"mszkkfo\",\"collectionName\":\"rey\"},\"totalCount\":2234038582671997054,\"processedCount\":7080556178524665851}") + .toObject(MongoRUToMongoRUCopyJobTask.class); + Assertions.assertEquals("mnpkukghimdblxg", model.source().databaseName()); + Assertions.assertEquals("imfnjhfjx", model.source().collectionName()); + Assertions.assertEquals("mszkkfo", model.destination().databaseName()); + Assertions.assertEquals("rey", model.destination().collectionName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MongoRUToMongoRUCopyJobTask model = new MongoRUToMongoRUCopyJobTask() + .withSource( + new CosmosDBMongoCollection().withDatabaseName("mnpkukghimdblxg").withCollectionName("imfnjhfjx")) + .withDestination(new CosmosDBMongoCollection().withDatabaseName("mszkkfo").withCollectionName("rey")); + model = BinaryData.fromObject(model).toObject(MongoRUToMongoRUCopyJobTask.class); + Assertions.assertEquals("mnpkukghimdblxg", model.source().databaseName()); + Assertions.assertEquals("imfnjhfjx", model.source().collectionName()); + Assertions.assertEquals("mszkkfo", model.destination().databaseName()); + Assertions.assertEquals("rey", model.destination().collectionName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRUToMongoVCoreCopyJobTaskTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRUToMongoVCoreCopyJobTaskTests.java new file mode 100644 index 000000000000..74524402fc11 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRUToMongoVCoreCopyJobTaskTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CosmosDBMongoCollection; +import com.azure.resourcemanager.cosmos.models.CosmosDBMongoVCoreCollection; +import com.azure.resourcemanager.cosmos.models.MongoRUToMongoVCoreCopyJobTask; +import org.junit.jupiter.api.Assertions; + +public final class MongoRUToMongoVCoreCopyJobTaskTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MongoRUToMongoVCoreCopyJobTask model = BinaryData.fromString( + "{\"source\":{\"databaseName\":\"cktqumiekkezzi\",\"collectionName\":\"hlyfjhdgqgg\"},\"destination\":{\"databaseName\":\"bdunygaeqid\",\"collectionName\":\"qfatpxllrxcyjm\"},\"totalCount\":8763898175289325999,\"processedCount\":254698639474854306}") + .toObject(MongoRUToMongoVCoreCopyJobTask.class); + Assertions.assertEquals("cktqumiekkezzi", model.source().databaseName()); + Assertions.assertEquals("hlyfjhdgqgg", model.source().collectionName()); + Assertions.assertEquals("bdunygaeqid", model.destination().databaseName()); + Assertions.assertEquals("qfatpxllrxcyjm", model.destination().collectionName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MongoRUToMongoVCoreCopyJobTask model = new MongoRUToMongoVCoreCopyJobTask() + .withSource( + new CosmosDBMongoCollection().withDatabaseName("cktqumiekkezzi").withCollectionName("hlyfjhdgqgg")) + .withDestination(new CosmosDBMongoVCoreCollection().withDatabaseName("bdunygaeqid") + .withCollectionName("qfatpxllrxcyjm")); + model = BinaryData.fromObject(model).toObject(MongoRUToMongoVCoreCopyJobTask.class); + Assertions.assertEquals("cktqumiekkezzi", model.source().databaseName()); + Assertions.assertEquals("hlyfjhdgqgg", model.source().collectionName()); + Assertions.assertEquals("bdunygaeqid", model.destination().databaseName()); + Assertions.assertEquals("qfatpxllrxcyjm", model.destination().collectionName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionCreateUpdateParametersTests.java index 5371bb734d71..95388e04703c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionCreateUpdateParametersTests.java @@ -17,43 +17,38 @@ public final class MongoRoleDefinitionCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoRoleDefinitionCreateUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"roleName\":\"igeleohd\",\"type\":\"CustomRole\",\"databaseName\":\"wzkjopwbeonrlkw\",\"privileges\":[{\"resource\":{\"db\":\"x\",\"collection\":\"akxcptsoqfyiaseq\"},\"actions\":[\"rttzrazisgykiu\"]},{\"resource\":{\"db\":\"anbwzohmnrxxbso\",\"collection\":\"linhmdptysprqs\"},\"actions\":[\"xojpslsvjgp\",\"iufiqwo\",\"xqvapcohh\"]},{\"resource\":{\"db\":\"qpqojxcxzrzd\",\"collection\":\"dzbenri\"},\"actions\":[\"wetzqddtjwfljh\",\"namtuatmzw\"]}],\"roles\":[{\"db\":\"cqtjzmi\",\"role\":\"gbgatzuuvbxn\"},{\"db\":\"ebwgga\",\"role\":\"tzlswvaj\"},{\"db\":\"utlxjoqzasunwqrj\",\"role\":\"rg\"}]}}") + "{\"properties\":{\"roleName\":\"rsxaptefh\",\"type\":\"CustomRole\",\"databaseName\":\"jokjl\",\"privileges\":[{\"resource\":{\"db\":\"qjbek\",\"collection\":\"eksnbksdqhjvyk\"},\"actions\":[\"sl\"]}],\"roles\":[{\"db\":\"stcpoqmavnwqjw\",\"role\":\"knlejjjkxybwfd\"},{\"db\":\"jbzten\",\"role\":\"kzykjtjk\"},{\"db\":\"xfwush\",\"role\":\"pkupnq\"},{\"db\":\"gjfbpkuwxeoi\",\"role\":\"fiz\"}]}}") .toObject(MongoRoleDefinitionCreateUpdateParameters.class); - Assertions.assertEquals("igeleohd", model.roleName()); + Assertions.assertEquals("rsxaptefh", model.roleName()); Assertions.assertEquals(MongoRoleDefinitionType.CUSTOM_ROLE, model.type()); - Assertions.assertEquals("wzkjopwbeonrlkw", model.databaseName()); - Assertions.assertEquals("x", model.privileges().get(0).resource().db()); - Assertions.assertEquals("akxcptsoqfyiaseq", model.privileges().get(0).resource().collection()); - Assertions.assertEquals("rttzrazisgykiu", model.privileges().get(0).actions().get(0)); - Assertions.assertEquals("cqtjzmi", model.roles().get(0).db()); - Assertions.assertEquals("gbgatzuuvbxn", model.roles().get(0).role()); + Assertions.assertEquals("jokjl", model.databaseName()); + Assertions.assertEquals("qjbek", model.privileges().get(0).resource().db()); + Assertions.assertEquals("eksnbksdqhjvyk", model.privileges().get(0).resource().collection()); + Assertions.assertEquals("sl", model.privileges().get(0).actions().get(0)); + Assertions.assertEquals("stcpoqmavnwqjw", model.roles().get(0).db()); + Assertions.assertEquals("knlejjjkxybwfd", model.roles().get(0).role()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MongoRoleDefinitionCreateUpdateParameters model = new MongoRoleDefinitionCreateUpdateParameters() - .withRoleName("igeleohd") - .withType(MongoRoleDefinitionType.CUSTOM_ROLE) - .withDatabaseName("wzkjopwbeonrlkw") - .withPrivileges(Arrays.asList( - new Privilege().withResource(new PrivilegeResource().withDb("x").withCollection("akxcptsoqfyiaseq")) - .withActions(Arrays.asList("rttzrazisgykiu")), - new Privilege() - .withResource(new PrivilegeResource().withDb("anbwzohmnrxxbso").withCollection("linhmdptysprqs")) - .withActions(Arrays.asList("xojpslsvjgp", "iufiqwo", "xqvapcohh")), - new Privilege().withResource(new PrivilegeResource().withDb("qpqojxcxzrzd").withCollection("dzbenri")) - .withActions(Arrays.asList("wetzqddtjwfljh", "namtuatmzw")))) - .withRoles(Arrays.asList(new Role().withDb("cqtjzmi").withRole("gbgatzuuvbxn"), - new Role().withDb("ebwgga").withRole("tzlswvaj"), - new Role().withDb("utlxjoqzasunwqrj").withRole("rg"))); + MongoRoleDefinitionCreateUpdateParameters model + = new MongoRoleDefinitionCreateUpdateParameters().withRoleName("rsxaptefh") + .withType(MongoRoleDefinitionType.CUSTOM_ROLE) + .withDatabaseName("jokjl") + .withPrivileges(Arrays.asList(new Privilege() + .withResource(new PrivilegeResource().withDb("qjbek").withCollection("eksnbksdqhjvyk")) + .withActions(Arrays.asList("sl")))) + .withRoles(Arrays.asList(new Role().withDb("stcpoqmavnwqjw").withRole("knlejjjkxybwfd"), + new Role().withDb("jbzten").withRole("kzykjtjk"), new Role().withDb("xfwush").withRole("pkupnq"), + new Role().withDb("gjfbpkuwxeoi").withRole("fiz"))); model = BinaryData.fromObject(model).toObject(MongoRoleDefinitionCreateUpdateParameters.class); - Assertions.assertEquals("igeleohd", model.roleName()); + Assertions.assertEquals("rsxaptefh", model.roleName()); Assertions.assertEquals(MongoRoleDefinitionType.CUSTOM_ROLE, model.type()); - Assertions.assertEquals("wzkjopwbeonrlkw", model.databaseName()); - Assertions.assertEquals("x", model.privileges().get(0).resource().db()); - Assertions.assertEquals("akxcptsoqfyiaseq", model.privileges().get(0).resource().collection()); - Assertions.assertEquals("rttzrazisgykiu", model.privileges().get(0).actions().get(0)); - Assertions.assertEquals("cqtjzmi", model.roles().get(0).db()); - Assertions.assertEquals("gbgatzuuvbxn", model.roles().get(0).role()); + Assertions.assertEquals("jokjl", model.databaseName()); + Assertions.assertEquals("qjbek", model.privileges().get(0).resource().db()); + Assertions.assertEquals("eksnbksdqhjvyk", model.privileges().get(0).resource().collection()); + Assertions.assertEquals("sl", model.privileges().get(0).actions().get(0)); + Assertions.assertEquals("stcpoqmavnwqjw", model.roles().get(0).db()); + Assertions.assertEquals("knlejjjkxybwfd", model.roles().get(0).role()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionGetResultsInnerTests.java index 692b072998a4..a70a3289350c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionGetResultsInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionGetResultsInnerTests.java @@ -13,15 +13,15 @@ public final class MongoRoleDefinitionGetResultsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoRoleDefinitionGetResultsInner model = BinaryData.fromString( - "{\"properties\":{\"roleName\":\"vcisiz\",\"type\":\"BuiltInRole\",\"databaseName\":\"dsxjwuivedw\",\"privileges\":[{\"resource\":{\"db\":\"wxeiqbpsmgomg\",\"collection\":\"mljdlrgmsplzga\"},\"actions\":[\"shhvnewgnxky\",\"pqanxrjkix\"]}],\"roles\":[{\"db\":\"aoypny\",\"role\":\"shxcylhkg\"}]},\"id\":\"sghpx\",\"name\":\"cphdrwjjkhvyo\",\"type\":\"ac\"}") + "{\"properties\":{\"roleName\":\"sczuejdtxptlghwz\",\"type\":\"CustomRole\",\"databaseName\":\"wjjstliuhqa\",\"privileges\":[{\"resource\":{\"db\":\"ancz\",\"collection\":\"odrrslblxyd\"},\"actions\":[\"xvv\",\"xiwkgfbql\"]},{\"resource\":{\"db\":\"khychocokulehur\",\"collection\":\"rqffaweyurk\"},\"actions\":[\"jdxravjuqdbrx\"]},{\"resource\":{\"db\":\"chbapxkiy\",\"collection\":\"j\"},\"actions\":[\"jbuscg\"]},{\"resource\":{\"db\":\"sioycblevpmcl\",\"collection\":\"yxkyxlz\"},\"actions\":[\"gkzz\"]}],\"roles\":[{\"db\":\"hbzffovwmbjlzqs\",\"role\":\"pgvdwnapfdqw\"},{\"db\":\"ftptnuwj\",\"role\":\"sch\"}]},\"id\":\"gqy\",\"name\":\"leseyqrhvyeldo\",\"type\":\"jv\"}") .toObject(MongoRoleDefinitionGetResultsInner.class); - Assertions.assertEquals("vcisiz", model.roleName()); - Assertions.assertEquals(MongoRoleDefinitionType.BUILT_IN_ROLE, model.typePropertiesType()); - Assertions.assertEquals("dsxjwuivedw", model.databaseName()); - Assertions.assertEquals("wxeiqbpsmgomg", model.privileges().get(0).resource().db()); - Assertions.assertEquals("mljdlrgmsplzga", model.privileges().get(0).resource().collection()); - Assertions.assertEquals("shhvnewgnxky", model.privileges().get(0).actions().get(0)); - Assertions.assertEquals("aoypny", model.roles().get(0).db()); - Assertions.assertEquals("shxcylhkg", model.roles().get(0).role()); + Assertions.assertEquals("sczuejdtxptlghwz", model.roleName()); + Assertions.assertEquals(MongoRoleDefinitionType.CUSTOM_ROLE, model.typePropertiesType()); + Assertions.assertEquals("wjjstliuhqa", model.databaseName()); + Assertions.assertEquals("ancz", model.privileges().get(0).resource().db()); + Assertions.assertEquals("odrrslblxyd", model.privileges().get(0).resource().collection()); + Assertions.assertEquals("xvv", model.privileges().get(0).actions().get(0)); + Assertions.assertEquals("hbzffovwmbjlzqs", model.roles().get(0).db()); + Assertions.assertEquals("pgvdwnapfdqw", model.roles().get(0).role()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionListResultTests.java index ae65730803d7..867170bffbdd 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionListResultTests.java @@ -12,8 +12,8 @@ public final class MongoRoleDefinitionListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoRoleDefinitionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"roleName\":\"cmbuocnjrohmbpy\",\"type\":\"CustomRole\",\"databaseName\":\"meblyd\",\"privileges\":[{\"resource\":{},\"actions\":[\"rocxnehvs\"]},{\"resource\":{},\"actions\":[\"lfpya\"]},{\"resource\":{},\"actions\":[\"gvoavyunssxlgh\",\"ee\",\"jlgvvpase\",\"sgb\"]},{\"resource\":{},\"actions\":[\"tu\",\"gdhg\",\"qipir\",\"iwrqofulopmjnl\"]}],\"roles\":[{\"db\":\"cbjpibkephuu\",\"role\":\"rctat\"}]},\"id\":\"intqpbrlcyr\",\"name\":\"uczkgofxyfsruc\",\"type\":\"crrpcjttbstvje\"},{\"properties\":{\"roleName\":\"rmvvfkoxmlghktui\",\"type\":\"BuiltInRole\",\"databaseName\":\"azlp\",\"privileges\":[{\"resource\":{},\"actions\":[\"mzvlazipbh\",\"wvqsgny\"]}],\"roles\":[{\"db\":\"ivensrpmeyyvpk\",\"role\":\"tlbijpzg\"},{\"db\":\"srfhf\",\"role\":\"lmknbnxwcdom\"},{\"db\":\"vfqawzfgbrttuiac\",\"role\":\"iexhajl\"},{\"db\":\"t\",\"role\":\"qfyuttd\"}]},\"id\":\"gbpvnwswmtxkyct\",\"name\":\"wgzwxjlmecvog\",\"type\":\"gzyvnee\"},{\"properties\":{\"roleName\":\"fg\",\"type\":\"CustomRole\",\"databaseName\":\"qqtlffhzbkrkj\",\"privileges\":[{\"resource\":{},\"actions\":[\"nvhnqoewdogiye\",\"esypvidbztjh\"]},{\"resource\":{},\"actions\":[\"ovnynkbwetnju\"]},{\"resource\":{},\"actions\":[\"rkzyaupia\",\"cxnafbwqrooh\"]},{\"resource\":{},\"actions\":[\"maonurj\",\"umghihpvecmsl\",\"lbl\"]}],\"roles\":[{\"db\":\"tbsjuscvsf\",\"role\":\"gctmgxuupbezq\"},{\"db\":\"ydrtc\",\"role\":\"kdqkkyihzt\"},{\"db\":\"qm\",\"role\":\"zgwldoychillcec\"}]},\"id\":\"huwaoaguhic\",\"name\":\"llizs\",\"type\":\"ac\"}],\"nextLink\":\"vhrweftkwqejpmv\"}") + "{\"value\":[{\"properties\":{\"roleName\":\"zwfbcyaykmmfzs\",\"type\":\"CustomRole\",\"databaseName\":\"rzx\",\"privileges\":[{\"resource\":{},\"actions\":[\"sxkrpl\",\"jazejwwviyoyp\"]},{\"resource\":{},\"actions\":[\"rnnhjxs\",\"wjh\",\"kbiwetpozyc\"]},{\"resource\":{},\"actions\":[\"yhgfsetzle\",\"bsfledynojpziu\"]},{\"resource\":{},\"actions\":[\"kkdtnhqsy\",\"ljselp\",\"pbafvafhlbylc\"]}],\"roles\":[{\"db\":\"xrhyzdfwrsofplt\",\"role\":\"mairrh\"},{\"db\":\"fnrac\",\"role\":\"pqigtuujwouhd\"}]},\"id\":\"s\",\"name\":\"grbjbxsjybvitvqk\",\"type\":\"y\"},{\"properties\":{\"roleName\":\"umtggmuwdchozfn\",\"type\":\"CustomRole\",\"databaseName\":\"lv\",\"privileges\":[{\"resource\":{},\"actions\":[\"zvoaikna\",\"lnuwiguy\",\"lykwphvxz\",\"wxh\"]},{\"resource\":{},\"actions\":[\"tl\",\"exaonwivkcq\",\"rxhxkn\",\"ccrmmk\"]},{\"resource\":{},\"actions\":[\"jubyqjfkakfq\",\"rke\",\"yildudxjascow\",\"f\"]}],\"roles\":[{\"db\":\"dxphlk\",\"role\":\"nmgzvyfijdkzuqnw\"},{\"db\":\"thuqolyahluq\",\"role\":\"ulsutrjbhxy\"}]},\"id\":\"hyqezvqq\",\"name\":\"g\",\"type\":\"rftb\"},{\"properties\":{\"roleName\":\"xreuquowtlj\",\"type\":\"CustomRole\",\"databaseName\":\"reagkhyxvrqt\",\"privileges\":[{\"resource\":{},\"actions\":[\"lmdgglmepjp\",\"s\"]},{\"resource\":{},\"actions\":[\"sa\"]},{\"resource\":{},\"actions\":[\"zngafpgylkvecju\",\"cngoadyedmzrg\",\"foknubnoitp\"]}],\"roles\":[{\"db\":\"rgdg\",\"role\":\"coqra\"},{\"db\":\"ugyxpqit\",\"role\":\"ialwv\"},{\"db\":\"buhzacaq\",\"role\":\"ltcoqc\"}]},\"id\":\"pdsxzakuejkm\",\"name\":\"bizt\",\"type\":\"ofqcvovjufycsjm\"},{\"properties\":{\"roleName\":\"myejiriuxegthor\",\"type\":\"CustomRole\",\"databaseName\":\"wlpjfelqerppt\",\"privileges\":[{\"resource\":{},\"actions\":[\"mnhiil\",\"alwcjgckbb\",\"ccgzpraoxnyu\"]},{\"resource\":{},\"actions\":[\"sgftipwc\",\"byubhiqdxyurnpn\",\"hza\",\"ccnuhiig\"]}],\"roles\":[{\"db\":\"ui\",\"role\":\"xvatvcr\"},{\"db\":\"lbnb\",\"role\":\"vhcs\"}]},\"id\":\"zlwxaeaovur\",\"name\":\"xdndsbdweaderzm\",\"type\":\"ntopa\"}],\"nextLink\":\"tmvmmagoaqylkjz\"}") .toObject(MongoRoleDefinitionListResult.class); - Assertions.assertEquals("vhrweftkwqejpmv", model.nextLink()); + Assertions.assertEquals("tmvmmagoaqylkjz", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionResourceTests.java index c3b8508d0c30..58dd3195b455 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/MongoRoleDefinitionResourceTests.java @@ -17,39 +17,45 @@ public final class MongoRoleDefinitionResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MongoRoleDefinitionResource model = BinaryData.fromString( - "{\"roleName\":\"zvxnqmhrp\",\"type\":\"BuiltInRole\",\"databaseName\":\"wmkoisq\",\"privileges\":[{\"resource\":{\"db\":\"xuifmcsypobkdqz\",\"collection\":\"zsylollgt\"},\"actions\":[\"zydmxzjijpvuaurk\",\"hci\",\"ldefxrdcoxn\",\"kkjanurnnqbnqbp\"]},{\"resource\":{\"db\":\"qltgrd\",\"collection\":\"ypxrx\"},\"actions\":[\"ihwuhvctafsrbxrb\",\"m\"]}],\"roles\":[{\"db\":\"xihspnxwq\",\"role\":\"nepzwakls\"},{\"db\":\"bqqqagwwrxa\",\"role\":\"zisglrrczezkhh\"}]}") + "{\"roleName\":\"wiswskukjtasbvw\",\"type\":\"CustomRole\",\"databaseName\":\"xkdtxfkndlqvtwkn\",\"privileges\":[{\"resource\":{\"db\":\"ugtywatmqaqkue\",\"collection\":\"groeshoyg\"},\"actions\":[\"yf\",\"x\",\"faoytehqpuv\"]},{\"resource\":{\"db\":\"qm\",\"collection\":\"wckygr\"},\"actions\":[\"n\"]},{\"resource\":{\"db\":\"jdjusk\",\"collection\":\"req\"},\"actions\":[\"ceysfaqeg\",\"lwryshwddkvbxgkq\",\"sybwptdaca\",\"vvlfntymtp\"]},{\"resource\":{\"db\":\"enazerohzrsqals\",\"collection\":\"dnwqapfg\"},\"actions\":[\"cve\",\"smzhhkuuipldqqct\"]}],\"roles\":[{\"db\":\"lblhtjq\",\"role\":\"yvwehtaemxh\"},{\"db\":\"ysev\",\"role\":\"xivzrrry\"},{\"db\":\"imipskdyzatvfuz\",\"role\":\"ftjvvruxwigsye\"}]}") .toObject(MongoRoleDefinitionResource.class); - Assertions.assertEquals("zvxnqmhrp", model.roleName()); - Assertions.assertEquals(MongoRoleDefinitionType.BUILT_IN_ROLE, model.type()); - Assertions.assertEquals("wmkoisq", model.databaseName()); - Assertions.assertEquals("xuifmcsypobkdqz", model.privileges().get(0).resource().db()); - Assertions.assertEquals("zsylollgt", model.privileges().get(0).resource().collection()); - Assertions.assertEquals("zydmxzjijpvuaurk", model.privileges().get(0).actions().get(0)); - Assertions.assertEquals("xihspnxwq", model.roles().get(0).db()); - Assertions.assertEquals("nepzwakls", model.roles().get(0).role()); + Assertions.assertEquals("wiswskukjtasbvw", model.roleName()); + Assertions.assertEquals(MongoRoleDefinitionType.CUSTOM_ROLE, model.type()); + Assertions.assertEquals("xkdtxfkndlqvtwkn", model.databaseName()); + Assertions.assertEquals("ugtywatmqaqkue", model.privileges().get(0).resource().db()); + Assertions.assertEquals("groeshoyg", model.privileges().get(0).resource().collection()); + Assertions.assertEquals("yf", model.privileges().get(0).actions().get(0)); + Assertions.assertEquals("lblhtjq", model.roles().get(0).db()); + Assertions.assertEquals("yvwehtaemxh", model.roles().get(0).role()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MongoRoleDefinitionResource model = new MongoRoleDefinitionResource().withRoleName("zvxnqmhrp") - .withType(MongoRoleDefinitionType.BUILT_IN_ROLE) - .withDatabaseName("wmkoisq") + MongoRoleDefinitionResource model = new MongoRoleDefinitionResource().withRoleName("wiswskukjtasbvw") + .withType(MongoRoleDefinitionType.CUSTOM_ROLE) + .withDatabaseName("xkdtxfkndlqvtwkn") .withPrivileges(Arrays.asList( new Privilege() - .withResource(new PrivilegeResource().withDb("xuifmcsypobkdqz").withCollection("zsylollgt")) - .withActions(Arrays.asList("zydmxzjijpvuaurk", "hci", "ldefxrdcoxn", "kkjanurnnqbnqbp")), - new Privilege().withResource(new PrivilegeResource().withDb("qltgrd").withCollection("ypxrx")) - .withActions(Arrays.asList("ihwuhvctafsrbxrb", "m")))) - .withRoles(Arrays.asList(new Role().withDb("xihspnxwq").withRole("nepzwakls"), - new Role().withDb("bqqqagwwrxa").withRole("zisglrrczezkhh"))); + .withResource(new PrivilegeResource().withDb("ugtywatmqaqkue").withCollection("groeshoyg")) + .withActions(Arrays.asList("yf", "x", "faoytehqpuv")), + new Privilege().withResource(new PrivilegeResource().withDb("qm").withCollection("wckygr")) + .withActions(Arrays.asList("n")), + new Privilege().withResource(new PrivilegeResource().withDb("jdjusk").withCollection("req")) + .withActions(Arrays.asList("ceysfaqeg", "lwryshwddkvbxgkq", "sybwptdaca", "vvlfntymtp")), + new Privilege() + .withResource(new PrivilegeResource().withDb("enazerohzrsqals").withCollection("dnwqapfg")) + .withActions(Arrays.asList("cve", "smzhhkuuipldqqct")))) + .withRoles(Arrays.asList(new Role().withDb("lblhtjq").withRole("yvwehtaemxh"), + new Role().withDb("ysev").withRole("xivzrrry"), + new Role().withDb("imipskdyzatvfuz").withRole("ftjvvruxwigsye"))); model = BinaryData.fromObject(model).toObject(MongoRoleDefinitionResource.class); - Assertions.assertEquals("zvxnqmhrp", model.roleName()); - Assertions.assertEquals(MongoRoleDefinitionType.BUILT_IN_ROLE, model.type()); - Assertions.assertEquals("wmkoisq", model.databaseName()); - Assertions.assertEquals("xuifmcsypobkdqz", model.privileges().get(0).resource().db()); - Assertions.assertEquals("zsylollgt", model.privileges().get(0).resource().collection()); - Assertions.assertEquals("zydmxzjijpvuaurk", model.privileges().get(0).actions().get(0)); - Assertions.assertEquals("xihspnxwq", model.roles().get(0).db()); - Assertions.assertEquals("nepzwakls", model.roles().get(0).role()); + Assertions.assertEquals("wiswskukjtasbvw", model.roleName()); + Assertions.assertEquals(MongoRoleDefinitionType.CUSTOM_ROLE, model.type()); + Assertions.assertEquals("xkdtxfkndlqvtwkn", model.databaseName()); + Assertions.assertEquals("ugtywatmqaqkue", model.privileges().get(0).resource().db()); + Assertions.assertEquals("groeshoyg", model.privileges().get(0).resource().collection()); + Assertions.assertEquals("yf", model.privileges().get(0).actions().get(0)); + Assertions.assertEquals("lblhtjq", model.roles().get(0).db()); + Assertions.assertEquals("yvwehtaemxh", model.roles().get(0).role()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationInnerTests.java new file mode 100644 index 000000000000..afe80dcff316 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationInnerTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import com.azure.resourcemanager.cosmos.models.AccessRuleDirection; +import com.azure.resourcemanager.cosmos.models.ResourceAssociationAccessMode; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityPerimeterConfigurationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityPerimeterConfigurationInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Creating\",\"provisioningIssues\":[{\"name\":\"tvdxxhe\",\"properties\":{\"issueType\":\"Unknown\",\"severity\":\"Warning\",\"description\":\"zg\",\"suggestedResourceIds\":[\"jvmabzzbway\",\"fmdafbgymqtnap\",\"eojxrjn\",\"sconxavipney\"],\"suggestedAccessRules\":[{},{},{}]}},{\"name\":\"izqfsgnwdxz\",\"properties\":{\"issueType\":\"Unknown\",\"severity\":\"Warning\",\"description\":\"borx\",\"suggestedResourceIds\":[\"lnfyzav\",\"rbypi\"],\"suggestedAccessRules\":[{},{},{}]}},{\"name\":\"pdjtaqh\",\"properties\":{\"issueType\":\"ConfigurationPropagationFailure\",\"severity\":\"Error\",\"description\":\"gonjhxshthmgpczq\",\"suggestedResourceIds\":[\"t\",\"bvcpxtzhi\",\"q\"],\"suggestedAccessRules\":[{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"pkjblornsih\",\"perimeterGuid\":\"uds\",\"location\":\"suaawj\"},\"resourceAssociation\":{\"name\":\"wj\",\"accessMode\":\"Learning\"},\"profile\":{\"name\":\"nniixyxvqba\",\"accessRulesVersion\":1704793589,\"accessRules\":[{\"name\":\"irnb\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"orgmynltwmpftm\",\"oeajogsy\",\"wetamfddrvlk\"],\"subscriptions\":[{},{},{},{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"ecchdidrmuhkahm\",\"edbiucvkhhwmjpjb\",\"eunxcqrrihufoi\"],\"emailAddresses\":[\"iybxvgnzuzpb\",\"kzcscpiuzvkun\",\"dimjuktirzkau\",\"pucdocf\"],\"phoneNumbers\":[\"wgofmhx\",\"rjlvzklkvbgi\"]}},{\"name\":\"jtkakvl\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"pzaptuosk\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"wfgcdiykkcxwn\",\"jvqynvavitmdm\",\"qohhihra\"],\"emailAddresses\":[\"ddrwjcljbrhlhpvz\",\"dbwen\"],\"phoneNumbers\":[\"afhxrzfrmvztiuc\",\"viqlluk\",\"krcqx\"]}}],\"diagnosticSettingsVersion\":1730615801,\"enabledLogCategories\":[\"a\",\"mqcbpokstsinv\",\"gov\"]}},\"id\":\"hdrx\",\"name\":\"rdvcehqwhit\",\"type\":\"nmxgnm\"}") + .toObject(NetworkSecurityPerimeterConfigurationInner.class); + Assertions.assertEquals("pkjblornsih", model.properties().networkSecurityPerimeter().id()); + Assertions.assertEquals("uds", model.properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("suaawj", model.properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("wj", model.properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, + model.properties().resourceAssociation().accessMode()); + Assertions.assertEquals("nniixyxvqba", model.properties().profile().name()); + Assertions.assertEquals(1704793589, model.properties().profile().accessRulesVersion()); + Assertions.assertEquals("irnb", model.properties().profile().accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.INBOUND, + model.properties().profile().accessRules().get(0).properties().direction()); + Assertions.assertEquals("orgmynltwmpftm", + model.properties().profile().accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("ecchdidrmuhkahm", + model.properties().profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("iybxvgnzuzpb", + model.properties().profile().accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("wgofmhx", + model.properties().profile().accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(1730615801, model.properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("a", model.properties().profile().enabledLogCategories().get(0)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationListResultTests.java new file mode 100644 index 000000000000..9c6fc98c6aa3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationListResultTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.implementation.models.NetworkSecurityPerimeterConfigurationListResult; +import com.azure.resourcemanager.cosmos.models.ResourceAssociationAccessMode; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityPerimeterConfigurationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityPerimeterConfigurationListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"provisioningIssues\":[{\"name\":\"ezyohxpthceopv\",\"properties\":{}},{\"name\":\"wfvesobpbok\",\"properties\":{}},{\"name\":\"lc\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"nggcjfwblq\",\"perimeterGuid\":\"kasmcolmugpyva\",\"location\":\"dkluwzxeygzvt\"},\"resourceAssociation\":{\"name\":\"jhubno\",\"accessMode\":\"Learning\"},\"profile\":{\"name\":\"sqsqkpdmioyjpnml\",\"accessRulesVersion\":1433905892,\"accessRules\":[{},{},{}],\"diagnosticSettingsVersion\":374312001,\"enabledLogCategories\":[\"cvqdvrdmvxyrxd\"]}},\"id\":\"vqojbxaotcgbz\",\"name\":\"mbtple\",\"type\":\"oioyidoxznvgvd\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"provisioningIssues\":[{\"name\":\"wsxmrszb\",\"properties\":{}},{\"name\":\"mxlpnerxrz\",\"properties\":{}},{\"name\":\"lcurzaqmnbx\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"tdbjmbnvynfaoo\",\"perimeterGuid\":\"c\",\"location\":\"dcglskakddid\"},\"resourceAssociation\":{\"name\":\"llrqmtlpbyxro\",\"accessMode\":\"Audit\"},\"profile\":{\"name\":\"ypffmnoiicsudyh\",\"accessRulesVersion\":295805130,\"accessRules\":[{},{}],\"diagnosticSettingsVersion\":2046190668,\"enabledLogCategories\":[\"dsjrholuqwgusxx\",\"dodpjwyblv\"]}},\"id\":\"d\",\"name\":\"vsbyidaelqp\",\"type\":\"ekmkwjfbotlo\"}],\"nextLink\":\"dusxurs\"}") + .toObject(NetworkSecurityPerimeterConfigurationListResult.class); + Assertions.assertEquals("nggcjfwblq", model.value().get(0).properties().networkSecurityPerimeter().id()); + Assertions.assertEquals("kasmcolmugpyva", + model.value().get(0).properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("dkluwzxeygzvt", + model.value().get(0).properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("jhubno", model.value().get(0).properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, + model.value().get(0).properties().resourceAssociation().accessMode()); + Assertions.assertEquals("sqsqkpdmioyjpnml", model.value().get(0).properties().profile().name()); + Assertions.assertEquals(1433905892, model.value().get(0).properties().profile().accessRulesVersion()); + Assertions.assertEquals(374312001, model.value().get(0).properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("cvqdvrdmvxyrxd", + model.value().get(0).properties().profile().enabledLogCategories().get(0)); + Assertions.assertEquals("dusxurs", model.nextLink()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java new file mode 100644 index 000000000000..72628243dbc9 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.AccessRuleDirection; +import com.azure.resourcemanager.cosmos.models.NetworkSecurityPerimeterConfigurationProperties; +import com.azure.resourcemanager.cosmos.models.ResourceAssociationAccessMode; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityPerimeterConfigurationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityPerimeterConfigurationProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Deleting\",\"provisioningIssues\":[{\"name\":\"vorbalkjnbk\",\"properties\":{\"issueType\":\"MissingPerimeterConfiguration\",\"severity\":\"Error\",\"description\":\"stqkqsygxiyn\",\"suggestedResourceIds\":[\"vagzkheuba\",\"lxu\",\"pqcckqiawzlz\"],\"suggestedAccessRules\":[{\"name\":\"lg\",\"properties\":{}},{\"name\":\"zuxlrarwpewsau\",\"properties\":{}},{\"name\":\"jtighsxj\",\"properties\":{}},{\"name\":\"nkqb\",\"properties\":{}}]}},{\"name\":\"ho\",\"properties\":{\"issueType\":\"MissingIdentityConfiguration\",\"severity\":\"Warning\",\"description\":\"e\",\"suggestedResourceIds\":[\"hjiotiffbbcngkeg\",\"cypxbbfetw\",\"lyr\"],\"suggestedAccessRules\":[{\"name\":\"dxqlfrolq\",\"properties\":{}},{\"name\":\"kiu\",\"properties\":{}},{\"name\":\"wnah\",\"properties\":{}},{\"name\":\"jjmztnlmsoodtmv\",\"properties\":{}}]}},{\"name\":\"hdyswcrptveajc\",\"properties\":{\"issueType\":\"MissingIdentityConfiguration\",\"severity\":\"Warning\",\"description\":\"gkrfizrpywlp\",\"suggestedResourceIds\":[\"qhrlmcskykpfu\",\"fixcnpcfykkpy\",\"cpawmp\"],\"suggestedAccessRules\":[{\"name\":\"pwr\",\"properties\":{}},{\"name\":\"pcf\",\"properties\":{}}]}}],\"networkSecurityPerimeter\":{\"id\":\"lgzawkgyepeyamnn\",\"perimeterGuid\":\"mdiawpzx\",\"location\":\"rntmkctdhu\"},\"resourceAssociation\":{\"name\":\"wqpsqaz\",\"accessMode\":\"Learning\"},\"profile\":{\"name\":\"vqgcnbhcbm\",\"accessRulesVersion\":1831783248,\"accessRules\":[{\"name\":\"n\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"jmfmeftvhkm\"],\"subscriptions\":[{},{}],\"networkSecurityPerimeters\":[{}],\"fullyQualifiedDomainNames\":[\"kbwg\",\"jgrulcfogxhcxnwj\"],\"emailAddresses\":[\"dzxcouzfwo\"],\"phoneNumbers\":[\"k\"]}},{\"name\":\"zkdtzxsoed\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"hezomucmqgisnion\",\"tb\",\"dr\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"gtlzlmtrlxcznn\",\"zkbnbmxl\"],\"emailAddresses\":[\"tygeqzus\"],\"phoneNumbers\":[\"qcahfsgbjmlree\",\"rfwss\"]}}],\"diagnosticSettingsVersion\":308743751,\"enabledLogCategories\":[\"lisolntfxxc\",\"qmipfj\"]}}") + .toObject(NetworkSecurityPerimeterConfigurationProperties.class); + Assertions.assertEquals("lgzawkgyepeyamnn", model.networkSecurityPerimeter().id()); + Assertions.assertEquals("mdiawpzx", model.networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("rntmkctdhu", model.networkSecurityPerimeter().location()); + Assertions.assertEquals("wqpsqaz", model.resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, model.resourceAssociation().accessMode()); + Assertions.assertEquals("vqgcnbhcbm", model.profile().name()); + Assertions.assertEquals(1831783248, model.profile().accessRulesVersion()); + Assertions.assertEquals("n", model.profile().accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, + model.profile().accessRules().get(0).properties().direction()); + Assertions.assertEquals("jmfmeftvhkm", + model.profile().accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("kbwg", + model.profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("dzxcouzfwo", + model.profile().accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("k", model.profile().accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(308743751, model.profile().diagnosticSettingsVersion()); + Assertions.assertEquals("lisolntfxxc", model.profile().enabledLogCategories().get(0)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterTests.java new file mode 100644 index 000000000000..5bea0d6fb95f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityPerimeterTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.NetworkSecurityPerimeter; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityPerimeterTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityPerimeter model = BinaryData + .fromString("{\"id\":\"mtmvwituwey\",\"perimeterGuid\":\"shcybwfuppox\",\"location\":\"cmvouujxdiikmoxr\"}") + .toObject(NetworkSecurityPerimeter.class); + Assertions.assertEquals("mtmvwituwey", model.id()); + Assertions.assertEquals("shcybwfuppox", model.perimeterGuid()); + Assertions.assertEquals("cmvouujxdiikmoxr", model.location()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityProfileTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityProfileTests.java new file mode 100644 index 000000000000..c11e8fb26dae --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NetworkSecurityProfileTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.AccessRuleDirection; +import com.azure.resourcemanager.cosmos.models.NetworkSecurityProfile; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityProfile model = BinaryData.fromString( + "{\"name\":\"p\",\"accessRulesVersion\":1983453114,\"accessRules\":[{\"name\":\"szf\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"pftsaebwf\"],\"subscriptions\":[{\"id\":\"rpwa\"},{\"id\":\"zwuge\"}],\"networkSecurityPerimeters\":[{\"id\":\"ccylhtrh\",\"perimeterGuid\":\"vazjpwexcd\",\"location\":\"probzzxezmnrkjgp\"},{\"id\":\"uxsphlokfpm\",\"perimeterGuid\":\"pd\",\"location\":\"vfbhwb\"},{\"id\":\"ufvcgnrgl\",\"perimeterGuid\":\"rwyambhbafebzxfk\",\"location\":\"utibhlen\"}],\"fullyQualifiedDomainNames\":[\"vrkpsa\"],\"emailAddresses\":[\"xvzmlghny\"],\"phoneNumbers\":[\"pye\",\"ukppdixqbo\"]}},{\"name\":\"vhh\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"txgrzn\"],\"subscriptions\":[{\"id\":\"mtsdixchwk\"},{\"id\":\"m\"},{\"id\":\"ymncjc\"},{\"id\":\"airwcqzoofj\"}],\"networkSecurityPerimeters\":[{\"id\":\"vep\",\"perimeterGuid\":\"htleberpyljek\",\"location\":\"qnwjjq\"},{\"id\":\"wkdnjrxgkrhwiehy\",\"perimeterGuid\":\"nowawonoehrguqlh\",\"location\":\"afbjzmpy\"},{\"id\":\"uyfazbkoc\",\"perimeterGuid\":\"gvthrmxkbcjww\",\"location\":\"omraw\"},{\"id\":\"keboo\",\"perimeterGuid\":\"l\",\"location\":\"cagaedaoiqc\"}],\"fullyQualifiedDomainNames\":[\"dtwgabdxfkuzbwj\",\"cooyvhtuqb\"],\"emailAddresses\":[\"nii\",\"ncgagdvc\"],\"phoneNumbers\":[\"ftzb\",\"yfaofdf\",\"htncwmhjobzrfp\"]}},{\"name\":\"zdcqhyftcvb\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"kg\",\"o\"],\"subscriptions\":[{\"id\":\"rssat\"},{\"id\":\"bipufdmxuqbdqnas\"},{\"id\":\"uxvzfqayopbtsi\"}],\"networkSecurityPerimeters\":[{\"id\":\"bhxmndztgsqjayq\",\"perimeterGuid\":\"rxneibpgbrhbj\",\"location\":\"knhqnmotpuwnnohm\"},{\"id\":\"ngocfrjuypwyi\",\"perimeterGuid\":\"ayno\",\"location\":\"gkfh\"},{\"id\":\"ttpfsmwgsgh\",\"perimeterGuid\":\"cum\",\"location\":\"dau\"}],\"fullyQualifiedDomainNames\":[\"lfeothxuarigr\",\"dlj\"],\"emailAddresses\":[\"hvkr\"],\"phoneNumbers\":[\"uast\",\"xk\",\"pruulhg\"]}},{\"name\":\"oizwxvs\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"yskye\",\"gafxczvf\",\"ckwrtw\",\"ety\"],\"subscriptions\":[{\"id\":\"rtlhpdhwyn\"},{\"id\":\"aczcnjfmbbfnvjxi\"},{\"id\":\"ovnkrtiklsmnihql\"},{\"id\":\"qksyiibhyxwbgbu\"}],\"networkSecurityPerimeters\":[{\"id\":\"d\",\"perimeterGuid\":\"bccqcdhthojvl\",\"location\":\"knucos\"},{\"id\":\"rdtnagzl\",\"perimeterGuid\":\"yaixihzqj\",\"location\":\"smuydqfttk\"},{\"id\":\"ybd\",\"perimeterGuid\":\"urgmcdcp\",\"location\":\"hlo\"}],\"fullyQualifiedDomainNames\":[\"mhzic\",\"bfdjhyaaknyukibx\",\"glhphzwx\"],\"emailAddresses\":[\"jpiilh\"],\"phoneNumbers\":[\"z\"]}}],\"diagnosticSettingsVersion\":1166825532,\"enabledLogCategories\":[\"nxkbylhyyxgf\",\"klvqzrwtrdgscn\",\"q\",\"on\"]}") + .toObject(NetworkSecurityProfile.class); + Assertions.assertEquals("p", model.name()); + Assertions.assertEquals(1983453114, model.accessRulesVersion()); + Assertions.assertEquals("szf", model.accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.INBOUND, model.accessRules().get(0).properties().direction()); + Assertions.assertEquals("pftsaebwf", model.accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("rpwa", model.accessRules().get(0).properties().subscriptions().get(0).id()); + Assertions.assertEquals("ccylhtrh", + model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals("vazjpwexcd", + model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("probzzxezmnrkjgp", + model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("vrkpsa", model.accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("xvzmlghny", model.accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("pye", model.accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(1166825532, model.diagnosticSettingsVersion()); + Assertions.assertEquals("nxkbylhyyxgf", model.enabledLogCategories().get(0)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NoSqlRUToNoSqlRUCopyJobPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NoSqlRUToNoSqlRUCopyJobPropertiesTests.java new file mode 100644 index 000000000000..f9cfea0d9adb --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NoSqlRUToNoSqlRUCopyJobPropertiesTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CosmosDBNoSqlContainer; +import com.azure.resourcemanager.cosmos.models.CosmosDBSourceSinkDetails; +import com.azure.resourcemanager.cosmos.models.NoSqlRUToNoSqlRUCopyJobProperties; +import com.azure.resourcemanager.cosmos.models.NoSqlRUToNoSqlRUCopyJobTask; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class NoSqlRUToNoSqlRUCopyJobPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NoSqlRUToNoSqlRUCopyJobProperties model = BinaryData.fromString( + "{\"jobType\":\"NoSqlRUToNoSqlRU\",\"sourceDetails\":{\"remoteAccountName\":\"xrwlyc\"},\"destinationDetails\":{\"remoteAccountName\":\"hp\"},\"tasks\":[{\"source\":{\"databaseName\":\"kgymareqnajxqug\",\"containerName\":\"hky\"},\"destination\":{\"databaseName\":\"ubeddg\",\"containerName\":\"sofwqmzqalkrmnji\"},\"totalCount\":4245550544561236483,\"processedCount\":955706142137404908},{\"source\":{\"databaseName\":\"udfnbyxba\",\"containerName\":\"abjy\"},\"destination\":{\"databaseName\":\"ayffim\",\"containerName\":\"zrtuzq\"},\"totalCount\":1189193758157462805,\"processedCount\":7533861003101149495},{\"source\":{\"databaseName\":\"vfdnwnwmewzsyyce\",\"containerName\":\"zsoibjudpfrxtr\"},\"destination\":{\"databaseName\":\"hzv\",\"containerName\":\"ytdw\"},\"totalCount\":6301740843826018635,\"processedCount\":7427478878049317484},{\"source\":{\"databaseName\":\"paxh\",\"containerName\":\"xiilivpdtiirqt\"},\"destination\":{\"databaseName\":\"qoaxoruzfgs\",\"containerName\":\"uyfxrxxleptramxj\"},\"totalCount\":2475556644072842504,\"processedCount\":3723324689526490155}]}") + .toObject(NoSqlRUToNoSqlRUCopyJobProperties.class); + Assertions.assertEquals("xrwlyc", model.sourceDetails().remoteAccountName()); + Assertions.assertEquals("hp", model.destinationDetails().remoteAccountName()); + Assertions.assertEquals("kgymareqnajxqug", model.tasks().get(0).source().databaseName()); + Assertions.assertEquals("hky", model.tasks().get(0).source().containerName()); + Assertions.assertEquals("ubeddg", model.tasks().get(0).destination().databaseName()); + Assertions.assertEquals("sofwqmzqalkrmnji", model.tasks().get(0).destination().containerName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NoSqlRUToNoSqlRUCopyJobProperties model + = new NoSqlRUToNoSqlRUCopyJobProperties() + .withSourceDetails(new CosmosDBSourceSinkDetails().withRemoteAccountName("xrwlyc")) + .withDestinationDetails(new CosmosDBSourceSinkDetails().withRemoteAccountName("hp")) + .withTasks( + Arrays.asList( + new NoSqlRUToNoSqlRUCopyJobTask().withSource( + new CosmosDBNoSqlContainer().withDatabaseName("kgymareqnajxqug").withContainerName("hky")) + .withDestination(new CosmosDBNoSqlContainer().withDatabaseName("ubeddg") + .withContainerName("sofwqmzqalkrmnji")), + new NoSqlRUToNoSqlRUCopyJobTask() + .withSource( + new CosmosDBNoSqlContainer().withDatabaseName("udfnbyxba").withContainerName("abjy")) + .withDestination( + new CosmosDBNoSqlContainer().withDatabaseName("ayffim").withContainerName("zrtuzq")), + new NoSqlRUToNoSqlRUCopyJobTask() + .withSource(new CosmosDBNoSqlContainer().withDatabaseName("vfdnwnwmewzsyyce") + .withContainerName("zsoibjudpfrxtr")) + .withDestination( + new CosmosDBNoSqlContainer().withDatabaseName("hzv").withContainerName("ytdw")), + new NoSqlRUToNoSqlRUCopyJobTask() + .withSource(new CosmosDBNoSqlContainer().withDatabaseName("paxh") + .withContainerName("xiilivpdtiirqt")) + .withDestination(new CosmosDBNoSqlContainer().withDatabaseName("qoaxoruzfgs") + .withContainerName("uyfxrxxleptramxj")))); + model = BinaryData.fromObject(model).toObject(NoSqlRUToNoSqlRUCopyJobProperties.class); + Assertions.assertEquals("xrwlyc", model.sourceDetails().remoteAccountName()); + Assertions.assertEquals("hp", model.destinationDetails().remoteAccountName()); + Assertions.assertEquals("kgymareqnajxqug", model.tasks().get(0).source().databaseName()); + Assertions.assertEquals("hky", model.tasks().get(0).source().containerName()); + Assertions.assertEquals("ubeddg", model.tasks().get(0).destination().databaseName()); + Assertions.assertEquals("sofwqmzqalkrmnji", model.tasks().get(0).destination().containerName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NoSqlRUToNoSqlRUCopyJobTaskTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NoSqlRUToNoSqlRUCopyJobTaskTests.java new file mode 100644 index 000000000000..20b8a9680ac1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NoSqlRUToNoSqlRUCopyJobTaskTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.CosmosDBNoSqlContainer; +import com.azure.resourcemanager.cosmos.models.NoSqlRUToNoSqlRUCopyJobTask; +import org.junit.jupiter.api.Assertions; + +public final class NoSqlRUToNoSqlRUCopyJobTaskTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NoSqlRUToNoSqlRUCopyJobTask model = BinaryData.fromString( + "{\"source\":{\"databaseName\":\"xuqlcvydypat\",\"containerName\":\"ooaojkniodkooebw\"},\"destination\":{\"databaseName\":\"ujhemmsbvdkcrodt\",\"containerName\":\"infwjlfltkacjve\"},\"totalCount\":2718040045935235650,\"processedCount\":1861538063477549272}") + .toObject(NoSqlRUToNoSqlRUCopyJobTask.class); + Assertions.assertEquals("xuqlcvydypat", model.source().databaseName()); + Assertions.assertEquals("ooaojkniodkooebw", model.source().containerName()); + Assertions.assertEquals("ujhemmsbvdkcrodt", model.destination().databaseName()); + Assertions.assertEquals("infwjlfltkacjve", model.destination().containerName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NoSqlRUToNoSqlRUCopyJobTask model = new NoSqlRUToNoSqlRUCopyJobTask() + .withSource( + new CosmosDBNoSqlContainer().withDatabaseName("xuqlcvydypat").withContainerName("ooaojkniodkooebw")) + .withDestination( + new CosmosDBNoSqlContainer().withDatabaseName("ujhemmsbvdkcrodt").withContainerName("infwjlfltkacjve")); + model = BinaryData.fromObject(model).toObject(NoSqlRUToNoSqlRUCopyJobTask.class); + Assertions.assertEquals("xuqlcvydypat", model.source().databaseName()); + Assertions.assertEquals("ooaojkniodkooebw", model.source().containerName()); + Assertions.assertEquals("ujhemmsbvdkcrodt", model.destination().databaseName()); + Assertions.assertEquals("infwjlfltkacjve", model.destination().containerName()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspaceCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspaceCreateUpdateParametersTests.java index b271e443cf7d..9ba6425aeb96 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspaceCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspaceCreateUpdateParametersTests.java @@ -11,7 +11,7 @@ public final class NotebookWorkspaceCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NotebookWorkspaceCreateUpdateParameters model - = BinaryData.fromString("{\"id\":\"ouarhwvixqqggljk\",\"name\":\"sjrclrvtzq\",\"type\":\"bctbhp\"}") + = BinaryData.fromString("{\"id\":\"pl\",\"name\":\"dajjvywe\",\"type\":\"fkumcfjxoky\"}") .toObject(NotebookWorkspaceCreateUpdateParameters.class); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspaceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspaceInnerTests.java index 4278997d3356..4eb15c5866e4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspaceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspaceInnerTests.java @@ -11,7 +11,7 @@ public final class NotebookWorkspaceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NotebookWorkspaceInner model = BinaryData.fromString( - "{\"properties\":{\"notebookServerEndpoint\":\"wilzzhnijmriprlk\",\"status\":\"eyttlrcxiv\"},\"id\":\"kutpu\",\"name\":\"ltw\",\"type\":\"fluxynbpvz\"}") + "{\"properties\":{\"notebookServerEndpoint\":\"uxcjkcoqwczsyiq\",\"status\":\"z\"},\"id\":\"ihvaang\",\"name\":\"tnhjrfdmfd\",\"type\":\"bbaex\"}") .toObject(NotebookWorkspaceInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspaceListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspaceListResultTests.java index cf8905161319..7ae372dbf97d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspaceListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspaceListResultTests.java @@ -12,8 +12,8 @@ public final class NotebookWorkspaceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NotebookWorkspaceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"notebookServerEndpoint\":\"wriuomzczfkic\",\"status\":\"vsaaxwsp\"},\"id\":\"xikhfj\",\"name\":\"ebglcxkxgzzro\",\"type\":\"vygys\"},{\"properties\":{\"notebookServerEndpoint\":\"mesrfsvpi\",\"status\":\"zpatqtd\"},\"id\":\"wxspvckojaz\",\"name\":\"bgspf\",\"type\":\"esubzpvpv\"},{\"properties\":{\"notebookServerEndpoint\":\"ytcovqs\",\"status\":\"srfjbdxzfxnx\"},\"id\":\"b\",\"name\":\"uoswkjmdih\",\"type\":\"cy\"},{\"properties\":{\"notebookServerEndpoint\":\"lwhbwzjnu\",\"status\":\"rfgmdqgnnbzrtfte\"},\"id\":\"uubjtvgjsxmty\",\"name\":\"jvavdpwwo\",\"type\":\"tdp\"}],\"nextLink\":\"its\"}") + "{\"value\":[{\"properties\":{\"notebookServerEndpoint\":\"svfnkwm\",\"status\":\"jjekrknfdrugj\"},\"id\":\"ckgtxkrdtulc\",\"name\":\"cjdk\",\"type\":\"otcsu\"},{\"properties\":{\"notebookServerEndpoint\":\"oonsvobchkxfp\",\"status\":\"dyslbklglmnn\"},\"id\":\"wayqshwyqxrid\",\"name\":\"tb\",\"type\":\"aqjmkgxqwque\"},{\"properties\":{\"notebookServerEndpoint\":\"lztpziizevjykof\",\"status\":\"zefkhkqtwqlepjj\"},\"id\":\"c\",\"name\":\"sf\",\"type\":\"zcntogffjwajnrtw\"},{\"properties\":{\"notebookServerEndpoint\":\"qkifmxawostfz\",\"status\":\"hrkmjqncfv\"},\"id\":\"cnhemvwfnq\",\"name\":\"wypvndrwbgo\",\"type\":\"tggrss\"}],\"nextLink\":\"jfkainj\"}") .toObject(NotebookWorkspaceListResult.class); - Assertions.assertEquals("its", model.nextLink()); + Assertions.assertEquals("jfkainj", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacePropertiesTests.java index 0558db66eabe..b3954f0bf48b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacePropertiesTests.java @@ -11,7 +11,7 @@ public final class NotebookWorkspacePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NotebookWorkspaceProperties model - = BinaryData.fromString("{\"notebookServerEndpoint\":\"ywauyqnjckhm\",\"status\":\"gjs\"}") + = BinaryData.fromString("{\"notebookServerEndpoint\":\"fwtgdfkkauigvmua\",\"status\":\"czfedyuep\"}") .toObject(NotebookWorkspaceProperties.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/OptionsResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/OptionsResourceTests.java index cf981476e631..07a6a437b0f2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/OptionsResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/OptionsResourceTests.java @@ -12,9 +12,9 @@ public final class OptionsResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OptionsResource model - = BinaryData.fromString("{\"throughput\":1201300359,\"autoscaleSettings\":{\"maxThroughput\":1294640448}}") + = BinaryData.fromString("{\"throughput\":1301478988,\"autoscaleSettings\":{\"maxThroughput\":242462331}}") .toObject(OptionsResource.class); - Assertions.assertEquals(1201300359, model.throughput()); - Assertions.assertEquals(1294640448, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1301478988, model.throughput()); + Assertions.assertEquals(242462331, model.autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PercentileMetricInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PercentileMetricInnerTests.java index 97dabe64b4b9..081ed98bf1c1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PercentileMetricInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PercentileMetricInnerTests.java @@ -11,7 +11,7 @@ public final class PercentileMetricInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PercentileMetricInner model = BinaryData.fromString( - "{\"startTime\":\"2021-07-21T01:58:06Z\",\"endTime\":\"2021-06-27T04:34:29Z\",\"timeGrain\":\"j\",\"unit\":\"CountPerSecond\",\"name\":{\"value\":\"whdmcvhtbbz\",\"localizedValue\":\"f\"},\"metricValues\":[{\"P10\":9.72234024385319,\"P25\":29.152355922144523,\"P50\":44.97212402810958,\"P75\":34.751194259544896,\"P90\":25.343867044543835,\"P95\":68.89384294713248,\"P99\":47.855578181068296,\"_count\":1841362943,\"average\":79.52465342577948,\"maximum\":81.54188528847118,\"minimum\":67.48514200019301,\"timestamp\":\"2021-02-16T23:46:30Z\",\"total\":17.301303658642297}]}") + "{\"startTime\":\"2020-12-27T08:06:18Z\",\"endTime\":\"2021-02-13T13:47:59Z\",\"timeGrain\":\"ohcwhpyv\",\"unit\":\"BytesPerSecond\",\"name\":{\"value\":\"tszwcanzb\",\"localizedValue\":\"kwuyck\"},\"metricValues\":[{\"P10\":17.265627559831398,\"P25\":85.16078692163563,\"P50\":49.216330480317836,\"P75\":53.356383627650104,\"P90\":15.800357986375735,\"P95\":64.0398570929881,\"P99\":19.66805702963064,\"_count\":1535836834,\"average\":47.483201223699254,\"maximum\":18.43828588825932,\"minimum\":75.05953561692053,\"timestamp\":\"2021-06-08T17:25:47Z\",\"total\":93.63112240245027},{\"P10\":46.437540149485855,\"P25\":74.08839550143915,\"P50\":1.7416434864657826,\"P75\":61.611060214934156,\"P90\":50.00713863927619,\"P95\":10.654523355551726,\"P99\":96.22999155402216,\"_count\":503004482,\"average\":3.7871361514089874,\"maximum\":40.133335319588525,\"minimum\":12.657076921785816,\"timestamp\":\"2021-04-26T12:33:38Z\",\"total\":47.89271129703807},{\"P10\":22.40446662855,\"P25\":95.62126241872934,\"P50\":44.029282308784886,\"P75\":54.75217562296354,\"P90\":90.03691355765798,\"P95\":48.43238948315288,\"P99\":43.92975876470491,\"_count\":602380151,\"average\":46.85440553879548,\"maximum\":30.40185122310035,\"minimum\":39.35091485950151,\"timestamp\":\"2021-05-22T15:45:32Z\",\"total\":20.14938208141317}]}") .toObject(PercentileMetricInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PercentileMetricListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PercentileMetricListResultTests.java index 7be9a444a639..7723d96997d1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PercentileMetricListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PercentileMetricListResultTests.java @@ -12,8 +12,8 @@ public final class PercentileMetricListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PercentileMetricListResult model = BinaryData.fromString( - "{\"value\":[{\"startTime\":\"2021-11-12T08:49:16Z\",\"endTime\":\"2021-11-15T18:30:57Z\",\"timeGrain\":\"j\",\"unit\":\"Bytes\",\"name\":{\"value\":\"fmaciqgjjrlhiq\",\"localizedValue\":\"ixvt\"},\"metricValues\":[{\"P10\":94.60979839467682,\"P25\":2.904944375788654,\"P50\":11.172509143670394,\"P75\":27.704443453218765,\"P90\":86.57088869686356,\"P95\":58.92211859845512,\"P99\":93.41435149022843,\"_count\":172101770,\"average\":14.297161188615748,\"maximum\":11.953909109852267,\"minimum\":18.193388597229244,\"timestamp\":\"2021-08-24T15:54:49Z\",\"total\":10.745817325547291}]},{\"startTime\":\"2021-10-06T00:47:27Z\",\"endTime\":\"2021-05-16T08:33:31Z\",\"timeGrain\":\"qvzfj\",\"unit\":\"Seconds\",\"name\":{\"value\":\"zfe\",\"localizedValue\":\"jljmphfkyezol\"},\"metricValues\":[{\"P10\":54.82365914181504,\"P25\":76.95397844013758,\"P50\":14.23498856990404,\"P75\":42.23188975628425,\"P90\":35.31421473589439,\"P95\":14.250779062700559,\"P99\":17.459084259080715,\"_count\":1958655467,\"average\":29.116759978998232,\"maximum\":75.72464197520166,\"minimum\":30.37555960680566,\"timestamp\":\"2021-10-17T07:39:34Z\",\"total\":91.11036264186684},{\"P10\":36.67192083110707,\"P25\":62.65168539727135,\"P50\":3.4093968665041996,\"P75\":78.96504998160236,\"P90\":4.7035295542374955,\"P95\":50.50912078405938,\"P99\":10.427507843881445,\"_count\":1598523894,\"average\":15.12342595695616,\"maximum\":19.432482276092266,\"minimum\":91.34410945900252,\"timestamp\":\"2021-02-20T07:39:28Z\",\"total\":59.97652197551595},{\"P10\":48.47039349334206,\"P25\":63.09244445316965,\"P50\":29.357854238883498,\"P75\":15.883120656828853,\"P90\":5.537767964913332,\"P95\":90.31899256760244,\"P99\":54.689904459610595,\"_count\":1503663605,\"average\":7.141991935403757,\"maximum\":71.65750677708897,\"minimum\":42.84988225154861,\"timestamp\":\"2021-09-29T22:31:15Z\",\"total\":37.438362787229764},{\"P10\":4.555754518193844,\"P25\":14.310059546675669,\"P50\":52.89026411578857,\"P75\":88.45675937466628,\"P90\":67.85565441917082,\"P95\":25.303041438388917,\"P99\":3.862214091344207,\"_count\":262450450,\"average\":98.10609502385981,\"maximum\":64.79225903710652,\"minimum\":76.91795283264622,\"timestamp\":\"2021-07-19T17:36:16Z\",\"total\":53.44898249459234}]}],\"nextLink\":\"hujbfwxiplk\"}") + "{\"value\":[{\"startTime\":\"2021-04-22T18:14:39Z\",\"endTime\":\"2021-05-10T21:16:22Z\",\"timeGrain\":\"uxlymsvvyl\",\"unit\":\"Bytes\",\"name\":{\"value\":\"pose\",\"localizedValue\":\"qylmpctwjwdsd\"},\"metricValues\":[{\"P10\":73.99702662134003,\"P25\":12.456049125272074,\"P50\":82.31592373563421,\"P75\":26.660063015264235,\"P90\":64.37382804733916,\"P95\":87.72015066585791,\"P99\":17.025124845271943,\"_count\":79604503,\"average\":58.90907076192157,\"maximum\":13.957951666271951,\"minimum\":84.07992330403323,\"timestamp\":\"2021-01-03T20:16:37Z\",\"total\":61.32128445985037},{\"P10\":22.108949062368843,\"P25\":88.819672245056,\"P50\":97.2903057849265,\"P75\":86.53307087953853,\"P90\":25.25077065862018,\"P95\":64.36229496911817,\"P99\":18.930073005857118,\"_count\":72136036,\"average\":34.497001754317694,\"maximum\":20.341141910746565,\"minimum\":48.05982972533387,\"timestamp\":\"2021-05-18T06:01:13Z\",\"total\":83.13655074175908},{\"P10\":70.74040389790268,\"P25\":56.731493860399716,\"P50\":56.78349242200418,\"P75\":90.54830048109434,\"P90\":33.47340396035976,\"P95\":15.67206033095353,\"P99\":40.40362658461903,\"_count\":1065564623,\"average\":2.942493712899219,\"maximum\":61.595817237410564,\"minimum\":25.60525525371017,\"timestamp\":\"2021-04-16T01:05:58Z\",\"total\":21.0926798140733},{\"P10\":62.68610275297093,\"P25\":92.12711047583126,\"P50\":77.78137779557271,\"P75\":53.782315543757356,\"P90\":92.89932775106047,\"P95\":54.122948046911134,\"P99\":28.975789970455068,\"_count\":1317671905,\"average\":15.781298759362661,\"maximum\":62.850086835659155,\"minimum\":58.74113869294397,\"timestamp\":\"2021-08-02T19:21:07Z\",\"total\":37.63122316034544}]},{\"startTime\":\"2021-02-28T04:48:36Z\",\"endTime\":\"2021-03-07T05:02:06Z\",\"timeGrain\":\"b\",\"unit\":\"Milliseconds\",\"name\":{\"value\":\"weoftnorw\",\"localizedValue\":\"gsioc\"},\"metricValues\":[{\"P10\":26.0879324450472,\"P25\":7.687106439921909,\"P50\":62.27918508727712,\"P75\":0.6493386957915903,\"P90\":39.16443210597941,\"P95\":18.707063276078173,\"P99\":49.745435636628244,\"_count\":450237442,\"average\":4.757861735794799,\"maximum\":40.59101906061947,\"minimum\":32.04469519153963,\"timestamp\":\"2021-05-19T18:12:06Z\",\"total\":47.866777683479064}]}],\"nextLink\":\"xeezwyhjmbjiqe\"}") .toObject(PercentileMetricListResult.class); - Assertions.assertEquals("hujbfwxiplk", model.nextLink()); + Assertions.assertEquals("xeezwyhjmbjiqe", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PercentileMetricValueTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PercentileMetricValueTests.java index b121f82b5dab..edd5b5184d9b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PercentileMetricValueTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PercentileMetricValueTests.java @@ -11,7 +11,7 @@ public final class PercentileMetricValueTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PercentileMetricValue model = BinaryData.fromString( - "{\"P10\":63.77968465908237,\"P25\":2.5061512874545055,\"P50\":34.03433895335557,\"P75\":87.64504939704538,\"P90\":57.87969264066065,\"P95\":9.891967057989149,\"P99\":76.62297043752108,\"_count\":1140565182,\"average\":37.86189912387605,\"maximum\":56.77650599874169,\"minimum\":5.348807869086924,\"timestamp\":\"2021-09-30T07:27:16Z\",\"total\":22.404261438798745}") + "{\"P10\":29.49341661161393,\"P25\":11.620260475444988,\"P50\":48.76577753403948,\"P75\":59.53716417764502,\"P90\":4.510002382718881,\"P95\":16.26511731501229,\"P99\":33.31144289177607,\"_count\":548887082,\"average\":93.6214926994129,\"maximum\":79.88934302750972,\"minimum\":10.00973180608067,\"timestamp\":\"2020-12-25T01:48:22Z\",\"total\":2.911359864913443}") .toObject(PercentileMetricValue.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PermissionTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PermissionTests.java index d8fb40471068..c950dc82a9ec 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PermissionTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PermissionTests.java @@ -13,21 +13,21 @@ public final class PermissionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Permission model = BinaryData.fromString( - "{\"id\":\"knlqwzdvpiwhxqsz\",\"dataActions\":[\"aajquhuxylrj\",\"m\",\"ygjbmzyospspsh\"],\"notDataActions\":[\"kyjpmspbps\",\"df\",\"pyogtieyuj\",\"vczkcnyxrxmunjd\"]}") + "{\"id\":\"gv\",\"dataActions\":[\"c\",\"rkolawjm\"],\"notDataActions\":[\"wro\",\"cdxfzzzwyjafitl\",\"guyn\",\"chl\"]}") .toObject(Permission.class); - Assertions.assertEquals("knlqwzdvpiwhxqsz", model.id()); - Assertions.assertEquals("aajquhuxylrj", model.dataActions().get(0)); - Assertions.assertEquals("kyjpmspbps", model.notDataActions().get(0)); + Assertions.assertEquals("gv", model.id()); + Assertions.assertEquals("c", model.dataActions().get(0)); + Assertions.assertEquals("wro", model.notDataActions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Permission model = new Permission().withId("knlqwzdvpiwhxqsz") - .withDataActions(Arrays.asList("aajquhuxylrj", "m", "ygjbmzyospspsh")) - .withNotDataActions(Arrays.asList("kyjpmspbps", "df", "pyogtieyuj", "vczkcnyxrxmunjd")); + Permission model = new Permission().withId("gv") + .withDataActions(Arrays.asList("c", "rkolawjm")) + .withNotDataActions(Arrays.asList("wro", "cdxfzzzwyjafitl", "guyn", "chl")); model = BinaryData.fromObject(model).toObject(Permission.class); - Assertions.assertEquals("knlqwzdvpiwhxqsz", model.id()); - Assertions.assertEquals("aajquhuxylrj", model.dataActions().get(0)); - Assertions.assertEquals("kyjpmspbps", model.notDataActions().get(0)); + Assertions.assertEquals("gv", model.id()); + Assertions.assertEquals("c", model.dataActions().get(0)); + Assertions.assertEquals("wro", model.notDataActions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionIdTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionIdTests.java new file mode 100644 index 000000000000..031b0e443e10 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionIdTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionId; +import org.junit.jupiter.api.Assertions; + +public final class PhysicalPartitionIdTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PhysicalPartitionId model = BinaryData.fromString("{\"id\":\"oljxkcgx\"}").toObject(PhysicalPartitionId.class); + Assertions.assertEquals("oljxkcgx", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PhysicalPartitionId model = new PhysicalPartitionId().withId("oljxkcgx"); + model = BinaryData.fromObject(model).toObject(PhysicalPartitionId.class); + Assertions.assertEquals("oljxkcgx", model.id()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionStorageInfoCollectionInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionStorageInfoCollectionInnerTests.java new file mode 100644 index 000000000000..ecd96ced91bf --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionStorageInfoCollectionInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionStorageInfoCollectionInner; + +public final class PhysicalPartitionStorageInfoCollectionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PhysicalPartitionStorageInfoCollectionInner model = BinaryData.fromString( + "{\"physicalPartitionStorageInfoCollection\":[{\"id\":\"gc\",\"storageInKB\":72.79027728720618},{\"id\":\"xkr\",\"storageInKB\":81.28285197947493},{\"id\":\"mossxkkgthrrghxj\",\"storageInKB\":98.17414260539508},{\"id\":\"vcxgfrpdsofbshr\",\"storageInKB\":36.937113853003936}]}") + .toObject(PhysicalPartitionStorageInfoCollectionInner.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionStorageInfoTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionStorageInfoTests.java new file mode 100644 index 000000000000..1e70728f159e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionStorageInfoTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionStorageInfo; + +public final class PhysicalPartitionStorageInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PhysicalPartitionStorageInfo model + = BinaryData.fromString("{\"id\":\"swdvzyybycnun\",\"storageInKB\":34.19709445162731}") + .toObject(PhysicalPartitionStorageInfo.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoPropertiesTests.java new file mode 100644 index 000000000000..573059523f41 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoPropertiesTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoProperties; +import org.junit.jupiter.api.Assertions; + +public final class PhysicalPartitionThroughputInfoPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PhysicalPartitionThroughputInfoProperties model = BinaryData.fromString( + "{\"physicalPartitionThroughputInfo\":[{\"id\":\"qbmfpjbabwidf\",\"throughput\":79.43170191885017,\"targetThroughput\":86.16775488908712},{\"id\":\"nnoxyhkx\",\"throughput\":43.476678423469004,\"targetThroughput\":5.1182852267597},{\"id\":\"pfhoqcaaewdao\",\"throughput\":65.57529142031423,\"targetThroughput\":43.00584007765605}]}") + .toObject(PhysicalPartitionThroughputInfoProperties.class); + Assertions.assertEquals("qbmfpjbabwidf", model.physicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(79.43170191885017D, model.physicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(86.16775488908712D, model.physicalPartitionThroughputInfo().get(0).targetThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResourceTests.java new file mode 100644 index 000000000000..1717ad2f6f3a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResourceTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoResource; +import org.junit.jupiter.api.Assertions; + +public final class PhysicalPartitionThroughputInfoResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PhysicalPartitionThroughputInfoResource model = BinaryData + .fromString("{\"id\":\"x\",\"throughput\":9.138733420946,\"targetThroughput\":72.80228952653962}") + .toObject(PhysicalPartitionThroughputInfoResource.class); + Assertions.assertEquals("x", model.id()); + Assertions.assertEquals(9.138733420946D, model.throughput()); + Assertions.assertEquals(72.80228952653962D, model.targetThroughput()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PhysicalPartitionThroughputInfoResource model = new PhysicalPartitionThroughputInfoResource().withId("x") + .withThroughput(9.138733420946D) + .withTargetThroughput(72.80228952653962D); + model = BinaryData.fromObject(model).toObject(PhysicalPartitionThroughputInfoResource.class); + Assertions.assertEquals("x", model.id()); + Assertions.assertEquals(9.138733420946D, model.throughput()); + Assertions.assertEquals(72.80228952653962D, model.targetThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResultInnerTests.java new file mode 100644 index 000000000000..4d4c792a3a80 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResultInnerTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionThroughputInfoResultInner; +import com.azure.resourcemanager.cosmos.models.ResourceIdentityType; +import org.junit.jupiter.api.Assertions; + +public final class PhysicalPartitionThroughputInfoResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PhysicalPartitionThroughputInfoResultInner model = BinaryData.fromString( + "{\"properties\":{\"resource\":{\"physicalPartitionThroughputInfo\":[{\"id\":\"fgcviz\",\"throughput\":12.727461188826371,\"targetThroughput\":41.99490103423182},{\"id\":\"lyoupfgfbkju\",\"throughput\":23.444909469570153,\"targetThroughput\":14.942666272897231},{\"id\":\"minsgowzf\",\"throughput\":68.32672136427793,\"targetThroughput\":48.99178047212348}]}},\"id\":\"ahbqactxtgzuk\",\"name\":\"tmmqtgqqqxhrn\",\"type\":\"xcpjuisavokqdzf\",\"location\":\"zivj\",\"tags\":{\"katnwxyi\":\"qttbaj\",\"igovi\":\"pidkqqfkuvscxkdm\",\"goorbteo\":\"rxkpmloazuruoc\",\"r\":\"bfhjxakvvjgsl\"},\"identity\":{\"principalId\":\"mywwtkgkxnyed\",\"tenantId\":\"gyvudtjuewbc\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"akkud\":{\"principalId\":\"hcjyxc\",\"clientId\":\"bvpa\"},\"bdgiogsjk\":{\"principalId\":\"xgwjplmagstcyoh\",\"clientId\":\"kyrk\"},\"egfnmntfpmvmemfn\":{\"principalId\":\"wqjnob\",\"clientId\":\"yhddvia\"}}}}") + .toObject(PhysicalPartitionThroughputInfoResultInner.class); + Assertions.assertEquals("zivj", model.location()); + Assertions.assertEquals("qttbaj", model.tags().get("katnwxyi")); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("fgcviz", model.resource().physicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(12.727461188826371D, + model.resource().physicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(41.99490103423182D, + model.resource().physicalPartitionThroughputInfo().get(0).targetThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResultPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResultPropertiesResourceTests.java new file mode 100644 index 000000000000..54a40e713fe1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResultPropertiesResourceTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoResultPropertiesResource; +import org.junit.jupiter.api.Assertions; + +public final class PhysicalPartitionThroughputInfoResultPropertiesResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PhysicalPartitionThroughputInfoResultPropertiesResource model = BinaryData.fromString( + "{\"physicalPartitionThroughputInfo\":[{\"id\":\"zevwrdnhfukuv\",\"throughput\":60.18370441546978,\"targetThroughput\":78.14299799052034},{\"id\":\"ystuluqyp\",\"throughput\":91.52743727265039,\"targetThroughput\":95.67658997616351}]}") + .toObject(PhysicalPartitionThroughputInfoResultPropertiesResource.class); + Assertions.assertEquals("zevwrdnhfukuv", model.physicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(60.18370441546978D, model.physicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(78.14299799052034D, model.physicalPartitionThroughputInfo().get(0).targetThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResultPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResultPropertiesTests.java new file mode 100644 index 000000000000..ebf534f80ba7 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PhysicalPartitionThroughputInfoResultPropertiesTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionThroughputInfoResultProperties; +import org.junit.jupiter.api.Assertions; + +public final class PhysicalPartitionThroughputInfoResultPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PhysicalPartitionThroughputInfoResultProperties model = BinaryData.fromString( + "{\"resource\":{\"physicalPartitionThroughputInfo\":[{\"id\":\"vvbalx\",\"throughput\":81.85403519537418,\"targetThroughput\":68.9392458337437}]}}") + .toObject(PhysicalPartitionThroughputInfoResultProperties.class); + Assertions.assertEquals("vvbalx", model.resource().physicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(81.85403519537418D, + model.resource().physicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(68.9392458337437D, + model.resource().physicalPartitionThroughputInfo().get(0).targetThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionListResultTests.java index 645517f113ad..44bd204d6c00 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionListResultTests.java @@ -12,13 +12,14 @@ public final class PrivateEndpointConnectionListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"cauwazcgwdfriwg\"},\"privateLinkServiceConnectionState\":{\"status\":\"pozo\",\"description\":\"cvgllixdg\",\"actionsRequired\":\"fgw\"},\"groupId\":\"qkjvxprwpxsoohu\",\"provisioningState\":\"lcsklt\"},\"id\":\"uugggzlfbgrd\",\"name\":\"gubsrtmdylpe\",\"type\":\"pilttjzgc\"}],\"nextLink\":\"cmfpfbodet\"}") + "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"tdscnkzzohnrdd\"},\"privateLinkServiceConnectionState\":{\"status\":\"eqozrehlbz\",\"description\":\"xbnjrqvzyuexoz\",\"actionsRequired\":\"ynp\"},\"groupId\":\"eudpab\",\"provisioningState\":\"euwzosgyjxvc\"},\"id\":\"sormrex\",\"name\":\"vdubew\",\"type\":\"zygba\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"covsdqhzrtd\"},\"privateLinkServiceConnectionState\":{\"status\":\"rlimzfvppkeqs\",\"description\":\"jmcl\",\"actionsRequired\":\"ygnhrkombc\"},\"groupId\":\"ajdopggor\",\"provisioningState\":\"oqtrotpvclpo\"},\"id\":\"rlmw\",\"name\":\"ptskwxjgvhxccb\",\"type\":\"kakmkookbputmgvm\"}],\"nextLink\":\"akmlwktfowzkroyr\"}") .toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals("cauwazcgwdfriwg", model.value().get(0).privateEndpoint().id()); - Assertions.assertEquals("pozo", model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("cvgllixdg", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("qkjvxprwpxsoohu", model.value().get(0).groupId()); - Assertions.assertEquals("lcsklt", model.value().get(0).provisioningState()); - Assertions.assertEquals("cmfpfbodet", model.nextLink()); + Assertions.assertEquals("tdscnkzzohnrdd", model.value().get(0).privateEndpoint().id()); + Assertions.assertEquals("eqozrehlbz", model.value().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("xbnjrqvzyuexoz", + model.value().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals("eudpab", model.value().get(0).groupId()); + Assertions.assertEquals("euwzosgyjxvc", model.value().get(0).provisioningState()); + Assertions.assertEquals("akmlwktfowzkroyr", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourceInnerTests.java index d5723317d543..cad9d491b1a2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourceInnerTests.java @@ -11,7 +11,7 @@ public final class PrivateLinkResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResourceInner model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"rgvtsh\",\"requiredMembers\":[\"t\"],\"requiredZoneNames\":[\"vmuqke\",\"zgjypanhxmpdxxz\",\"twwzjw\",\"tnxlkfhglhr\"]},\"id\":\"x\",\"name\":\"wecr\",\"type\":\"nhpcselqx\"}") + "{\"properties\":{\"groupId\":\"xflzqjim\",\"requiredMembers\":[\"gzjxxlf\"],\"requiredZoneNames\":[\"zuqloiwyayyzivr\",\"itcdqlhchwhrk\",\"jlei\",\"ibfiplhxfnsm\"]},\"id\":\"jow\",\"name\":\"yeyzm\",\"type\":\"dsqcmhnxl\"}") .toObject(PrivateLinkResourceInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourceListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourceListResultTests.java index d73c08d186f9..883c1f278762 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourceListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourceListResultTests.java @@ -12,8 +12,8 @@ public final class PrivateLinkResourceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"xlyzkxit\",\"requiredMembers\":[\"ezsvkolrupjov\",\"ozsaye\",\"razwzlpzbt\",\"uykykipfsd\"],\"requiredZoneNames\":[\"fnocmbe\",\"acfpztgazwyqej\"]},\"id\":\"aokctgkp\",\"name\":\"gkqzkcyzmffngdyf\",\"type\":\"ixrhl\"},{\"properties\":{\"groupId\":\"hoe\",\"requiredMembers\":[\"iutg\",\"rmk\",\"hpqhazyntacihn\",\"ogmipnmliqmvl\"],\"requiredZoneNames\":[\"ke\"]},\"id\":\"grvgpomxp\",\"name\":\"pdtsdfjyiesocwi\",\"type\":\"bu\"}],\"nextLink\":\"tmpyzgleofjsb\"}") + "{\"value\":[{\"properties\":{\"groupId\":\"dllc\",\"requiredMembers\":[\"rwnhkgqggoxsst\",\"ivrakfrryn\",\"cwmhlymgnukxrk\",\"mjpequlr\"],\"requiredZoneNames\":[\"udgjtfb\",\"lakkucddwnhcz\",\"utoucgjt\",\"rjwayhicqq\"]},\"id\":\"v\",\"name\":\"wkslvlized\",\"type\":\"biabvnsrgekz\"},{\"properties\":{\"groupId\":\"adyfhbmwkho\",\"requiredMembers\":[\"tbspvkhglaqjs\",\"yzstujrzxrkns\"],\"requiredZoneNames\":[\"lduyehiiittugyuq\",\"rldaxurfqa\",\"csozjv\",\"dzciggb\"]},\"id\":\"txofw\",\"name\":\"lzy\",\"type\":\"whoea\"},{\"properties\":{\"groupId\":\"obdoey\",\"requiredMembers\":[\"nimtwuuhaueg\",\"kwmnfeub\",\"zjy\"],\"requiredZoneNames\":[\"fugiphrrkuu\",\"nqd\"]},\"id\":\"hz\",\"name\":\"fopueoqusvwluj\",\"type\":\"pwnibittozt\"},{\"properties\":{\"groupId\":\"u\",\"requiredMembers\":[\"fmwc\",\"ddtgctxegtvgwy\",\"rbelfnzz\"],\"requiredZoneNames\":[\"zwbxgdebxlayuno\",\"irhpfabenq\"]},\"id\":\"mwmgewayxfl\",\"name\":\"bcpjstbhem\",\"type\":\"cucsqsnxfbxu\"}],\"nextLink\":\"apdrbzyvbsuadu\"}") .toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("tmpyzgleofjsb", model.nextLink()); + Assertions.assertEquals("apdrbzyvbsuadu", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcePropertiesTests.java index cb262e09cc88..d4d4ab21f379 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcePropertiesTests.java @@ -10,8 +10,9 @@ public final class PrivateLinkResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"ppqib\",\"requiredMembers\":[\"lvzrlrmlcc\",\"etjsczivfqbqna\"],\"requiredZoneNames\":[\"yenzsieuscpl\"]}") + PrivateLinkResourceProperties model = BinaryData + .fromString( + "{\"groupId\":\"uwod\",\"requiredMembers\":[\"hbkvn\"],\"requiredZoneNames\":[\"j\",\"mvgoqpleh\"]}") .toObject(PrivateLinkResourceProperties.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivilegeResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivilegeResourceTests.java index b37814a73e4c..129500919ed5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivilegeResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivilegeResourceTests.java @@ -11,18 +11,17 @@ public final class PrivilegeResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivilegeResource model - = BinaryData.fromString("{\"db\":\"dhxiidlopedbwd\",\"collection\":\"qyybxubmdnafcbq\"}") - .toObject(PrivilegeResource.class); - Assertions.assertEquals("dhxiidlopedbwd", model.db()); - Assertions.assertEquals("qyybxubmdnafcbq", model.collection()); + PrivilegeResource model = BinaryData.fromString("{\"db\":\"gbdg\",\"collection\":\"mgxdgdhpabgd\"}") + .toObject(PrivilegeResource.class); + Assertions.assertEquals("gbdg", model.db()); + Assertions.assertEquals("mgxdgdhpabgd", model.collection()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivilegeResource model = new PrivilegeResource().withDb("dhxiidlopedbwd").withCollection("qyybxubmdnafcbq"); + PrivilegeResource model = new PrivilegeResource().withDb("gbdg").withCollection("mgxdgdhpabgd"); model = BinaryData.fromObject(model).toObject(PrivilegeResource.class); - Assertions.assertEquals("dhxiidlopedbwd", model.db()); - Assertions.assertEquals("qyybxubmdnafcbq", model.collection()); + Assertions.assertEquals("gbdg", model.db()); + Assertions.assertEquals("mgxdgdhpabgd", model.collection()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivilegeTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivilegeTests.java index f6bad0db862e..c86521dc369b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivilegeTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/PrivilegeTests.java @@ -14,21 +14,21 @@ public final class PrivilegeTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Privilege model = BinaryData.fromString( - "{\"resource\":{\"db\":\"jadhqoawj\",\"collection\":\"yueayfbpcmsp\"},\"actions\":[\"rrueqthwmg\",\"mbscbbx\"]}") + "{\"resource\":{\"db\":\"dsmjtgr\",\"collection\":\"dgkkile\"},\"actions\":[\"csmknhwt\",\"baedorvvmqfl\"]}") .toObject(Privilege.class); - Assertions.assertEquals("jadhqoawj", model.resource().db()); - Assertions.assertEquals("yueayfbpcmsp", model.resource().collection()); - Assertions.assertEquals("rrueqthwmg", model.actions().get(0)); + Assertions.assertEquals("dsmjtgr", model.resource().db()); + Assertions.assertEquals("dgkkile", model.resource().collection()); + Assertions.assertEquals("csmknhwt", model.actions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { Privilege model - = new Privilege().withResource(new PrivilegeResource().withDb("jadhqoawj").withCollection("yueayfbpcmsp")) - .withActions(Arrays.asList("rrueqthwmg", "mbscbbx")); + = new Privilege().withResource(new PrivilegeResource().withDb("dsmjtgr").withCollection("dgkkile")) + .withActions(Arrays.asList("csmknhwt", "baedorvvmqfl")); model = BinaryData.fromObject(model).toObject(Privilege.class); - Assertions.assertEquals("jadhqoawj", model.resource().db()); - Assertions.assertEquals("yueayfbpcmsp", model.resource().collection()); - Assertions.assertEquals("rrueqthwmg", model.actions().get(0)); + Assertions.assertEquals("dsmjtgr", model.resource().db()); + Assertions.assertEquals("dgkkile", model.resource().collection()); + Assertions.assertEquals("csmknhwt", model.actions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ProvisioningIssuePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ProvisioningIssuePropertiesTests.java new file mode 100644 index 000000000000..b6911add0f5c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ProvisioningIssuePropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.ProvisioningIssueProperties; + +public final class ProvisioningIssuePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProvisioningIssueProperties model = BinaryData.fromString( + "{\"issueType\":\"MissingPerimeterConfiguration\",\"severity\":\"Warning\",\"description\":\"ikcdgfhbssd\",\"suggestedResourceIds\":[\"yoqxdedecfiwhag\"],\"suggestedAccessRules\":[{\"name\":\"ejqrshzzbgullcxi\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"xdupnamg\"],\"subscriptions\":[{\"id\":\"i\"},{\"id\":\"mfivjqterd\"},{\"id\":\"igdyd\"},{\"id\":\"hpcvr\"}],\"networkSecurityPerimeters\":[{\"id\":\"vtktyhh\",\"perimeterGuid\":\"fxlapjajodmkrrw\",\"location\":\"gqvqokqluj\"}],\"fullyQualifiedDomainNames\":[\"rabwlyvxc\"],\"emailAddresses\":[\"vctsfaeuhw\",\"s\"],\"phoneNumbers\":[\"tvzuzhasup\",\"lppdpgz\",\"zqazvb\",\"arkptgongruatsyi\"]}},{\"name\":\"jqhenigb\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"aby\"],\"subscriptions\":[{\"id\":\"ysc\"},{\"id\":\"ydzjemexm\"}],\"networkSecurityPerimeters\":[{\"id\":\"muwrx\",\"perimeterGuid\":\"iwm\",\"location\":\"m\"},{\"id\":\"dlhvdv\",\"perimeterGuid\":\"phbeaeqjz\",\"location\":\"kdclacroczf\"},{\"id\":\"ner\",\"perimeterGuid\":\"luxzshxzezbzuzu\",\"location\":\"evzske\"},{\"id\":\"gwfsgqkstyecupyu\",\"perimeterGuid\":\"p\",\"location\":\"davsjcfmazpz\"}],\"fullyQualifiedDomainNames\":[\"uzvcmcok\",\"izekuvfrj\",\"ucaonz\",\"ajbvbn\"],\"emailAddresses\":[\"emdidac\",\"zidgzwd\",\"damisvpztdi\"],\"phoneNumbers\":[\"pxkqejtpjfojiunr\",\"shxuknsykdtoi\",\"oancdrco\",\"nvxuldxonckb\"]}},{\"name\":\"blfxlupibaqzi\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"eghlw\",\"bogvgfklqiy\",\"dve\",\"elsbfvd\"],\"subscriptions\":[{\"id\":\"zxsgtznsv\"}],\"networkSecurityPerimeters\":[{\"id\":\"movpimyndnoxax\",\"perimeterGuid\":\"qaqotnn\",\"location\":\"olousdvrg\"},{\"id\":\"qmawzjdrpizfu\",\"perimeterGuid\":\"yctsdbtqgkuj\",\"location\":\"ooxrqwoeurb\"},{\"id\":\"gapdyarikeej\",\"perimeterGuid\":\"dfhtwmmkfqbriqul\",\"location\":\"trj\"}],\"fullyQualifiedDomainNames\":[\"kvyhzokpoyu\",\"h\",\"ensnaa\",\"phmpoejnglpwsada\"],\"emailAddresses\":[\"umxpezcoi\",\"yjrmfqzwqd\",\"xkeedcnwmy\",\"xfqzkvemyzd\"],\"phoneNumbers\":[\"aqpqifdbm\",\"trwtxzuisam\"]}}]}") + .toObject(ProvisioningIssueProperties.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ProvisioningIssueTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ProvisioningIssueTests.java new file mode 100644 index 000000000000..58b88c7b0e9c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ProvisioningIssueTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.ProvisioningIssue; + +public final class ProvisioningIssueTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProvisioningIssue model = BinaryData.fromString( + "{\"name\":\"oygizmsh\",\"properties\":{\"issueType\":\"ConfigurationPropagationFailure\",\"severity\":\"Error\",\"description\":\"bulnvgskjtoxjdz\",\"suggestedResourceIds\":[\"znvhxqqmq\",\"paydhfn\",\"ocxm\"],\"suggestedAccessRules\":[{\"name\":\"k\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"pamwbw\",\"bnl\",\"lcefiqdktw\"],\"subscriptions\":[{},{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"fliwoynguuzhwvl\",\"dpcmhjh\"],\"emailAddresses\":[\"ybkekym\",\"fztsi\",\"sc\"],\"phoneNumbers\":[\"yeiihfymkou\",\"h\"]}},{\"name\":\"seuugcig\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"gbvm\",\"dwrqbeb\",\"nfvegl\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{},{},{}],\"fullyQualifiedDomainNames\":[\"wznhtfgfic\",\"dyhi\"],\"emailAddresses\":[\"czmuhbca\",\"znhokhoitwhrjsd\"],\"phoneNumbers\":[\"zdnckidbj\",\"glhzqp\"]}}]}}") + .toObject(ProvisioningIssue.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RedistributeThroughputParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RedistributeThroughputParametersTests.java new file mode 100644 index 000000000000..ee94c88d61c8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RedistributeThroughputParametersTests.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentityUserAssignedIdentities; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoResource; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputPropertiesResource; +import com.azure.resourcemanager.cosmos.models.ResourceIdentityType; +import com.azure.resourcemanager.cosmos.models.ThroughputPolicyType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class RedistributeThroughputParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RedistributeThroughputParameters model = BinaryData.fromString( + "{\"properties\":{\"resource\":{\"throughputPolicy\":\"custom\",\"targetPhysicalPartitionThroughputInfo\":[{\"id\":\"ivsiy\",\"throughput\":30.264489679405138,\"targetThroughput\":19.597565100154846},{\"id\":\"dxonbzoggculap\",\"throughput\":5.8079668606543455,\"targetThroughput\":76.8295269366905},{\"id\":\"gtqxep\",\"throughput\":23.087069470393363,\"targetThroughput\":33.73918507647764}],\"sourcePhysicalPartitionThroughputInfo\":[{\"id\":\"lyjt\",\"throughput\":6.513739092255455,\"targetThroughput\":88.02246551797843},{\"id\":\"vfcibyfmowux\",\"throughput\":24.26975275171236,\"targetThroughput\":24.18823544885711},{\"id\":\"xfzwi\",\"throughput\":26.946702813020874,\"targetThroughput\":45.89592766991593}]}},\"id\":\"zsxjrkambtrneg\",\"name\":\"nvuqeqvldspa\",\"type\":\"jbkkdmflvestmjl\",\"location\":\"ril\",\"tags\":{\"kuziycsle\":\"peewchpxlkt\",\"dcgzul\":\"ufuztcktyhjtq\",\"rr\":\"mmrqz\"},\"identity\":{\"principalId\":\"gl\",\"tenantId\":\"zgkrvqe\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"wytpzdmovz\":{\"principalId\":\"r\",\"clientId\":\"t\"}}}}") + .toObject(RedistributeThroughputParameters.class); + Assertions.assertEquals("ril", model.location()); + Assertions.assertEquals("peewchpxlkt", model.tags().get("kuziycsle")); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals(ThroughputPolicyType.CUSTOM, model.resource().throughputPolicy()); + Assertions.assertEquals("ivsiy", model.resource().targetPhysicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(30.264489679405138D, + model.resource().targetPhysicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(19.597565100154846D, + model.resource().targetPhysicalPartitionThroughputInfo().get(0).targetThroughput()); + Assertions.assertEquals("lyjt", model.resource().sourcePhysicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(6.513739092255455D, + model.resource().sourcePhysicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(88.02246551797843D, + model.resource().sourcePhysicalPartitionThroughputInfo().get(0).targetThroughput()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RedistributeThroughputParameters model = new RedistributeThroughputParameters().withLocation("ril") + .withTags(mapOf("kuziycsle", "peewchpxlkt", "dcgzul", "ufuztcktyhjtq", "rr", "mmrqz")) + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("wytpzdmovz", new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource( + new RedistributeThroughputPropertiesResource().withThroughputPolicy(ThroughputPolicyType.CUSTOM) + .withTargetPhysicalPartitionThroughputInfo(Arrays.asList( + new PhysicalPartitionThroughputInfoResource().withId("ivsiy") + .withThroughput(30.264489679405138D) + .withTargetThroughput(19.597565100154846D), + new PhysicalPartitionThroughputInfoResource().withId("dxonbzoggculap") + .withThroughput(5.8079668606543455D) + .withTargetThroughput(76.8295269366905D), + new PhysicalPartitionThroughputInfoResource().withId("gtqxep") + .withThroughput(23.087069470393363D) + .withTargetThroughput(33.73918507647764D))) + .withSourcePhysicalPartitionThroughputInfo(Arrays.asList( + new PhysicalPartitionThroughputInfoResource().withId("lyjt") + .withThroughput(6.513739092255455D) + .withTargetThroughput(88.02246551797843D), + new PhysicalPartitionThroughputInfoResource().withId("vfcibyfmowux") + .withThroughput(24.26975275171236D) + .withTargetThroughput(24.18823544885711D), + new PhysicalPartitionThroughputInfoResource().withId("xfzwi") + .withThroughput(26.946702813020874D) + .withTargetThroughput(45.89592766991593D)))); + model = BinaryData.fromObject(model).toObject(RedistributeThroughputParameters.class); + Assertions.assertEquals("ril", model.location()); + Assertions.assertEquals("peewchpxlkt", model.tags().get("kuziycsle")); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals(ThroughputPolicyType.CUSTOM, model.resource().throughputPolicy()); + Assertions.assertEquals("ivsiy", model.resource().targetPhysicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(30.264489679405138D, + model.resource().targetPhysicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(19.597565100154846D, + model.resource().targetPhysicalPartitionThroughputInfo().get(0).targetThroughput()); + Assertions.assertEquals("lyjt", model.resource().sourcePhysicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(6.513739092255455D, + model.resource().sourcePhysicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(88.02246551797843D, + model.resource().sourcePhysicalPartitionThroughputInfo().get(0).targetThroughput()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RedistributeThroughputPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RedistributeThroughputPropertiesResourceTests.java new file mode 100644 index 000000000000..f2c8e49e44ec --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RedistributeThroughputPropertiesResourceTests.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoResource; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputPropertiesResource; +import com.azure.resourcemanager.cosmos.models.ThroughputPolicyType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RedistributeThroughputPropertiesResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RedistributeThroughputPropertiesResource model = BinaryData.fromString( + "{\"throughputPolicy\":\"none\",\"targetPhysicalPartitionThroughputInfo\":[{\"id\":\"kciayzri\",\"throughput\":14.305485251419691,\"targetThroughput\":12.333570201668898}],\"sourcePhysicalPartitionThroughputInfo\":[{\"id\":\"jlb\",\"throughput\":55.698513244879855,\"targetThroughput\":71.91166954341196},{\"id\":\"mxho\",\"throughput\":56.960297779612404,\"targetThroughput\":48.65698040013442},{\"id\":\"digumbnr\",\"throughput\":73.39891966228774,\"targetThroughput\":0.3636152936608239}]}") + .toObject(RedistributeThroughputPropertiesResource.class); + Assertions.assertEquals(ThroughputPolicyType.NONE, model.throughputPolicy()); + Assertions.assertEquals("kciayzri", model.targetPhysicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(14.305485251419691D, model.targetPhysicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(12.333570201668898D, + model.targetPhysicalPartitionThroughputInfo().get(0).targetThroughput()); + Assertions.assertEquals("jlb", model.sourcePhysicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(55.698513244879855D, model.sourcePhysicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(71.91166954341196D, + model.sourcePhysicalPartitionThroughputInfo().get(0).targetThroughput()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RedistributeThroughputPropertiesResource model + = new RedistributeThroughputPropertiesResource().withThroughputPolicy(ThroughputPolicyType.NONE) + .withTargetPhysicalPartitionThroughputInfo( + Arrays.asList(new PhysicalPartitionThroughputInfoResource().withId("kciayzri") + .withThroughput(14.305485251419691D) + .withTargetThroughput(12.333570201668898D))) + .withSourcePhysicalPartitionThroughputInfo(Arrays.asList( + new PhysicalPartitionThroughputInfoResource().withId("jlb") + .withThroughput(55.698513244879855D) + .withTargetThroughput(71.91166954341196D), + new PhysicalPartitionThroughputInfoResource().withId("mxho") + .withThroughput(56.960297779612404D) + .withTargetThroughput(48.65698040013442D), + new PhysicalPartitionThroughputInfoResource().withId("digumbnr") + .withThroughput(73.39891966228774D) + .withTargetThroughput(0.3636152936608239D))); + model = BinaryData.fromObject(model).toObject(RedistributeThroughputPropertiesResource.class); + Assertions.assertEquals(ThroughputPolicyType.NONE, model.throughputPolicy()); + Assertions.assertEquals("kciayzri", model.targetPhysicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(14.305485251419691D, model.targetPhysicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(12.333570201668898D, + model.targetPhysicalPartitionThroughputInfo().get(0).targetThroughput()); + Assertions.assertEquals("jlb", model.sourcePhysicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(55.698513244879855D, model.sourcePhysicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(71.91166954341196D, + model.sourcePhysicalPartitionThroughputInfo().get(0).targetThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RedistributeThroughputPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RedistributeThroughputPropertiesTests.java new file mode 100644 index 000000000000..b72ffaebe608 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RedistributeThroughputPropertiesTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.RedistributeThroughputProperties; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoResource; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputPropertiesResource; +import com.azure.resourcemanager.cosmos.models.ThroughputPolicyType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RedistributeThroughputPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RedistributeThroughputProperties model = BinaryData.fromString( + "{\"resource\":{\"throughputPolicy\":\"custom\",\"targetPhysicalPartitionThroughputInfo\":[{\"id\":\"aawzqadfl\",\"throughput\":7.41119746224509,\"targetThroughput\":24.852266513668518}],\"sourcePhysicalPartitionThroughputInfo\":[{\"id\":\"ecxn\",\"throughput\":37.48406959236371,\"targetThroughput\":39.37440836434975},{\"id\":\"vzm\",\"throughput\":1.2552182136844836,\"targetThroughput\":60.32103401072961},{\"id\":\"x\",\"throughput\":76.44003989951182,\"targetThroughput\":41.049279980939666}]}}") + .toObject(RedistributeThroughputProperties.class); + Assertions.assertEquals(ThroughputPolicyType.CUSTOM, model.resource().throughputPolicy()); + Assertions.assertEquals("aawzqadfl", model.resource().targetPhysicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(7.41119746224509D, + model.resource().targetPhysicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(24.852266513668518D, + model.resource().targetPhysicalPartitionThroughputInfo().get(0).targetThroughput()); + Assertions.assertEquals("ecxn", model.resource().sourcePhysicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(37.48406959236371D, + model.resource().sourcePhysicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(39.37440836434975D, + model.resource().sourcePhysicalPartitionThroughputInfo().get(0).targetThroughput()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RedistributeThroughputProperties model = new RedistributeThroughputProperties().withResource( + new RedistributeThroughputPropertiesResource().withThroughputPolicy(ThroughputPolicyType.CUSTOM) + .withTargetPhysicalPartitionThroughputInfo( + Arrays.asList(new PhysicalPartitionThroughputInfoResource().withId("aawzqadfl") + .withThroughput(7.41119746224509D) + .withTargetThroughput(24.852266513668518D))) + .withSourcePhysicalPartitionThroughputInfo(Arrays.asList( + new PhysicalPartitionThroughputInfoResource().withId("ecxn") + .withThroughput(37.48406959236371D) + .withTargetThroughput(39.37440836434975D), + new PhysicalPartitionThroughputInfoResource().withId("vzm") + .withThroughput(1.2552182136844836D) + .withTargetThroughput(60.32103401072961D), + new PhysicalPartitionThroughputInfoResource().withId("x") + .withThroughput(76.44003989951182D) + .withTargetThroughput(41.049279980939666D)))); + model = BinaryData.fromObject(model).toObject(RedistributeThroughputProperties.class); + Assertions.assertEquals(ThroughputPolicyType.CUSTOM, model.resource().throughputPolicy()); + Assertions.assertEquals("aawzqadfl", model.resource().targetPhysicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(7.41119746224509D, + model.resource().targetPhysicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(24.852266513668518D, + model.resource().targetPhysicalPartitionThroughputInfo().get(0).targetThroughput()); + Assertions.assertEquals("ecxn", model.resource().sourcePhysicalPartitionThroughputInfo().get(0).id()); + Assertions.assertEquals(37.48406959236371D, + model.resource().sourcePhysicalPartitionThroughputInfo().get(0).throughput()); + Assertions.assertEquals(39.37440836434975D, + model.resource().sourcePhysicalPartitionThroughputInfo().get(0).targetThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RegionForOnlineOfflineTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RegionForOnlineOfflineTests.java index ed8dace0734e..a278f9911322 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RegionForOnlineOfflineTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RegionForOnlineOfflineTests.java @@ -12,14 +12,14 @@ public final class RegionForOnlineOfflineTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RegionForOnlineOffline model - = BinaryData.fromString("{\"region\":\"wkfvhqcrailvp\"}").toObject(RegionForOnlineOffline.class); - Assertions.assertEquals("wkfvhqcrailvp", model.region()); + = BinaryData.fromString("{\"region\":\"aqolbgycduiertg\"}").toObject(RegionForOnlineOffline.class); + Assertions.assertEquals("aqolbgycduiertg", model.region()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RegionForOnlineOffline model = new RegionForOnlineOffline().withRegion("wkfvhqcrailvp"); + RegionForOnlineOffline model = new RegionForOnlineOffline().withRegion("aqolbgycduiertg"); model = BinaryData.fromObject(model).toObject(RegionForOnlineOffline.class); - Assertions.assertEquals("wkfvhqcrailvp", model.region()); + Assertions.assertEquals("aqolbgycduiertg", model.region()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RegionalServiceResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RegionalServiceResourceTests.java index a5ccbd4c9228..8aeb39362539 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RegionalServiceResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RegionalServiceResourceTests.java @@ -11,7 +11,7 @@ public final class RegionalServiceResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RegionalServiceResource model - = BinaryData.fromString("{\"name\":\"omfpb\",\"location\":\"eegvyieztkutnj\",\"status\":\"Stopped\"}") + = BinaryData.fromString("{\"name\":\"uifkzqqhb\",\"location\":\"loilmkfbeo\",\"status\":\"Error\"}") .toObject(RegionalServiceResource.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ResourceAssociationTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ResourceAssociationTests.java new file mode 100644 index 000000000000..e721dc2a3afa --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ResourceAssociationTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.ResourceAssociation; +import com.azure.resourcemanager.cosmos.models.ResourceAssociationAccessMode; +import org.junit.jupiter.api.Assertions; + +public final class ResourceAssociationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceAssociation model = BinaryData.fromString("{\"name\":\"svavlrxikjmoy\",\"accessMode\":\"Audit\"}") + .toObject(ResourceAssociation.class); + Assertions.assertEquals("svavlrxikjmoy", model.name()); + Assertions.assertEquals(ResourceAssociationAccessMode.AUDIT, model.accessMode()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ResourceRestoreParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ResourceRestoreParametersTests.java index 7c4801a7b8fd..34cf875def75 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ResourceRestoreParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ResourceRestoreParametersTests.java @@ -13,21 +13,21 @@ public final class ResourceRestoreParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ResourceRestoreParameters model = BinaryData.fromString( - "{\"restoreSource\":\"r\",\"restoreTimestampInUtc\":\"2021-10-30T18:40:51Z\",\"restoreWithTtlDisabled\":true}") + "{\"restoreSource\":\"qek\",\"restoreTimestampInUtc\":\"2021-04-24T05:25:21Z\",\"restoreWithTtlDisabled\":false}") .toObject(ResourceRestoreParameters.class); - Assertions.assertEquals("r", model.restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T18:40:51Z"), model.restoreTimestampInUtc()); - Assertions.assertTrue(model.restoreWithTtlDisabled()); + Assertions.assertEquals("qek", model.restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T05:25:21Z"), model.restoreTimestampInUtc()); + Assertions.assertFalse(model.restoreWithTtlDisabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceRestoreParameters model = new ResourceRestoreParameters().withRestoreSource("r") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-10-30T18:40:51Z")) - .withRestoreWithTtlDisabled(true); + ResourceRestoreParameters model = new ResourceRestoreParameters().withRestoreSource("qek") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-04-24T05:25:21Z")) + .withRestoreWithTtlDisabled(false); model = BinaryData.fromObject(model).toObject(ResourceRestoreParameters.class); - Assertions.assertEquals("r", model.restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T18:40:51Z"), model.restoreTimestampInUtc()); - Assertions.assertTrue(model.restoreWithTtlDisabled()); + Assertions.assertEquals("qek", model.restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T05:25:21Z"), model.restoreTimestampInUtc()); + Assertions.assertFalse(model.restoreWithTtlDisabled()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountGetResultInnerTests.java index bbde61e0163a..4c974419c886 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountGetResultInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountGetResultInnerTests.java @@ -13,12 +13,12 @@ public final class RestorableDatabaseAccountGetResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableDatabaseAccountGetResultInner model = BinaryData.fromString( - "{\"properties\":{\"accountName\":\"cstu\",\"creationTime\":\"2021-07-03T20:06:36Z\",\"oldestRestorableTime\":\"2021-04-30T06:39:11Z\",\"deletionTime\":\"2021-03-10T18:00:39Z\",\"apiType\":\"GremlinV2\",\"restorableLocations\":[{\"locationName\":\"ich\",\"regionalDatabaseAccountInstanceId\":\"sysmvxodgw\",\"creationTime\":\"2021-05-12T18:30:37Z\",\"deletionTime\":\"2021-01-18T02:37:15Z\"},{\"locationName\":\"fcuvbdujgcwx\",\"regionalDatabaseAccountInstanceId\":\"cbbwjtrdxriz\",\"creationTime\":\"2021-08-26T17:56:52Z\",\"deletionTime\":\"2021-11-07T06:36:39Z\"}]},\"location\":\"arksykpgdq\",\"id\":\"abzrwiqrxha\",\"name\":\"lcdosqkpt\",\"type\":\"qgki\"}") + "{\"properties\":{\"accountName\":\"jpch\",\"creationTime\":\"2021-11-14T14:50:56Z\",\"oldestRestorableTime\":\"2021-04-02T00:33:46Z\",\"deletionTime\":\"2020-12-21T03:15:31Z\",\"apiType\":\"GremlinV2\",\"restorableLocations\":[{\"locationName\":\"owuywevtjrie\",\"regionalDatabaseAccountInstanceId\":\"mwlaoklfnis\",\"creationTime\":\"2021-08-22T00:20:17Z\",\"deletionTime\":\"2021-07-11T02:42:20Z\"},{\"locationName\":\"mtredscnnstjc\",\"regionalDatabaseAccountInstanceId\":\"uvtzrxzhclec\",\"creationTime\":\"2021-02-03T12:47:34Z\",\"deletionTime\":\"2021-04-20T14:45:47Z\"},{\"locationName\":\"cloyhy\",\"regionalDatabaseAccountInstanceId\":\"gi\",\"creationTime\":\"2021-06-25T15:50:43Z\",\"deletionTime\":\"2021-09-01T17:58:46Z\"}]},\"location\":\"esgzs\",\"id\":\"mwb\",\"name\":\"orj\",\"type\":\"lb\"}") .toObject(RestorableDatabaseAccountGetResultInner.class); - Assertions.assertEquals("arksykpgdq", model.location()); - Assertions.assertEquals("cstu", model.accountName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-03T20:06:36Z"), model.creationTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T06:39:11Z"), model.oldestRestorableTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-10T18:00:39Z"), model.deletionTime()); + Assertions.assertEquals("esgzs", model.location()); + Assertions.assertEquals("jpch", model.accountName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-14T14:50:56Z"), model.creationTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-02T00:33:46Z"), model.oldestRestorableTime()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T03:15:31Z"), model.deletionTime()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountPropertiesTests.java index b798530064d2..9671cb76e05f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountPropertiesTests.java @@ -13,11 +13,11 @@ public final class RestorableDatabaseAccountPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableDatabaseAccountProperties model = BinaryData.fromString( - "{\"accountName\":\"mainwhed\",\"creationTime\":\"2021-08-28T14:00:16Z\",\"oldestRestorableTime\":\"2021-11-24T07:15:35Z\",\"deletionTime\":\"2020-12-28T12:47:32Z\",\"apiType\":\"Table\",\"restorableLocations\":[{\"locationName\":\"izazz\",\"regionalDatabaseAccountInstanceId\":\"wgvydjufb\",\"creationTime\":\"2021-02-13T16:28:56Z\",\"deletionTime\":\"2021-05-16T04:49:21Z\"},{\"locationName\":\"xpegj\",\"regionalDatabaseAccountInstanceId\":\"abalfdxaglz\",\"creationTime\":\"2021-05-27T21:06:24Z\",\"deletionTime\":\"2021-07-31T21:27:41Z\"},{\"locationName\":\"lqhopxouvmrs\",\"regionalDatabaseAccountInstanceId\":\"likyypzkgxfxfmyr\",\"creationTime\":\"2021-04-19T01:47:58Z\",\"deletionTime\":\"2021-03-28T18:58:57Z\"}]}") + "{\"accountName\":\"ychakvy\",\"creationTime\":\"2021-09-02T00:07:47Z\",\"oldestRestorableTime\":\"2021-03-01T17:50:02Z\",\"deletionTime\":\"2021-10-12T10:09:20Z\",\"apiType\":\"Cassandra\",\"restorableLocations\":[{\"locationName\":\"iuepmaxfnzlpqmp\",\"regionalDatabaseAccountInstanceId\":\"xef\",\"creationTime\":\"2021-10-06T02:03:12Z\",\"deletionTime\":\"2021-03-27T14:00:55Z\"},{\"locationName\":\"rtux\",\"regionalDatabaseAccountInstanceId\":\"rhfcaeooifqdyw\",\"creationTime\":\"2020-12-26T02:16:51Z\",\"deletionTime\":\"2021-03-17T16:24:26Z\"},{\"locationName\":\"ahqmom\",\"regionalDatabaseAccountInstanceId\":\"corkfrocgbmxl\",\"creationTime\":\"2021-11-29T06:49:01Z\",\"deletionTime\":\"2021-10-01T18:03:45Z\"}]}") .toObject(RestorableDatabaseAccountProperties.class); - Assertions.assertEquals("mainwhed", model.accountName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T14:00:16Z"), model.creationTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-24T07:15:35Z"), model.oldestRestorableTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-28T12:47:32Z"), model.deletionTime()); + Assertions.assertEquals("ychakvy", model.accountName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-02T00:07:47Z"), model.creationTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-01T17:50:02Z"), model.oldestRestorableTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T10:09:20Z"), model.deletionTime()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListResultTests.java index 27777842160b..013e96a659c5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListResultTests.java @@ -12,8 +12,8 @@ public final class RestorableDatabaseAccountsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableDatabaseAccountsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"accountName\":\"fcqpol\",\"creationTime\":\"2021-05-16T09:20:14Z\",\"oldestRestorableTime\":\"2021-08-04T02:31:46Z\",\"deletionTime\":\"2021-06-12T11:35:49Z\",\"apiType\":\"Table\",\"restorableLocations\":[{\"locationName\":\"oxlvocptvdxxheig\",\"regionalDatabaseAccountInstanceId\":\"ilwzghj\",\"creationTime\":\"2021-01-04T18:29:37Z\",\"deletionTime\":\"2021-11-18T22:24:22Z\"},{\"locationName\":\"zzbwaybfmdaf\",\"regionalDatabaseAccountInstanceId\":\"ymqtnapreojx\",\"creationTime\":\"2021-06-26T10:38:47Z\",\"deletionTime\":\"2021-01-06T08:59:37Z\"}]},\"location\":\"onxavip\",\"id\":\"yc\",\"name\":\"bjizqfsgn\",\"type\":\"dxze\"},{\"properties\":{\"accountName\":\"l\",\"creationTime\":\"2021-07-28T04:40:09Z\",\"oldestRestorableTime\":\"2021-03-22T21:52:30Z\",\"deletionTime\":\"2021-09-06T23:24:09Z\",\"apiType\":\"Gremlin\",\"restorableLocations\":[{\"locationName\":\"yzavfrbypicdbkpd\",\"regionalDatabaseAccountInstanceId\":\"aq\",\"creationTime\":\"2021-10-03T19:21:02Z\",\"deletionTime\":\"2021-01-06T21:41:34Z\"}]},\"location\":\"pdgonjhxs\",\"id\":\"hmgpczqulpt\",\"name\":\"bvcpxtzhi\",\"type\":\"q\"},{\"properties\":{\"accountName\":\"impkjblorns\",\"creationTime\":\"2021-03-04T14:46:21Z\",\"oldestRestorableTime\":\"2021-01-18T04:40:37Z\",\"deletionTime\":\"2021-06-20T13:53:09Z\",\"apiType\":\"MongoDB\",\"restorableLocations\":[{\"locationName\":\"awja\",\"regionalDatabaseAccountInstanceId\":\"wj\",\"creationTime\":\"2021-05-05T14:29:55Z\",\"deletionTime\":\"2021-10-18T11:06:25Z\"},{\"locationName\":\"nii\",\"regionalDatabaseAccountInstanceId\":\"x\",\"creationTime\":\"2021-07-14T21:14:44Z\",\"deletionTime\":\"2021-11-21T08:32:04Z\"}]},\"location\":\"sjtgirnbgmgmddo\",\"id\":\"mynltwmpftmfoeaj\",\"name\":\"gsy\",\"type\":\"wetamfddrvlk\"},{\"properties\":{\"accountName\":\"bhnrecchdidr\",\"creationTime\":\"2021-01-25T10:11:10Z\",\"oldestRestorableTime\":\"2021-03-04T12:25:58Z\",\"deletionTime\":\"2021-08-22T10:05:59Z\",\"apiType\":\"Gremlin\",\"restorableLocations\":[{\"locationName\":\"ucvkhhwmjpjbw\",\"regionalDatabaseAccountInstanceId\":\"nx\",\"creationTime\":\"2021-05-20T15:06:34Z\",\"deletionTime\":\"2020-12-23T12:15:25Z\"}]},\"location\":\"ufoihppiybxv\",\"id\":\"zuzpbgkzcs\",\"name\":\"piuzvk\",\"type\":\"nhdimjuktirz\"}],\"nextLink\":\"ugp\"}") + "{\"value\":[{\"properties\":{\"accountName\":\"voupr\",\"creationTime\":\"2021-02-11T19:25:30Z\",\"oldestRestorableTime\":\"2021-05-08T02:10Z\",\"deletionTime\":\"2021-06-02T11:16:16Z\",\"apiType\":\"Table\",\"restorableLocations\":[{\"locationName\":\"fniv\",\"regionalDatabaseAccountInstanceId\":\"pfduiol\",\"creationTime\":\"2021-11-09T05:08:50Z\",\"deletionTime\":\"2021-06-01T00:40:22Z\"},{\"locationName\":\"bfj\",\"regionalDatabaseAccountInstanceId\":\"qzucfzluczdquur\",\"creationTime\":\"2020-12-21T04:59:34Z\",\"deletionTime\":\"2021-05-09T19:57:16Z\"},{\"locationName\":\"vzielb\",\"regionalDatabaseAccountInstanceId\":\"nqujywz\",\"creationTime\":\"2021-07-12T03:48:50Z\",\"deletionTime\":\"2021-03-19T04:12Z\"},{\"locationName\":\"nwsvhbngqiwye\",\"regionalDatabaseAccountInstanceId\":\"ob\",\"creationTime\":\"2021-03-10T05:30:01Z\",\"deletionTime\":\"2021-01-21T22:25:07Z\"}]},\"location\":\"ehkuns\",\"id\":\"jhhlwtpkvegeat\",\"name\":\"bzkgtz\",\"type\":\"nwqsttewu\"},{\"properties\":{\"accountName\":\"sjeufjxflpd\",\"creationTime\":\"2021-10-13T19:37:43Z\",\"oldestRestorableTime\":\"2021-11-25T10:19:47Z\",\"deletionTime\":\"2021-06-30T06:40:43Z\",\"apiType\":\"MongoDB\",\"restorableLocations\":[{\"locationName\":\"vrhprrvbwonleqf\",\"regionalDatabaseAccountInstanceId\":\"tlrvbstphu\",\"creationTime\":\"2021-01-01T12:25:14Z\",\"deletionTime\":\"2021-05-08T10:01:55Z\"},{\"locationName\":\"ttlnrjdszdb\",\"regionalDatabaseAccountInstanceId\":\"iciqppo\",\"creationTime\":\"2021-09-15T06:26:47Z\",\"deletionTime\":\"2021-09-18T20:25:47Z\"},{\"locationName\":\"wuhw\",\"regionalDatabaseAccountInstanceId\":\"jnoxuoxtfnr\",\"creationTime\":\"2021-10-19T03:28:50Z\",\"deletionTime\":\"2021-06-28T19:51:59Z\"},{\"locationName\":\"gckncjmg\",\"regionalDatabaseAccountInstanceId\":\"nvbt\",\"creationTime\":\"2021-09-10T11:07:11Z\",\"deletionTime\":\"2021-06-27T07:05:23Z\"}]},\"location\":\"ym\",\"id\":\"hjluqllbsupubdx\",\"name\":\"kdlhzwhc\",\"type\":\"kvbos\"},{\"properties\":{\"accountName\":\"dizhrjqfyaytvsly\",\"creationTime\":\"2021-11-23T03:19:02Z\",\"oldestRestorableTime\":\"2021-10-20T02:04:01Z\",\"deletionTime\":\"2021-03-22T00:03:56Z\",\"apiType\":\"GremlinV2\",\"restorableLocations\":[{\"locationName\":\"gsxf\",\"regionalDatabaseAccountInstanceId\":\"ocwdg\",\"creationTime\":\"2021-03-06T07:41:25Z\",\"deletionTime\":\"2021-03-16T10:52:32Z\"}]},\"location\":\"grzxbarcbpaefzqs\",\"id\":\"jwenjcytesmf\",\"name\":\"crtfodqhuauzm\",\"type\":\"iv\"},{\"properties\":{\"accountName\":\"fzhhezvhjudxdyyr\",\"creationTime\":\"2021-06-04T04:45:39Z\",\"oldestRestorableTime\":\"2021-08-24T22:07:54Z\",\"deletionTime\":\"2021-03-18T05:21:42Z\",\"apiType\":\"Table\",\"restorableLocations\":[{\"locationName\":\"bqssgfen\",\"regionalDatabaseAccountInstanceId\":\"dxbvwf\",\"creationTime\":\"2021-11-21T21:22:49Z\",\"deletionTime\":\"2021-03-29T11:51:19Z\"},{\"locationName\":\"d\",\"regionalDatabaseAccountInstanceId\":\"j\",\"creationTime\":\"2021-06-01T07:06:21Z\",\"deletionTime\":\"2021-05-21T12:16:47Z\"},{\"locationName\":\"uvardlm\",\"regionalDatabaseAccountInstanceId\":\"otprrmuhcuhtu\",\"creationTime\":\"2021-06-09T16:11:13Z\",\"deletionTime\":\"2021-04-03T00:11:56Z\"},{\"locationName\":\"o\",\"regionalDatabaseAccountInstanceId\":\"arpfctwrap\",\"creationTime\":\"2021-04-28T05:58:39Z\",\"deletionTime\":\"2021-06-11T11:49:34Z\"}]},\"location\":\"yvzesipiysnjq\",\"id\":\"waadc\",\"name\":\"dazabundtse\",\"type\":\"kaupwhlz\"}],\"nextLink\":\"kremgjl\"}") .toObject(RestorableDatabaseAccountsListResult.class); - Assertions.assertEquals("ugp", model.nextLink()); + Assertions.assertEquals("kremgjl", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabaseGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabaseGetResultInnerTests.java index ad8f8135ef1d..31912de679f4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabaseGetResultInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabaseGetResultInnerTests.java @@ -11,7 +11,7 @@ public final class RestorableGremlinDatabaseGetResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableGremlinDatabaseGetResultInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"gffjw\",\"operationType\":\"Recreate\",\"canUndelete\":\"tw\",\"canUndeleteReason\":\"aqkifmxawostfz\",\"eventTimestamp\":\"hrkmjqncfv\",\"ownerId\":\"cnhemvwfnq\",\"ownerResourceId\":\"ypvndrw\"}},\"id\":\"od\",\"name\":\"grssgw\",\"type\":\"kainjmuymvecvzt\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"nwfmzvzt\",\"operationType\":\"Create\",\"canUndelete\":\"pamqxfcssanybz\",\"canUndeleteReason\":\"hvdfe\",\"eventTimestamp\":\"yj\",\"ownerId\":\"cdhlywkho\",\"ownerResourceId\":\"junzxezriwg\"}},\"id\":\"wapcqksaaapxjhc\",\"name\":\"ibenwsdfpvda\",\"type\":\"lfrcqklpmvz\"}") .toObject(RestorableGremlinDatabaseGetResultInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasePropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasePropertiesResourceTests.java index 949720dd4b41..93b202062a3f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasePropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasePropertiesResourceTests.java @@ -11,7 +11,7 @@ public final class RestorableGremlinDatabasePropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableGremlinDatabasePropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"eudpab\",\"operationType\":\"Replace\",\"canUndelete\":\"wzosgy\",\"canUndeleteReason\":\"vcva\",\"eventTimestamp\":\"rmrexzvdube\",\"ownerId\":\"zygba\",\"ownerResourceId\":\"vecovsdqhzr\"}") + "{\"_rid\":\"jvxlhmpmh\",\"operationType\":\"Replace\",\"canUndelete\":\"aphqeofytl\",\"canUndeleteReason\":\"lowmcm\",\"eventTimestamp\":\"ixuanccqvjfdgfq\",\"ownerId\":\"quxpjhcfaara\",\"ownerResourceId\":\"iovmufzgugrblwal\"}") .toObject(RestorableGremlinDatabasePropertiesResource.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasePropertiesTests.java index dea09aebb6f9..774e81c5124e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasePropertiesTests.java @@ -11,7 +11,7 @@ public final class RestorableGremlinDatabasePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableGremlinDatabaseProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"gmusaictdscnkzzo\",\"operationType\":\"Recreate\",\"canUndelete\":\"d\",\"canUndeleteReason\":\"zeqozre\",\"eventTimestamp\":\"bzq\",\"ownerId\":\"bnjrqvz\",\"ownerResourceId\":\"exozonynp\"}}") + "{\"resource\":{\"_rid\":\"eszyaqgomlbmfgge\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"kcjjlwkyeahhh\",\"canUndeleteReason\":\"pulnrfcqufmcihp\",\"eventTimestamp\":\"owrer\",\"ownerId\":\"xptch\",\"ownerResourceId\":\"yqqidqimlgbbfjm\"}}") .toObject(RestorableGremlinDatabaseProperties.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasesListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasesListResultTests.java index eb8b1abd7dd3..02848cbd5588 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasesListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinDatabasesListResultTests.java @@ -12,8 +12,8 @@ public final class RestorableGremlinDatabasesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableGremlinDatabasesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"odpjwyblvtb\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"byidaelqpvekmkwj\",\"canUndeleteReason\":\"o\",\"eventTimestamp\":\"oggdusxursui\",\"ownerId\":\"xcjkcoqwczsy\",\"ownerResourceId\":\"rizfwihvaang\"}},\"id\":\"nhjrfdmfd\",\"name\":\"b\",\"type\":\"xxjfwtgdfkkauig\"},{\"properties\":{\"resource\":{\"_rid\":\"fmczfedyueps\",\"operationType\":\"Create\",\"canUndelete\":\"ida\",\"canUndeleteReason\":\"vy\",\"eventTimestamp\":\"ocfkumcfjxoky\",\"ownerId\":\"syasvfnkwmygjjek\",\"ownerResourceId\":\"nfdrugjqyck\"}},\"id\":\"xkrdtul\",\"name\":\"cjdk\",\"type\":\"tcsubmzoo\"},{\"properties\":{\"resource\":{\"_rid\":\"bch\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"whdyslbklglm\",\"canUndeleteReason\":\"kkwayqshwyqxri\",\"eventTimestamp\":\"tb\",\"ownerId\":\"q\",\"ownerResourceId\":\"kgxqwqueuuylztpz\"}},\"id\":\"zevjykofve\",\"name\":\"fkhkqtwqlep\",\"type\":\"zkca\"}],\"nextLink\":\"wz\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"th\",\"operationType\":\"Delete\",\"canUndelete\":\"bpergwlck\",\"canUndeleteReason\":\"bamyqsokkn\",\"eventTimestamp\":\"gz\",\"ownerId\":\"dizcrj\",\"ownerResourceId\":\"iujz\"}},\"id\":\"sexgkrswksykkbxk\",\"name\":\"b\",\"type\":\"lmnwzoknvuqddlgg\"},{\"properties\":{\"resource\":{\"_rid\":\"lgzubak\",\"operationType\":\"Create\",\"canUndelete\":\"ggcmfnsffetp\",\"canUndeleteReason\":\"ixwewzlscgsmep\",\"eventTimestamp\":\"vxgv\",\"ownerId\":\"dbthhxmoevv\",\"ownerResourceId\":\"eepfh\"}},\"id\":\"nn\",\"name\":\"xqhpjhuboh\",\"type\":\"zgaybvr\"}],\"nextLink\":\"og\"}") .toObject(RestorableGremlinDatabasesListResult.class); - Assertions.assertEquals("wz", model.nextLink()); + Assertions.assertEquals("og", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphGetResultInnerTests.java index fe1b5ed409bf..4cc6763f524c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphGetResultInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphGetResultInnerTests.java @@ -11,7 +11,7 @@ public final class RestorableGremlinGraphGetResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableGremlinGraphGetResultInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"ac\",\"operationType\":\"Delete\",\"canUndelete\":\"nrpb\",\"canUndeleteReason\":\"mvgoqpleh\",\"eventTimestamp\":\"mkzdllczdprwnhk\",\"ownerId\":\"ggoxsstcivrakfrr\",\"ownerResourceId\":\"j\"}},\"id\":\"mhlym\",\"name\":\"ukxrke\",\"type\":\"pequlrlzaudgjtf\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"iqxzix\",\"operationType\":\"Delete\",\"canUndelete\":\"wmvcdkucpxpyafrw\",\"canUndeleteReason\":\"orogeuv\",\"eventTimestamp\":\"rspnrsjsem\",\"ownerId\":\"ofrsnq\",\"ownerResourceId\":\"jp\"}},\"id\":\"exutike\",\"name\":\"m\",\"type\":\"rpub\"}") .toObject(RestorableGremlinGraphGetResultInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphPropertiesResourceTests.java index 784639603e88..0411634ace4b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphPropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphPropertiesResourceTests.java @@ -11,7 +11,7 @@ public final class RestorableGremlinGraphPropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableGremlinGraphPropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"ge\",\"operationType\":\"Delete\",\"canUndelete\":\"xadyfhb\",\"canUndeleteReason\":\"khojqttbspvk\",\"eventTimestamp\":\"laqjsgyzstujrzx\",\"ownerId\":\"nsfdrlduye\",\"ownerResourceId\":\"iitt\"}") + "{\"_rid\":\"psjnpck\",\"operationType\":\"Delete\",\"canUndelete\":\"yduonbdawsaopl\",\"canUndeleteReason\":\"mnbkxjarsbbdddwo\",\"eventTimestamp\":\"xailx\",\"ownerId\":\"dyqjvzvcgrdspzes\",\"ownerResourceId\":\"qqxuhvz\"}") .toObject(RestorableGremlinGraphPropertiesResource.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphPropertiesTests.java index 3a86981f1d40..79a1b6ede5e1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphPropertiesTests.java @@ -11,7 +11,7 @@ public final class RestorableGremlinGraphPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableGremlinGraphProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"akkuc\",\"operationType\":\"Create\",\"canUndelete\":\"hczbuto\",\"canUndeleteReason\":\"gjtirjwayhic\",\"eventTimestamp\":\"wwvg\",\"ownerId\":\"slvlizedvb\",\"ownerResourceId\":\"bvn\"}}") + "{\"resource\":{\"_rid\":\"hvo\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"scueza\",\"canUndeleteReason\":\"vdfwgqjhewcffrx\",\"eventTimestamp\":\"ezkhzp\",\"ownerId\":\"qissen\",\"ownerResourceId\":\"rusyzai\"}}") .toObject(RestorableGremlinGraphProperties.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphsListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphsListResultTests.java index 2254ae387754..c6f0fdd66df2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphsListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinGraphsListResultTests.java @@ -12,8 +12,8 @@ public final class RestorableGremlinGraphsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableGremlinGraphsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"limzfvppk\",\"operationType\":\"Recreate\",\"canUndelete\":\"fjmclngygnhrkomb\",\"canUndeleteReason\":\"tajdopggorwjoqtr\",\"eventTimestamp\":\"pvclpofyrl\",\"ownerId\":\"kptskwxjgvhxc\",\"ownerResourceId\":\"mkakmkook\"}},\"id\":\"utmgvmuyak\",\"name\":\"wk\",\"type\":\"ow\"},{\"properties\":{\"resource\":{\"_rid\":\"yrdurxflz\",\"operationType\":\"Create\",\"canUndelete\":\"ejtgzjxxl\",\"canUndeleteReason\":\"jlz\",\"eventTimestamp\":\"loiwy\",\"ownerId\":\"yzivrm\",\"ownerResourceId\":\"cdq\"}},\"id\":\"chwhrktj\",\"name\":\"ifibfiplhxfns\",\"type\":\"cjowlyeyzmu\"}],\"nextLink\":\"qcmhnxlzbu\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"ebaotbptgcsma\",\"operationType\":\"Delete\",\"canUndelete\":\"wqfmdqecvta\",\"canUndeleteReason\":\"wzmnobfewwpsibxo\",\"eventTimestamp\":\"qoqjrkblndy\",\"ownerId\":\"wgycvtqnzjc\",\"ownerResourceId\":\"qzhembtbw\"}},\"id\":\"lbadp\",\"name\":\"jdleajvmvvlooubs\",\"type\":\"ipjeo\"},{\"properties\":{\"resource\":{\"_rid\":\"ocjomlup\",\"operationType\":\"Delete\",\"canUndelete\":\"sj\",\"canUndeleteReason\":\"huslgdw\",\"eventTimestamp\":\"gdqyxajc\",\"ownerId\":\"rcavqcwyzoqzkmq\",\"ownerResourceId\":\"wsjnkiixepb\"}},\"id\":\"qqwwgfgsqxilefe\",\"name\":\"ewrznequqynttw\",\"type\":\"hajksbsyogjmqjhg\"}],\"nextLink\":\"dijnmcvjbs\"}") .toObject(RestorableGremlinGraphsListResult.class); - Assertions.assertEquals("qcmhnxlzbu", model.nextLink()); + Assertions.assertEquals("dijnmcvjbs", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinResourcesGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinResourcesGetResultInnerTests.java index 1ffb1a50265b..7bf0e4ea5fcd 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinResourcesGetResultInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinResourcesGetResultInnerTests.java @@ -12,9 +12,9 @@ public final class RestorableGremlinResourcesGetResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableGremlinResourcesGetResultInner model = BinaryData.fromString( - "{\"id\":\"ufqizjvppw\",\"name\":\"a\",\"type\":\"yyjmjjxiz\",\"databaseName\":\"xhnzlslekcttgzkj\",\"graphNames\":[\"p\",\"wadeghzt\"]}") + "{\"id\":\"u\",\"name\":\"f\",\"type\":\"zufldifnivlutg\",\"databaseName\":\"aacxauhvc\",\"graphNames\":[\"hklsqx\",\"oiyygkts\"]}") .toObject(RestorableGremlinResourcesGetResultInner.class); - Assertions.assertEquals("xhnzlslekcttgzkj", model.databaseName()); - Assertions.assertEquals("p", model.graphNames().get(0)); + Assertions.assertEquals("aacxauhvc", model.databaseName()); + Assertions.assertEquals("hklsqx", model.graphNames().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinResourcesListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinResourcesListResultTests.java index 807a2474e1ba..467de20d8989 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinResourcesListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableGremlinResourcesListResultTests.java @@ -12,8 +12,8 @@ public final class RestorableGremlinResourcesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableGremlinResourcesListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"qwrldaxur\",\"name\":\"azcsozjvx\",\"type\":\"ciggbnvtxof\",\"databaseName\":\"lzy\",\"graphNames\":[\"oeamo\",\"obdoey\",\"fpnimtwuuhaueg\"]},{\"id\":\"wmnfeubtzjyrkwfu\",\"name\":\"phrrkuum\",\"type\":\"durhzzfopueoqus\",\"databaseName\":\"lujopwnibittozt\",\"graphNames\":[\"u\",\"qvfmwcad\",\"tgctxe\",\"tvgwyurbe\"]},{\"id\":\"nzzryizwbxgde\",\"name\":\"layunomirhpfabe\",\"type\":\"lamwmgewa\",\"databaseName\":\"f\",\"graphNames\":[\"cpjs\",\"bhem\",\"cucsqsnxfbxu\"]},{\"id\":\"apdrbzyvbsuadu\",\"name\":\"odkaxpfobkzhm\",\"type\":\"dqltdel\",\"databaseName\":\"rojadhfz\",\"graphNames\":[\"aysrkgzky\",\"udbkuwpzq\",\"lcwe\"]}],\"nextLink\":\"fecjvxf\"}") + "{\"value\":[{\"id\":\"ousz\",\"name\":\"cdwukokgoojjf\",\"type\":\"tubcmu\",\"databaseName\":\"gbtzvxxvsbcu\",\"graphNames\":[\"rfnkcnih\",\"swxmfurqm\"]},{\"id\":\"wwp\",\"name\":\"um\",\"type\":\"ahbqsvnkxm\",\"databaseName\":\"zuae\",\"graphNames\":[\"hxg\",\"qmyrhkvx\"]},{\"id\":\"miemqyftgpqos\",\"name\":\"fqvjmghpakbqyhls\",\"type\":\"nfbmeqagkncjm\",\"databaseName\":\"nyevztnjawrhule\",\"graphNames\":[\"mbwppxirxbkitzmn\",\"itaxju\"]}],\"nextLink\":\"tjlxsgcemegdzdvy\"}") .toObject(RestorableGremlinResourcesListResult.class); - Assertions.assertEquals("fecjvxf", model.nextLink()); + Assertions.assertEquals("tjlxsgcemegdzdvy", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableLocationResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableLocationResourceTests.java index f87c7a2a6ef2..f9a7e069b15e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableLocationResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableLocationResourceTests.java @@ -11,7 +11,7 @@ public final class RestorableLocationResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableLocationResource model = BinaryData.fromString( - "{\"locationName\":\"kszanmhwgpte\",\"regionalDatabaseAccountInstanceId\":\"iuwkirkskwzts\",\"creationTime\":\"2021-06-15T15:30:40Z\",\"deletionTime\":\"2021-09-12T23:31:09Z\"}") + "{\"locationName\":\"bjesylslur\",\"regionalDatabaseAccountInstanceId\":\"fygpnyhgd\",\"creationTime\":\"2021-12-02T17:52:08Z\",\"deletionTime\":\"2021-04-30T16:17:48Z\"}") .toObject(RestorableLocationResource.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionGetResultInnerTests.java index 6bec9380cfdb..ea04bdbda7dc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionGetResultInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionGetResultInnerTests.java @@ -11,7 +11,7 @@ public final class RestorableMongodbCollectionGetResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableMongodbCollectionGetResultInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"ekgafxczvfcck\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"letyvesz\",\"canUndeleteReason\":\"lhpdhwynctaczcnj\",\"eventTimestamp\":\"bbfnvjxitzovnkr\",\"ownerId\":\"kls\",\"ownerResourceId\":\"ihqlcoqks\"}},\"id\":\"ibhyxwbg\",\"name\":\"davqdorbcc\",\"type\":\"dh\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"ytjgoeayokrw\",\"operationType\":\"Recreate\",\"canUndelete\":\"wpad\",\"canUndeleteReason\":\"dbfobdc\",\"eventTimestamp\":\"othm\",\"ownerId\":\"jaoz\",\"ownerResourceId\":\"wfcn\"}},\"id\":\"bpoelhscmyhrhjv\",\"name\":\"fqbokndwp\",\"type\":\"qwojoev\"}") .toObject(RestorableMongodbCollectionGetResultInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionPropertiesResourceTests.java index 93ea015d1426..ed15d1460525 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionPropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionPropertiesResourceTests.java @@ -11,7 +11,7 @@ public final class RestorableMongodbCollectionPropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableMongodbCollectionPropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"urgmcdcp\",\"operationType\":\"Recreate\",\"canUndelete\":\"ojermhzicsbfdjhy\",\"canUndeleteReason\":\"knyuki\",\"eventTimestamp\":\"iglh\",\"ownerId\":\"zwxqtejpii\",\"ownerResourceId\":\"vtozya\"}") + "{\"_rid\":\"ydff\",\"operationType\":\"Delete\",\"canUndelete\":\"rntfknwacycsyo\",\"canUndeleteReason\":\"tkhfhfs\",\"eventTimestamp\":\"vcsxrmhnmiz\",\"ownerId\":\"prhqqwc\",\"ownerResourceId\":\"lehhkplobzg\"}") .toObject(RestorableMongodbCollectionPropertiesResource.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionPropertiesTests.java index 61b7fc84acee..148003c0dd73 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionPropertiesTests.java @@ -11,7 +11,7 @@ public final class RestorableMongodbCollectionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableMongodbCollectionProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"jvlirk\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"sawrdtn\",\"canUndeleteReason\":\"zl\",\"eventTimestamp\":\"yaixihzqj\",\"ownerId\":\"smuydqfttk\",\"ownerResourceId\":\"ybd\"}}") + "{\"resource\":{\"_rid\":\"fytdxmly\",\"operationType\":\"Create\",\"canUndelete\":\"vapbkrbuoggtdltl\",\"canUndeleteReason\":\"haizijv\",\"eventTimestamp\":\"lz\",\"ownerId\":\"hlpsftqkrvmhv\",\"ownerResourceId\":\"vcpwtqsuspnh\"}}") .toObject(RestorableMongodbCollectionProperties.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionsListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionsListResultTests.java index 796f0fa8436a..460ea0246bfb 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionsListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionsListResultTests.java @@ -12,8 +12,8 @@ public final class RestorableMongodbCollectionsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableMongodbCollectionsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"cjwwdx\",\"operationType\":\"Delete\",\"canUndelete\":\"wppk\",\"canUndeleteReason\":\"ooz\",\"eventTimestamp\":\"yacagae\",\"ownerId\":\"oiqclmgdtwgab\",\"ownerResourceId\":\"f\"}},\"id\":\"zbwjecooyvht\",\"name\":\"bpelniibncgagd\",\"type\":\"dq\"},{\"properties\":{\"resource\":{\"_rid\":\"b\",\"operationType\":\"Create\",\"canUndelete\":\"ofdf\",\"canUndeleteReason\":\"tncwmhjobzrfpr\",\"eventTimestamp\":\"dc\",\"ownerId\":\"yftcvbzwgwhg\",\"ownerResourceId\":\"soauoorssatfyb\"}},\"id\":\"ufdmxuq\",\"name\":\"qna\",\"type\":\"tuxvzfqayopbt\"},{\"properties\":{\"resource\":{\"_rid\":\"gvbhxmndztgs\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"qm\",\"canUndeleteReason\":\"xn\",\"eventTimestamp\":\"bpgb\",\"ownerId\":\"bjdqkn\",\"ownerResourceId\":\"nmotpuwnnoh\"}},\"id\":\"zngocfrjuypwyiul\",\"name\":\"nos\",\"type\":\"kfhaxttpfsmwgsgh\"},{\"properties\":{\"resource\":{\"_rid\":\"mlddauqmllfe\",\"operationType\":\"Replace\",\"canUndelete\":\"uarigrj\",\"canUndeleteReason\":\"jlkq\",\"eventTimestamp\":\"krbzkuas\",\"ownerId\":\"xk\",\"ownerResourceId\":\"r\"}},\"id\":\"l\",\"name\":\"l\",\"type\":\"izwxvs\"}],\"nextLink\":\"sgfy\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"feqb\",\"operationType\":\"Delete\",\"canUndelete\":\"stwygu\",\"canUndeleteReason\":\"wel\",\"eventTimestamp\":\"gwzz\",\"ownerId\":\"dtlcjgpvcqzv\",\"ownerResourceId\":\"b\"}},\"id\":\"wx\",\"name\":\"xrmx\",\"type\":\"drwynbgovazoym\"},{\"properties\":{\"resource\":{\"_rid\":\"plkhwwdkatveqmg\",\"operationType\":\"Replace\",\"canUndelete\":\"zeyxryearmhp\",\"canUndeleteReason\":\"uklvsmfa\",\"eventTimestamp\":\"tlvhqpoilosjaemc\",\"ownerId\":\"evft\",\"ownerResourceId\":\"l\"}},\"id\":\"okjyghzt\",\"name\":\"miwtpcflcez\",\"type\":\"wvwiftdjtvbfpfh\"},{\"properties\":{\"resource\":{\"_rid\":\"syqcjnqswxdowum\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"rcdiohclqddnhf\",\"canUndeleteReason\":\"e\",\"eventTimestamp\":\"eddp\",\"ownerId\":\"zcwyjsmk\",\"ownerResourceId\":\"ld\"}},\"id\":\"bnwvpaq\",\"name\":\"xf\",\"type\":\"igcfddofxnf\"}],\"nextLink\":\"jyyrqaedw\"}") .toObject(RestorableMongodbCollectionsListResult.class); - Assertions.assertEquals("sgfy", model.nextLink()); + Assertions.assertEquals("jyyrqaedw", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabaseGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabaseGetResultInnerTests.java index d634a7afbbef..45643c650e29 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabaseGetResultInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabaseGetResultInnerTests.java @@ -11,7 +11,7 @@ public final class RestorableMongodbDatabaseGetResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableMongodbDatabaseGetResultInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"jeuxsphlo\",\"operationType\":\"Recreate\",\"canUndelete\":\"ijpdvzvfbhwbdquf\",\"canUndeleteReason\":\"gnrglaqrwyamb\",\"eventTimestamp\":\"afebzxfkjq\",\"ownerId\":\"ibhlenntrv\",\"ownerResourceId\":\"psabdu\"}},\"id\":\"zmlghny\",\"name\":\"lpyeu\",\"type\":\"p\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"ekekzouyvewwpz\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"gldohgcandxfhh\",\"canUndeleteReason\":\"e\",\"eventTimestamp\":\"dqtdnnc\",\"ownerId\":\"pljdshvvfkdxcc\",\"ownerResourceId\":\"jjimhijz\"}},\"id\":\"njxm\",\"name\":\"s\",\"type\":\"ydw\"}") .toObject(RestorableMongodbDatabaseGetResultInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasePropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasePropertiesResourceTests.java index 90388bddf380..2ae73f245f92 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasePropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasePropertiesResourceTests.java @@ -11,7 +11,7 @@ public final class RestorableMongodbDatabasePropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableMongodbDatabasePropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"jeknfqnw\",\"operationType\":\"Create\",\"canUndelete\":\"owkdnjr\",\"canUndeleteReason\":\"krhwieh\",\"eventTimestamp\":\"pnowawonoehrguql\",\"ownerId\":\"wafbjzmp\",\"ownerResourceId\":\"guyfazbkocbygvt\"}") + "{\"_rid\":\"zisvbrqgcyjpgaw\",\"operationType\":\"Create\",\"canUndelete\":\"on\",\"canUndeleteReason\":\"pghlr\",\"eventTimestamp\":\"bgblxbuibrvjzta\",\"ownerId\":\"vs\",\"ownerResourceId\":\"jihvfjcqrttjfuq\"}") .toObject(RestorableMongodbDatabasePropertiesResource.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasePropertiesTests.java index 3e13824a5b43..b06125e779d9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasePropertiesTests.java @@ -11,7 +11,7 @@ public final class RestorableMongodbDatabasePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableMongodbDatabaseProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"xqbolxvhhyqqegat\",\"operationType\":\"Replace\",\"canUndelete\":\"nmginmt\",\"canUndeleteReason\":\"ixchwkibm\",\"eventTimestamp\":\"ymncjc\",\"ownerId\":\"airwcqzoofj\",\"ownerResourceId\":\"jsvepfbhtleberp\"}}") + "{\"resource\":{\"_rid\":\"ruhhqldrdymnswx\",\"operationType\":\"Recreate\",\"canUndelete\":\"wqnghxnimvyuj\",\"canUndeleteReason\":\"gunnqgypuqt\",\"eventTimestamp\":\"lque\",\"ownerId\":\"mvyumgmmuebsnzn\",\"ownerResourceId\":\"squfmjxcyoseq\"}}") .toObject(RestorableMongodbDatabaseProperties.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasesListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasesListResultTests.java index 6f9526093163..30007e85942b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasesListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasesListResultTests.java @@ -12,8 +12,8 @@ public final class RestorableMongodbDatabasesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableMongodbDatabasesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"r\",\"operationType\":\"Recreate\",\"canUndelete\":\"jzzca\",\"canUndeleteReason\":\"jolb\",\"eventTimestamp\":\"uktwieopexelxqdw\",\"ownerId\":\"wyil\",\"ownerResourceId\":\"ibkgxyxyau\"}},\"id\":\"eddobmcnltm\",\"name\":\"tkujsqycm\",\"type\":\"xfabl\"},{\"properties\":{\"resource\":{\"_rid\":\"bmwhrialiwr\",\"operationType\":\"Replace\",\"canUndelete\":\"wplrrbphc\",\"canUndeleteReason\":\"bb\",\"eventTimestamp\":\"ticuhqvumsp\",\"ownerId\":\"sfeqbbe\",\"ownerResourceId\":\"cuq\"}},\"id\":\"yyxmzrmtmvwituw\",\"name\":\"yjshcyb\",\"type\":\"upp\"},{\"properties\":{\"resource\":{\"_rid\":\"cmvouujxdiikmoxr\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"a\",\"canUndeleteReason\":\"rxikjmoyw\",\"eventTimestamp\":\"npipcwybszfncn\",\"ownerId\":\"tpf\",\"ownerResourceId\":\"aebwfwhxorpwa\"}},\"id\":\"zwuge\",\"name\":\"jfccylhtrht\",\"type\":\"azjpwexcdrzpro\"}],\"nextLink\":\"zxezmnr\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"rxylaypd\",\"operationType\":\"Create\",\"canUndelete\":\"elff\",\"canUndeleteReason\":\"uriwhjdfrw\",\"eventTimestamp\":\"shrmnkcclpctuog\",\"ownerId\":\"cxjfsgmos\",\"ownerResourceId\":\"ebnxsqcows\"}},\"id\":\"yfqla\",\"name\":\"bqhsujkafu\",\"type\":\"nxqpwnikxkcajgrb\"},{\"properties\":{\"resource\":{\"_rid\":\"vgoo\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"zmz\",\"canUndeleteReason\":\"cxitmhxxrqi\",\"eventTimestamp\":\"zfvwjdthkvpyeyoa\",\"ownerId\":\"nmpnqu\",\"ownerResourceId\":\"kjr\"}},\"id\":\"wkyl\",\"name\":\"bdx\",\"type\":\"qdcclcv\"},{\"properties\":{\"resource\":{\"_rid\":\"p\",\"operationType\":\"Create\",\"canUndelete\":\"vwbzmfxlrymf\",\"canUndeleteReason\":\"lpiywqnpfydrfbg\",\"eventTimestamp\":\"y\",\"ownerId\":\"yxmkhmqyncgaul\",\"ownerResourceId\":\"styygjq\"}},\"id\":\"lmwqg\",\"name\":\"mqmiwxzfvvzu\",\"type\":\"fgufjnbx\"}],\"nextLink\":\"mwdukinhl\"}") .toObject(RestorableMongodbDatabasesListResult.class); - Assertions.assertEquals("zxezmnr", model.nextLink()); + Assertions.assertEquals("mwdukinhl", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesGetResultInnerTests.java index 5789afd7a71c..9fc528ff5ca6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesGetResultInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesGetResultInnerTests.java @@ -12,9 +12,9 @@ public final class RestorableMongodbResourcesGetResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableMongodbResourcesGetResultInner model = BinaryData.fromString( - "{\"id\":\"lsk\",\"name\":\"ddida\",\"type\":\"llrqmtlpbyxro\",\"databaseName\":\"uyqyp\",\"collectionNames\":[\"noiicsu\",\"yhbrjjta\",\"xrdsjrholuqwg\"]}") + "{\"id\":\"nopm\",\"name\":\"ds\",\"type\":\"o\",\"databaseName\":\"lyo\",\"collectionNames\":[\"fbkmvldzmxojzsv\",\"aigbq\"]}") .toObject(RestorableMongodbResourcesGetResultInner.class); - Assertions.assertEquals("uyqyp", model.databaseName()); - Assertions.assertEquals("noiicsu", model.collectionNames().get(0)); + Assertions.assertEquals("lyo", model.databaseName()); + Assertions.assertEquals("fbkmvldzmxojzsv", model.collectionNames().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesListResultTests.java index 437c9eb9e055..3b8e70ef07c5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesListResultTests.java @@ -12,8 +12,8 @@ public final class RestorableMongodbResourcesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableMongodbResourcesListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"xkbylhyyxgffklv\",\"name\":\"rwtrdgscnvqeonsg\",\"type\":\"xlw\",\"databaseName\":\"zyohxpthc\",\"collectionNames\":[\"vk\",\"twfvesobpbokh\"]},{\"id\":\"lc\",\"name\":\"arnggcjfwblqh\",\"type\":\"asmcolmugpyvaos\",\"databaseName\":\"l\",\"collectionNames\":[\"x\",\"ygz\",\"tyevjhu\"]},{\"id\":\"obguqisqsqk\",\"name\":\"mioyjpn\",\"type\":\"viqcpszp\",\"databaseName\":\"vqdvrdmvxyrxdhg\",\"collectionNames\":[\"jbxaotcgbz\"]},{\"id\":\"btplefoi\",\"name\":\"idoxznvgvdtmuuv\",\"type\":\"wsxmrszb\",\"databaseName\":\"imxlpnerxrzuty\",\"collectionNames\":[\"rzaqmnbx\",\"aehtd\"]}],\"nextLink\":\"mbnvynfaooeacted\"}") + "{\"value\":[{\"id\":\"ksadzi\",\"name\":\"mmtbt\",\"type\":\"u\",\"databaseName\":\"vvraabeurdeewlsu\",\"collectionNames\":[\"bwkdwjyjiznioroo\",\"m\",\"taspmcrei\"]},{\"id\":\"ftrnighminuwqxu\",\"name\":\"robgwfmsxj\",\"type\":\"ylwx\",\"databaseName\":\"zjow\",\"collectionNames\":[\"eerclbltbhpw\",\"chy\"]},{\"id\":\"rjwmvwryvdifkiik\",\"name\":\"ruccwmecbtxsytr\",\"type\":\"xe\",\"databaseName\":\"mrqjywi\",\"collectionNames\":[\"ycfjnc\",\"ndiloqkajwjuria\",\"sb\"]},{\"id\":\"lanhzcknjxizba\",\"name\":\"ygzkztxfexwacyy\",\"type\":\"lxppd\",\"databaseName\":\"zkf\",\"collectionNames\":[\"iiuiibf\"]}],\"nextLink\":\"jytqdcizeqqfo\"}") .toObject(RestorableMongodbResourcesListResult.class); - Assertions.assertEquals("mbnvynfaooeacted", model.nextLink()); + Assertions.assertEquals("jytqdcizeqqfo", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabaseGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabaseGetResultInnerTests.java index 14042b55f308..537bb6d943c1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabaseGetResultInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabaseGetResultInnerTests.java @@ -14,13 +14,13 @@ public final class RestorableSqlDatabaseGetResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableSqlDatabaseGetResultInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"qcbpokstsinv\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"jyhdrxb\",\"canUndeleteReason\":\"vcehqw\",\"eventTimestamp\":\"txnmxgnmguz\",\"ownerId\":\"wvor\",\"ownerResourceId\":\"lkjnbkb\",\"database\":{\"_rid\":\"ltqstqkqsygxiyn\",\"_ts\":71.25525,\"_etag\":\"agz\",\"_colls\":\"eubanlxunpqcc\",\"_users\":\"iawzlzklaslgac\",\"_self\":\"uxlrarwpe\",\"id\":\"saudoejtighsx\",\"restoreParameters\":{\"restoreSource\":\"tnkqbala\",\"restoreTimestampInUtc\":\"2021-02-11T19:42:24Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"}}},\"id\":\"mehjnhjioti\",\"name\":\"bbcngkeg\",\"type\":\"y\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"xhfwlfxzfwuge\",\"operationType\":\"Replace\",\"canUndelete\":\"necexkgrvfps\",\"canUndeleteReason\":\"m\",\"eventTimestamp\":\"sytqpdzfyxcnwawo\",\"ownerId\":\"gzb\",\"ownerResourceId\":\"qfbifo\",\"database\":{\"_rid\":\"xdwdrpazqjkrfm\",\"_ts\":85.73021,\"_etag\":\"fcuuugtjigpg\",\"_colls\":\"iawohfmhn\",\"_users\":\"mecjjkmqenhaidzr\",\"_self\":\"sgloi\",\"id\":\"vslvivqsuvwten\",\"restoreParameters\":{\"restoreSource\":\"i\",\"restoreTimestampInUtc\":\"2021-04-25T21:12:03Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"}}},\"id\":\"qxukuicj\",\"name\":\"teki\",\"type\":\"anduew\"}") .toObject(RestorableSqlDatabaseGetResultInner.class); - Assertions.assertEquals("saudoejtighsx", model.resource().database().id()); - Assertions.assertEquals("tnkqbala", model.resource().database().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T19:42:24Z"), + Assertions.assertEquals("vslvivqsuvwten", model.resource().database().id()); + Assertions.assertEquals("i", model.resource().database().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T21:12:03Z"), model.resource().database().restoreParameters().restoreTimestampInUtc()); - Assertions.assertFalse(model.resource().database().restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.RESTORE, model.resource().database().createMode()); + Assertions.assertTrue(model.resource().database().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertEquals(CreateMode.DEFAULT, model.resource().database().createMode()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasePropertiesResourceDatabaseTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasePropertiesResourceDatabaseTests.java index 75a163759045..eb3a5ae27f0e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasePropertiesResourceDatabaseTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasePropertiesResourceDatabaseTests.java @@ -14,13 +14,13 @@ public final class RestorableSqlDatabasePropertiesResourceDatabaseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableSqlDatabasePropertiesResourceDatabase model = BinaryData.fromString( - "{\"_rid\":\"enx\",\"_ts\":89.36999,\"_etag\":\"zlm\",\"_colls\":\"lxcznn\",\"_users\":\"kbnbmxlxmwtyg\",\"_self\":\"zusitoqcahfs\",\"id\":\"bjmlreesrfwssz\",\"restoreParameters\":{\"restoreSource\":\"wliso\",\"restoreTimestampInUtc\":\"2021-02-08T09:55:51Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"}") + "{\"_rid\":\"dovbrbler\",\"_ts\":19.051802,\"_etag\":\"aqccddcbnyg\",\"_colls\":\"c\",\"_users\":\"wbpwy\",\"_self\":\"digqzlrzn\",\"id\":\"asd\",\"restoreParameters\":{\"restoreSource\":\"mjqmv\",\"restoreTimestampInUtc\":\"2021-03-10T22:46:21Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"}") .toObject(RestorableSqlDatabasePropertiesResourceDatabase.class); - Assertions.assertEquals("bjmlreesrfwssz", model.id()); - Assertions.assertEquals("wliso", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-08T09:55:51Z"), + Assertions.assertEquals("asd", model.id()); + Assertions.assertEquals("mjqmv", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-10T22:46:21Z"), model.restoreParameters().restoreTimestampInUtc()); Assertions.assertTrue(model.restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.RESTORE, model.createMode()); + Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasePropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasePropertiesResourceTests.java index cd347869483d..e8526552ca7e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasePropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasePropertiesResourceTests.java @@ -14,13 +14,13 @@ public final class RestorableSqlDatabasePropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableSqlDatabasePropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"mdiawpzx\",\"operationType\":\"Recreate\",\"canUndelete\":\"tmkctdhuosgwqpsq\",\"canUndeleteReason\":\"i\",\"eventTimestamp\":\"odvqgcnbhcbmj\",\"ownerId\":\"ti\",\"ownerResourceId\":\"iynt\",\"database\":{\"_rid\":\"mfmeftvhkmoo\",\"_ts\":8.161884,\"_etag\":\"skbwgm\",\"_colls\":\"rulcfogx\",\"_users\":\"xnwjtpfdzxcouz\",\"_self\":\"ofwakukzk\",\"id\":\"tzxsoednlwglihe\",\"restoreParameters\":{\"restoreSource\":\"ucmqgisnione\",\"restoreTimestampInUtc\":\"2021-06-04T18:47:13Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"}}") + "{\"_rid\":\"xbzbqufpnezs\",\"operationType\":\"Create\",\"canUndelete\":\"m\",\"canUndeleteReason\":\"rorh\",\"eventTimestamp\":\"gzmsimehtc\",\"ownerId\":\"wdhtqqhyhnimxtn\",\"ownerResourceId\":\"gi\",\"database\":{\"_rid\":\"mwnwnghojovkey\",\"_ts\":11.958665,\"_etag\":\"jixxfsfpcrtn\",\"_colls\":\"uefxxijtebdveywe\",\"_users\":\"rhlolmcnwepfg\",\"_self\":\"bbvaqdljnpetl\",\"id\":\"n\",\"restoreParameters\":{\"restoreSource\":\"tawevxehu\",\"restoreTimestampInUtc\":\"2021-03-15T04:10:48Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"}}") .toObject(RestorableSqlDatabasePropertiesResource.class); - Assertions.assertEquals("tzxsoednlwglihe", model.database().id()); - Assertions.assertEquals("ucmqgisnione", model.database().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-04T18:47:13Z"), + Assertions.assertEquals("n", model.database().id()); + Assertions.assertEquals("tawevxehu", model.database().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T04:10:48Z"), model.database().restoreParameters().restoreTimestampInUtc()); - Assertions.assertTrue(model.database().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertFalse(model.database().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.DEFAULT, model.database().createMode()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasePropertiesTests.java index 5b33819df852..b5463ff3a8ff 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasePropertiesTests.java @@ -14,13 +14,13 @@ public final class RestorableSqlDatabasePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableSqlDatabaseProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"bfetwily\",\"operationType\":\"Recreate\",\"canUndelete\":\"pdxqlfrolqownkiu\",\"canUndeleteReason\":\"ewnahwkxjjmzt\",\"eventTimestamp\":\"mso\",\"ownerId\":\"tmvecdhdyswcrptv\",\"ownerResourceId\":\"jczxvlgsrg\",\"database\":{\"_rid\":\"izrpywlptyuqhrl\",\"_ts\":67.06087,\"_etag\":\"ykpfu\",\"_colls\":\"ixcnpcf\",\"_users\":\"kpyyc\",\"_self\":\"wmpjprd\",\"id\":\"wrpcfpcfjfwzlgza\",\"restoreParameters\":{\"restoreSource\":\"yep\",\"restoreTimestampInUtc\":\"2021-03-28T10:01:10Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"}}}") + "{\"resource\":{\"_rid\":\"pxjhxzubfjzabbwz\",\"operationType\":\"Delete\",\"canUndelete\":\"aix\",\"canUndeleteReason\":\"ckixsps\",\"eventTimestamp\":\"gavkmv\",\"ownerId\":\"zerejr\",\"ownerResourceId\":\"zjbyetjxryopta\",\"database\":{\"_rid\":\"whlbecgihzbpem\",\"_ts\":14.304572,\"_etag\":\"bovr\",\"_colls\":\"xywpjhspboxhif\",\"_users\":\"skpeswyhhmifjua\",\"_self\":\"wwv\",\"id\":\"mmp\",\"restoreParameters\":{\"restoreSource\":\"y\",\"restoreTimestampInUtc\":\"2020-12-29T18:48:44Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"}}}") .toObject(RestorableSqlDatabaseProperties.class); - Assertions.assertEquals("wrpcfpcfjfwzlgza", model.resource().database().id()); - Assertions.assertEquals("yep", model.resource().database().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-28T10:01:10Z"), + Assertions.assertEquals("mmp", model.resource().database().id()); + Assertions.assertEquals("y", model.resource().database().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-29T18:48:44Z"), model.resource().database().restoreParameters().restoreTimestampInUtc()); - Assertions.assertTrue(model.resource().database().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertFalse(model.resource().database().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.resource().database().createMode()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasesListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasesListResultTests.java index 0a7d1b7ef626..e24a202751a2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasesListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasesListResultTests.java @@ -12,8 +12,8 @@ public final class RestorableSqlDatabasesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableSqlDatabasesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"qplwg\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"xwr\",\"canUndeleteReason\":\"vzklkvbgikyjtka\",\"eventTimestamp\":\"lbis\",\"ownerId\":\"vpz\",\"ownerResourceId\":\"tuoska\",\"database\":{\"_rid\":\"jixwfgc\",\"_ts\":1.391536,\"_etag\":\"kcxwnujvqynvavi\",\"_colls\":\"dmuqohhi\",\"_users\":\"a\",\"_self\":\"uddrwjc\",\"id\":\"jbrhlhpvzadbw\",\"restoreParameters\":{},\"createMode\":\"Restore\"}}},\"id\":\"afhxrzfrmvztiuc\",\"name\":\"iql\",\"type\":\"khkrc\"}],\"nextLink\":\"gcbv\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"sirxxhyr\",\"operationType\":\"Delete\",\"canUndelete\":\"ofajfreprfvmkin\",\"canUndeleteReason\":\"eyrqshixbcejop\",\"eventTimestamp\":\"blfs\",\"ownerId\":\"r\",\"ownerResourceId\":\"spimtcvvf\",\"database\":{\"_rid\":\"ytzfsl\",\"_ts\":34.902138,\"_etag\":\"qikm\",\"_colls\":\"bliqemcdiiiskl\",\"_users\":\"nxx\",\"_self\":\"jxvtrkfkgenjqnnp\",\"id\":\"wkosnyxigf\",\"restoreParameters\":{},\"createMode\":\"Restore\"}}},\"id\":\"xgdqmrlhnzkwops\",\"name\":\"yinxu\",\"type\":\"rxyxwjezbfqp\"},{\"properties\":{\"resource\":{\"_rid\":\"ekd\",\"operationType\":\"Delete\",\"canUndelete\":\"ftrsv\",\"canUndeleteReason\":\"nsvujnjkt\",\"eventTimestamp\":\"lefcjis\",\"ownerId\":\"kdb\",\"ownerResourceId\":\"tfbjampq\",\"database\":{\"_rid\":\"a\",\"_ts\":4.3906155,\"_etag\":\"ynlsuqbwzstrk\",\"_colls\":\"vpatrgjjk\",\"_users\":\"i\",\"_self\":\"hoksmmculwk\",\"id\":\"icruo\",\"restoreParameters\":{},\"createMode\":\"Restore\"}}},\"id\":\"lsgaojbtqpq\",\"name\":\"oc\",\"type\":\"zpujzflmcdsg\"}],\"nextLink\":\"elujiswl\"}") .toObject(RestorableSqlDatabasesListResult.class); - Assertions.assertEquals("gcbv", model.nextLink()); + Assertions.assertEquals("elujiswl", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesGetResultInnerTests.java index e75ecbd7eb54..351a2a6bb9be 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesGetResultInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesGetResultInnerTests.java @@ -12,9 +12,9 @@ public final class RestorableSqlResourcesGetResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableSqlResourcesGetResultInner model = BinaryData.fromString( - "{\"id\":\"fzwush\",\"name\":\"xpblalh\",\"type\":\"zpfkis\",\"databaseName\":\"idqzsaaoqdsgpto\",\"collectionNames\":[\"qf\"]}") + "{\"id\":\"zawwsdsorgf\",\"name\":\"xsawooauff\",\"type\":\"fqkmwz\",\"databaseName\":\"q\",\"collectionNames\":[\"bmrno\",\"ocjnzdaiovrbhr\",\"qphkv\"]}") .toObject(RestorableSqlResourcesGetResultInner.class); - Assertions.assertEquals("idqzsaaoqdsgpto", model.databaseName()); - Assertions.assertEquals("qf", model.collectionNames().get(0)); + Assertions.assertEquals("q", model.databaseName()); + Assertions.assertEquals("bmrno", model.collectionNames().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesListResultTests.java index 8a2d05ddefed..c2d993c8c1ac 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesListResultTests.java @@ -12,8 +12,8 @@ public final class RestorableSqlResourcesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableSqlResourcesListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"qpzfzxsoxin\",\"name\":\"jlzkdrocqsxy\",\"type\":\"qtcmiwdwisv\",\"databaseName\":\"eylajamcajyhft\",\"collectionNames\":[\"rryklleynqan\"]},{\"id\":\"igglclwalhvub\",\"name\":\"zphetxdqcm\",\"type\":\"tajqzj\",\"databaseName\":\"lecxbibiwks\",\"collectionNames\":[\"yxsbfpz\"]}],\"nextLink\":\"ikvntw\"}") + "{\"value\":[{\"id\":\"irupkqnstpaqpi\",\"name\":\"gbv\",\"type\":\"mehfxrttxbm\",\"databaseName\":\"nn\",\"collectionNames\":[\"bqcamalec\",\"cxs\"]},{\"id\":\"bzdxmsynb\",\"name\":\"nnyufxuzm\",\"type\":\"zyq\",\"databaseName\":\"rnxhjtlxfikjk\",\"collectionNames\":[\"avwwuasnjeg\",\"htrxbozp\",\"jcnwjzb\"]}],\"nextLink\":\"lxrnwvdsvo\"}") .toObject(RestorableSqlResourcesListResult.class); - Assertions.assertEquals("ikvntw", model.nextLink()); + Assertions.assertEquals("lxrnwvdsvo", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTableGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTableGetResultInnerTests.java index 1ee08c16cce9..ffb27f638f36 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTableGetResultInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTableGetResultInnerTests.java @@ -11,7 +11,7 @@ public final class RestorableTableGetResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableTableGetResultInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"imixlmdbgice\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"mdrjuqbpxt\",\"canUndeleteReason\":\"lj\",\"eventTimestamp\":\"znpaxwfqtyyqiprc\",\"ownerId\":\"ungbsoljc\",\"ownerResourceId\":\"iigz\"}},\"id\":\"uck\",\"name\":\"dsk\",\"type\":\"tiiqqcqikclsmaln\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"vd\",\"operationType\":\"Replace\",\"canUndelete\":\"rugyozzzawnjdv\",\"canUndeleteReason\":\"rho\",\"eventTimestamp\":\"kkvxu\",\"ownerId\":\"qzbvbpsuvqhxt\",\"ownerResourceId\":\"fgdkwbk\"}},\"id\":\"klpiigfuzke\",\"name\":\"uipjclzjwaqd\",\"type\":\"ydewuwxyll\"}") .toObject(RestorableTableGetResultInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTablePropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTablePropertiesResourceTests.java index 4ff8aea03dcc..4dfa0671b186 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTablePropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTablePropertiesResourceTests.java @@ -11,7 +11,7 @@ public final class RestorableTablePropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableTablePropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"twmlg\",\"operationType\":\"Delete\",\"canUndelete\":\"pvv\",\"canUndeleteReason\":\"gjnaqyqipsl\",\"eventTimestamp\":\"vcdsvm\",\"ownerId\":\"itekdtfobvfiyb\",\"ownerResourceId\":\"ich\"}") + "{\"_rid\":\"eatne\",\"operationType\":\"Delete\",\"canUndelete\":\"jxnjtqbgy\",\"canUndeleteReason\":\"bth\",\"eventTimestamp\":\"xwtdqtcbjdbtqy\",\"ownerId\":\"xu\",\"ownerResourceId\":\"aujqgbbjv\"}") .toObject(RestorableTablePropertiesResource.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTablePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTablePropertiesTests.java index 9af8d21e4ddd..0e60472573a3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTablePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTablePropertiesTests.java @@ -11,7 +11,7 @@ public final class RestorableTablePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableTableProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"oykdno\",\"operationType\":\"Recreate\",\"canUndelete\":\"wmgzrujlqcwnynl\",\"canUndeleteReason\":\"iqbcbgv\",\"eventTimestamp\":\"t\",\"ownerId\":\"rtoxadhxuvjhxm\",\"ownerResourceId\":\"qstjc\"}}") + "{\"resource\":{\"_rid\":\"evt\",\"operationType\":\"Create\",\"canUndelete\":\"zochwbekmuyn\",\"canUndeleteReason\":\"kyvnhiysdhork\",\"eventTimestamp\":\"hr\",\"ownerId\":\"kiwlwkfflaqwmwq\",\"ownerResourceId\":\"uf\"}}") .toObject(RestorableTableProperties.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTableResourcesGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTableResourcesGetResultInnerTests.java index 690a64e4251a..e2ac306973d3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTableResourcesGetResultInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTableResourcesGetResultInnerTests.java @@ -11,7 +11,7 @@ public final class RestorableTableResourcesGetResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableTableResourcesGetResultInner model - = BinaryData.fromString("{\"id\":\"imwdcsklkqnqvki\",\"name\":\"mbzmecuy\",\"type\":\"wimbzayspzvr\"}") + = BinaryData.fromString("{\"id\":\"ffavdhpiwr\",\"name\":\"wkgjwb\",\"type\":\"dwfbwxy\"}") .toObject(RestorableTableResourcesGetResultInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTableResourcesListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTableResourcesListResultTests.java index 46e17993995c..6d4c8f3f7dff 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTableResourcesListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTableResourcesListResultTests.java @@ -12,8 +12,8 @@ public final class RestorableTableResourcesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableTableResourcesListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"zdqekivycpzcvd\",\"name\":\"ulrqtbht\",\"type\":\"zpzlpryf\"},{\"id\":\"mdutzfk\",\"name\":\"lnoud\",\"type\":\"gndj\"},{\"id\":\"prigg\",\"name\":\"yeqfcbuulpy\",\"type\":\"lq\"}],\"nextLink\":\"shtujcyoh\"}") + "{\"value\":[{\"id\":\"whgjsmbcsl\",\"name\":\"gsabdgdheronsdu\",\"type\":\"kzvzuatqhgzuyxtr\"}],\"nextLink\":\"dbqskgqjbvitptp\"}") .toObject(RestorableTableResourcesListResult.class); - Assertions.assertEquals("shtujcyoh", model.nextLink()); + Assertions.assertEquals("dbqskgqjbvitptp", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTablesListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTablesListResultTests.java index 71d30028b6c9..64a51c6401e9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTablesListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RestorableTablesListResultTests.java @@ -12,8 +12,8 @@ public final class RestorableTablesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestorableTablesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"djiah\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"jzucwwm\",\"canUndeleteReason\":\"jqhddwvmqxiyoo\",\"eventTimestamp\":\"fozkbnz\",\"ownerId\":\"ypfqpgaixw\",\"ownerResourceId\":\"rkkderfrswqikw\"}},\"id\":\"w\",\"name\":\"ggicwnxhtfmcqbs\",\"type\":\"zp\"},{\"properties\":{\"resource\":{\"_rid\":\"pgfqum\",\"operationType\":\"Replace\",\"canUndelete\":\"hzghgod\",\"canUndeleteReason\":\"nrceqavfdbdfmmx\",\"eventTimestamp\":\"naj\",\"ownerId\":\"pjyyqmkwlhvc\",\"ownerResourceId\":\"oqdejkluxxr\"}},\"id\":\"obuzmsxga\",\"name\":\"dtkwppth\",\"type\":\"dprmimrljdpoqf\"},{\"properties\":{\"resource\":{\"_rid\":\"hkftbaewh\",\"operationType\":\"SystemOperation\",\"canUndelete\":\"oamfmxtllfltymqc\",\"canUndeleteReason\":\"rfijhggabq\",\"eventTimestamp\":\"amklilirwdv\",\"ownerId\":\"hsdp\",\"ownerResourceId\":\"uhktq\"}},\"id\":\"qwqnjxrdfddt\",\"name\":\"lygtavczcxdfweap\",\"type\":\"mlx\"}],\"nextLink\":\"jphrasp\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"xwfzbkvecnxfxph\",\"operationType\":\"Recreate\",\"canUndelete\":\"ebs\",\"canUndeleteReason\":\"wutlvuwmsumu\",\"eventTimestamp\":\"ihtgrafjajvk\",\"ownerId\":\"mmjczvog\",\"ownerResourceId\":\"erjen\"}},\"id\":\"kvaeuwqdwxhhlbm\",\"name\":\"hfxnrpdhewokyqs\",\"type\":\"xfsyw\"}],\"nextLink\":\"hqbtodjfyxbvkv\"}") .toObject(RestorableTablesListResult.class); - Assertions.assertEquals("jphrasp", model.nextLink()); + Assertions.assertEquals("hqbtodjfyxbvkv", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RetrieveThroughputParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RetrieveThroughputParametersTests.java new file mode 100644 index 000000000000..1f7ffc0a4afd --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RetrieveThroughputParametersTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentityUserAssignedIdentities; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionId; +import com.azure.resourcemanager.cosmos.models.ResourceIdentityType; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputPropertiesResource; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class RetrieveThroughputParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RetrieveThroughputParameters model = BinaryData.fromString( + "{\"properties\":{\"resource\":{\"physicalPartitionIds\":[{\"id\":\"qubkw\"},{\"id\":\"lenrd\"},{\"id\":\"utujba\"}]}},\"id\":\"juohminyflnorw\",\"name\":\"uvwpklvxwmyg\",\"type\":\"pgpqchiszepnnb\",\"location\":\"rxgibbd\",\"tags\":{\"auorsukokw\":\"onfo\",\"epzl\":\"qplhlvnu\",\"vmnnrw\":\"phwzsoldweyuqdu\"},\"identity\":{\"principalId\":\"ork\",\"tenantId\":\"lywjhh\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"euzaof\":{\"principalId\":\"sivfomilo\",\"clientId\":\"gdufiqnd\"},\"cje\":{\"principalId\":\"hvcyyysfg\",\"clientId\":\"tcubiipuipwoqonm\"},\"b\":{\"principalId\":\"izsh\",\"clientId\":\"cimpevfg\"},\"rwfscjfnynszquj\":{\"principalId\":\"rilbywdx\",\"clientId\":\"icc\"}}}}") + .toObject(RetrieveThroughputParameters.class); + Assertions.assertEquals("rxgibbd", model.location()); + Assertions.assertEquals("onfo", model.tags().get("auorsukokw")); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("qubkw", model.resource().physicalPartitionIds().get(0).id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RetrieveThroughputParameters model = new RetrieveThroughputParameters().withLocation("rxgibbd") + .withTags(mapOf("auorsukokw", "onfo", "epzl", "qplhlvnu", "vmnnrw", "phwzsoldweyuqdu")) + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("euzaof", new ManagedServiceIdentityUserAssignedIdentities(), "cje", + new ManagedServiceIdentityUserAssignedIdentities(), "b", + new ManagedServiceIdentityUserAssignedIdentities(), "rwfscjfnynszquj", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource(new RetrieveThroughputPropertiesResource() + .withPhysicalPartitionIds(Arrays.asList(new PhysicalPartitionId().withId("qubkw"), + new PhysicalPartitionId().withId("lenrd"), new PhysicalPartitionId().withId("utujba")))); + model = BinaryData.fromObject(model).toObject(RetrieveThroughputParameters.class); + Assertions.assertEquals("rxgibbd", model.location()); + Assertions.assertEquals("onfo", model.tags().get("auorsukokw")); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("qubkw", model.resource().physicalPartitionIds().get(0).id()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RetrieveThroughputPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RetrieveThroughputPropertiesResourceTests.java new file mode 100644 index 000000000000..e5a72252a8cd --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RetrieveThroughputPropertiesResourceTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionId; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputPropertiesResource; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RetrieveThroughputPropertiesResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RetrieveThroughputPropertiesResource model + = BinaryData.fromString("{\"physicalPartitionIds\":[{\"id\":\"iml\"}]}") + .toObject(RetrieveThroughputPropertiesResource.class); + Assertions.assertEquals("iml", model.physicalPartitionIds().get(0).id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RetrieveThroughputPropertiesResource model = new RetrieveThroughputPropertiesResource() + .withPhysicalPartitionIds(Arrays.asList(new PhysicalPartitionId().withId("iml"))); + model = BinaryData.fromObject(model).toObject(RetrieveThroughputPropertiesResource.class); + Assertions.assertEquals("iml", model.physicalPartitionIds().get(0).id()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RetrieveThroughputPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RetrieveThroughputPropertiesTests.java new file mode 100644 index 000000000000..832f05785923 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RetrieveThroughputPropertiesTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.RetrieveThroughputProperties; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionId; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputPropertiesResource; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RetrieveThroughputPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RetrieveThroughputProperties model = BinaryData.fromString( + "{\"resource\":{\"physicalPartitionIds\":[{\"id\":\"dvoqyt\"},{\"id\":\"byowbblgyavutp\"},{\"id\":\"hjoxo\"},{\"id\":\"smsks\"}]}}") + .toObject(RetrieveThroughputProperties.class); + Assertions.assertEquals("dvoqyt", model.resource().physicalPartitionIds().get(0).id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RetrieveThroughputProperties model = new RetrieveThroughputProperties() + .withResource(new RetrieveThroughputPropertiesResource().withPhysicalPartitionIds(Arrays.asList( + new PhysicalPartitionId().withId("dvoqyt"), new PhysicalPartitionId().withId("byowbblgyavutp"), + new PhysicalPartitionId().withId("hjoxo"), new PhysicalPartitionId().withId("smsks")))); + model = BinaryData.fromObject(model).toObject(RetrieveThroughputProperties.class); + Assertions.assertEquals("dvoqyt", model.resource().physicalPartitionIds().get(0).id()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RoleTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RoleTests.java index 63d16c7bab68..affff544ae96 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RoleTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/RoleTests.java @@ -11,16 +11,16 @@ public final class RoleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Role model = BinaryData.fromString("{\"db\":\"e\",\"role\":\"ela\"}").toObject(Role.class); - Assertions.assertEquals("e", model.db()); - Assertions.assertEquals("ela", model.role()); + Role model = BinaryData.fromString("{\"db\":\"jddvjsaqw\",\"role\":\"mmwllc\"}").toObject(Role.class); + Assertions.assertEquals("jddvjsaqw", model.db()); + Assertions.assertEquals("mmwllc", model.role()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Role model = new Role().withDb("e").withRole("ela"); + Role model = new Role().withDb("jddvjsaqw").withRole("mmwllc"); model = BinaryData.fromObject(model).toObject(Role.class); - Assertions.assertEquals("e", model.db()); - Assertions.assertEquals("ela", model.role()); + Assertions.assertEquals("jddvjsaqw", model.db()); + Assertions.assertEquals("mmwllc", model.role()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SeedNodeTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SeedNodeTests.java index 66715a2c58c2..36c129cb6e45 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SeedNodeTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SeedNodeTests.java @@ -11,14 +11,14 @@ public final class SeedNodeTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SeedNode model = BinaryData.fromString("{\"ipAddress\":\"ekewnazeaj\"}").toObject(SeedNode.class); - Assertions.assertEquals("ekewnazeaj", model.ipAddress()); + SeedNode model = BinaryData.fromString("{\"ipAddress\":\"zstifgufyj\"}").toObject(SeedNode.class); + Assertions.assertEquals("zstifgufyj", model.ipAddress()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SeedNode model = new SeedNode().withIpAddress("ekewnazeaj"); + SeedNode model = new SeedNode().withIpAddress("zstifgufyj"); model = BinaryData.fromObject(model).toObject(SeedNode.class); - Assertions.assertEquals("ekewnazeaj", model.ipAddress()); + Assertions.assertEquals("zstifgufyj", model.ipAddress()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceCreateUpdateParametersTests.java index f1dd643eb875..7f610dfd40cd 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceCreateUpdateParametersTests.java @@ -14,19 +14,19 @@ public final class ServiceResourceCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceResourceCreateUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"serviceType\":\"ServiceResourceCreateUpdateProperties\",\"instanceSize\":\"Cosmos.D16s\",\"instanceCount\":161970940}}") + "{\"properties\":{\"serviceType\":\"ServiceResourceCreateUpdateProperties\",\"instanceSize\":\"Cosmos.D8s\",\"instanceCount\":902484620}}") .toObject(ServiceResourceCreateUpdateParameters.class); - Assertions.assertEquals(ServiceSize.COSMOS_D16S, model.properties().instanceSize()); - Assertions.assertEquals(161970940, model.properties().instanceCount()); + Assertions.assertEquals(ServiceSize.COSMOS_D8S, model.properties().instanceSize()); + Assertions.assertEquals(902484620, model.properties().instanceCount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServiceResourceCreateUpdateParameters model = new ServiceResourceCreateUpdateParameters() - .withProperties(new ServiceResourceCreateUpdateProperties().withInstanceSize(ServiceSize.COSMOS_D16S) - .withInstanceCount(161970940)); + .withProperties(new ServiceResourceCreateUpdateProperties().withInstanceSize(ServiceSize.COSMOS_D8S) + .withInstanceCount(902484620)); model = BinaryData.fromObject(model).toObject(ServiceResourceCreateUpdateParameters.class); - Assertions.assertEquals(ServiceSize.COSMOS_D16S, model.properties().instanceSize()); - Assertions.assertEquals(161970940, model.properties().instanceCount()); + Assertions.assertEquals(ServiceSize.COSMOS_D8S, model.properties().instanceSize()); + Assertions.assertEquals(902484620, model.properties().instanceCount()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceCreateUpdatePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceCreateUpdatePropertiesTests.java index 0ce9374ea5a0..69d7e0d9ebca 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceCreateUpdatePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceCreateUpdatePropertiesTests.java @@ -13,19 +13,19 @@ public final class ServiceResourceCreateUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceResourceCreateUpdateProperties model = BinaryData.fromString( - "{\"serviceType\":\"ServiceResourceCreateUpdateProperties\",\"instanceSize\":\"Cosmos.D4s\",\"instanceCount\":1678865876}") + "{\"serviceType\":\"ServiceResourceCreateUpdateProperties\",\"instanceSize\":\"Cosmos.D4s\",\"instanceCount\":1686986385}") .toObject(ServiceResourceCreateUpdateProperties.class); Assertions.assertEquals(ServiceSize.COSMOS_D4S, model.instanceSize()); - Assertions.assertEquals(1678865876, model.instanceCount()); + Assertions.assertEquals(1686986385, model.instanceCount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServiceResourceCreateUpdateProperties model = new ServiceResourceCreateUpdateProperties().withInstanceSize(ServiceSize.COSMOS_D4S) - .withInstanceCount(1678865876); + .withInstanceCount(1686986385); model = BinaryData.fromObject(model).toObject(ServiceResourceCreateUpdateProperties.class); Assertions.assertEquals(ServiceSize.COSMOS_D4S, model.instanceSize()); - Assertions.assertEquals(1678865876, model.instanceCount()); + Assertions.assertEquals(1686986385, model.instanceCount()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceInnerTests.java index fd61532c730f..c7658e0f3549 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceInnerTests.java @@ -13,9 +13,9 @@ public final class ServiceResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceResourceInner model = BinaryData.fromString( - "{\"properties\":{\"serviceType\":\"ServiceResourceProperties\",\"creationTime\":\"2021-03-04T04:24:17Z\",\"instanceSize\":\"Cosmos.D16s\",\"instanceCount\":1128260811,\"status\":\"Stopped\",\"zmgschnzrsbkkzov\":\"\\\"datalgtpvdvat\\\"\",\"orimmo\":\"\\\"datazdmnfmfwsxafofu\\\"\"},\"id\":\"wdehk\",\"name\":\"mvhzfovanyrvaprt\",\"type\":\"elgwewi\"}") + "{\"properties\":{\"serviceType\":\"ServiceResourceProperties\",\"creationTime\":\"2021-12-03T12:34:04Z\",\"instanceSize\":\"Cosmos.D16s\",\"instanceCount\":729793676,\"status\":\"Stopped\",\"qkkge\":\"\\\"dataegajrzctwymzsk\\\"\",\"oobkjlca\":\"\\\"dataeiphgliupqs\\\"\"},\"id\":\"qcomjiqiince\",\"name\":\"xxkdevpxim\",\"type\":\"iizm\"}") .toObject(ServiceResourceInner.class); Assertions.assertEquals(ServiceSize.COSMOS_D16S, model.properties().instanceSize()); - Assertions.assertEquals(1128260811, model.properties().instanceCount()); + Assertions.assertEquals(729793676, model.properties().instanceCount()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceListResultTests.java index c246ef6bf49f..755b0338970d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourceListResultTests.java @@ -12,8 +12,8 @@ public final class ServiceResourceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceResourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"serviceType\":\"ServiceResourceProperties\",\"creationTime\":\"2021-09-29T01:37:44Z\",\"instanceSize\":\"Cosmos.D4s\",\"instanceCount\":1845663927,\"status\":\"Updating\",\"laumydmhweqjf\":\"\\\"dataxljbkhxsd\\\"\"},\"id\":\"ydgtokvqbvwgl\",\"name\":\"w\",\"type\":\"pvxakglhpsesrfga\"},{\"properties\":{\"serviceType\":\"ServiceResourceProperties\",\"creationTime\":\"2021-07-14T02:49:20Z\",\"instanceSize\":\"Cosmos.D8s\",\"instanceCount\":217936858,\"status\":\"Error\",\"cbqp\":\"\\\"datahgoqgsoyqyxyj\\\"\",\"joxtdahne\":\"\\\"dataispgl\\\"\"},\"id\":\"ovt\",\"name\":\"jztivfwjlofzek\",\"type\":\"srmau\"},{\"properties\":{\"serviceType\":\"ServiceResourceProperties\",\"creationTime\":\"2021-12-01T04:15Z\",\"instanceSize\":\"Cosmos.D4s\",\"instanceCount\":951671486,\"status\":\"Updating\",\"wxn\":\"\\\"datapejovt\\\"\",\"ee\":\"\\\"datawhhnoyrzaa\\\"\",\"jeatea\":\"\\\"datapmjen\\\"\"},\"id\":\"crxoxdj\",\"name\":\"l\",\"type\":\"n\"},{\"properties\":{\"serviceType\":\"ServiceResourceProperties\",\"creationTime\":\"2021-06-20T15:59:24Z\",\"instanceSize\":\"Cosmos.D4s\",\"instanceCount\":417393598,\"status\":\"Stopped\",\"zaledoyqxlunkf\":\"\\\"datandwdbvx\\\"\",\"oanpohrvm\":\"\\\"datahmcxqqxmyzkl\\\"\",\"a\":\"\\\"datarqra\\\"\",\"k\":\"\\\"dataivznllas\\\"\"},\"id\":\"hjqjpv\",\"name\":\"aihxjtgzgtaiywbq\",\"type\":\"roigbsfsgsaenwld\"}],\"nextLink\":\"hljqlxsp\"}") + "{\"value\":[{\"properties\":{\"serviceType\":\"ServiceResourceProperties\",\"creationTime\":\"2021-01-12T03:28:53Z\",\"instanceSize\":\"Cosmos.D8s\",\"instanceCount\":614347771,\"status\":\"Stopped\",\"fjjfxtizt\":\"\\\"dataluqalpc\\\"\",\"h\":\"\\\"datadst\\\"\"},\"id\":\"saaxxsrit\",\"name\":\"cw\",\"type\":\"aaesyyefmxwoqot\"}],\"nextLink\":\"qb\"}") .toObject(ServiceResourceListResult.class); - Assertions.assertEquals("hljqlxsp", model.nextLink()); + Assertions.assertEquals("qb", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourcePropertiesTests.java index 4883a037277e..8a5b0fd5a71a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ServiceResourcePropertiesTests.java @@ -13,9 +13,9 @@ public final class ServiceResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceResourceProperties model = BinaryData.fromString( - "{\"serviceType\":\"ServiceResourceProperties\",\"creationTime\":\"2021-03-07T23:57:29Z\",\"instanceSize\":\"Cosmos.D4s\",\"instanceCount\":1497307217,\"status\":\"Running\",\"oqjum\":\"\\\"datan\\\"\",\"vzopaxmfmvsm\":\"\\\"datavsfbp\\\"\"}") + "{\"serviceType\":\"ServiceResourceProperties\",\"creationTime\":\"2021-03-23T23:39:22Z\",\"instanceSize\":\"Cosmos.D4s\",\"instanceCount\":440295795,\"status\":\"Running\",\"j\":\"\\\"dataxxpqhmlqibtblmcv\\\"\",\"fqvpbqsdqkpsbqsb\":\"\\\"dataznotd\\\"\",\"taftazgcx\":\"\\\"datam\\\"\"}") .toObject(ServiceResourceProperties.class); Assertions.assertEquals(ServiceSize.COSMOS_D4S, model.instanceSize()); - Assertions.assertEquals(1497307217, model.instanceCount()); + Assertions.assertEquals(440295795, model.instanceCount()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeleteConfigurationTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeleteConfigurationTests.java new file mode 100644 index 000000000000..80130ef4e5c7 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeleteConfigurationTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.SoftDeleteConfiguration; +import org.junit.jupiter.api.Assertions; + +public final class SoftDeleteConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SoftDeleteConfiguration model = BinaryData.fromString( + "{\"softDeletionEnabled\":true,\"minMinutesBeforePermanentDeletionAllowed\":129742346,\"softDeleteRetentionPeriodInMinutes\":173387394}") + .toObject(SoftDeleteConfiguration.class); + Assertions.assertTrue(model.softDeletionEnabled()); + Assertions.assertEquals(129742346, model.minMinutesBeforePermanentDeletionAllowed()); + Assertions.assertEquals(173387394, model.softDeleteRetentionPeriodInMinutes()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SoftDeleteConfiguration model = new SoftDeleteConfiguration().withSoftDeletionEnabled(true) + .withMinMinutesBeforePermanentDeletionAllowed(129742346) + .withSoftDeleteRetentionPeriodInMinutes(173387394); + model = BinaryData.fromObject(model).toObject(SoftDeleteConfiguration.class); + Assertions.assertTrue(model.softDeletionEnabled()); + Assertions.assertEquals(129742346, model.minMinutesBeforePermanentDeletionAllowed()); + Assertions.assertEquals(173387394, model.softDeleteRetentionPeriodInMinutes()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountGetResultInnerTests.java new file mode 100644 index 000000000000..728948f0782b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountGetResultInnerTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedDatabaseAccountGetResultInner; +import org.junit.jupiter.api.Assertions; + +public final class SoftDeletedDatabaseAccountGetResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SoftDeletedDatabaseAccountGetResultInner model = BinaryData.fromString( + "{\"properties\":{\"accountName\":\"dkaxpfobkzhmhj\",\"softDeletionMetadata\":{\"isSoftDeleted\":true,\"softDeletionStartTimestamp\":5547583126057130172,\"softDeletionResourceExpirationTimestamp\":6025471971697107920},\"softDeleteConfiguration\":{\"softDeletionEnabled\":true,\"minMinutesBeforePermanentDeletionAllowed\":1008528358,\"softDeleteRetentionPeriodInMinutes\":783020978},\"resource\":{\"locations\":[{\"id\":\"ysrkgzkyhudbk\",\"locationName\":\"pzqxlcweakfec\",\"documentEndpoint\":\"xfaqufqizjvp\",\"provisioningState\":\"ooajeyyjmjjx\",\"failoverPriority\":860498990,\"isZoneRedundant\":true},{\"id\":\"nzlslekc\",\"locationName\":\"gzkj\",\"documentEndpoint\":\"qpdwad\",\"provisioningState\":\"hz\",\"failoverPriority\":1094928662,\"isZoneRedundant\":true},{\"id\":\"zdjia\",\"locationName\":\"qymjzucwwmejjqhd\",\"documentEndpoint\":\"vmqxi\",\"provisioningState\":\"okyfoz\",\"failoverPriority\":1351771410,\"isZoneRedundant\":false}],\"writeLocations\":[{\"id\":\"fqpgaixwrgr\",\"locationName\":\"derfrswqikwepwog\",\"documentEndpoint\":\"icwn\",\"provisioningState\":\"tfmcqbsudzpgc\",\"failoverPriority\":1356927934,\"isZoneRedundant\":false},{\"id\":\"umjdjxhzghg\",\"locationName\":\"kynrceqavf\",\"documentEndpoint\":\"dfmmxjdnajuopjy\",\"provisioningState\":\"mk\",\"failoverPriority\":1031721259,\"isZoneRedundant\":false},{\"id\":\"loqd\",\"locationName\":\"kluxxrwzobuzmsxg\",\"documentEndpoint\":\"tdtkwppthuz\",\"provisioningState\":\"rmimrljdpoqfxyem\",\"failoverPriority\":585204225,\"isZoneRedundant\":false}],\"readLocations\":[{\"id\":\"htecloa\",\"locationName\":\"mxtllfl\",\"documentEndpoint\":\"mq\",\"provisioningState\":\"rrfijhgg\",\"failoverPriority\":2088229419,\"isZoneRedundant\":false},{\"id\":\"mkli\",\"locationName\":\"rwdvffhsdpzou\",\"documentEndpoint\":\"tqrxqwqnjxrdf\",\"provisioningState\":\"t\",\"failoverPriority\":2057015999,\"isZoneRedundant\":true}]}},\"id\":\"avcz\",\"name\":\"xdfweapyf\",\"type\":\"lxrljphraspifl\"}") + .toObject(SoftDeletedDatabaseAccountGetResultInner.class); + Assertions.assertEquals("dkaxpfobkzhmhj", model.properties().accountName()); + Assertions.assertTrue(model.properties().softDeletionMetadata().isSoftDeleted()); + Assertions.assertEquals(5547583126057130172L, + model.properties().softDeletionMetadata().softDeletionStartTimestamp()); + Assertions.assertEquals(6025471971697107920L, + model.properties().softDeletionMetadata().softDeletionResourceExpirationTimestamp()); + Assertions.assertTrue(model.properties().softDeleteConfiguration().softDeletionEnabled()); + Assertions.assertEquals(1008528358, + model.properties().softDeleteConfiguration().minMinutesBeforePermanentDeletionAllowed()); + Assertions.assertEquals(783020978, + model.properties().softDeleteConfiguration().softDeleteRetentionPeriodInMinutes()); + Assertions.assertEquals("pzqxlcweakfec", model.properties().resource().locations().get(0).locationName()); + Assertions.assertEquals(860498990, model.properties().resource().locations().get(0).failoverPriority()); + Assertions.assertTrue(model.properties().resource().locations().get(0).isZoneRedundant()); + Assertions.assertEquals("derfrswqikwepwog", + model.properties().resource().writeLocations().get(0).locationName()); + Assertions.assertEquals(1356927934, model.properties().resource().writeLocations().get(0).failoverPriority()); + Assertions.assertFalse(model.properties().resource().writeLocations().get(0).isZoneRedundant()); + Assertions.assertEquals("mxtllfl", model.properties().resource().readLocations().get(0).locationName()); + Assertions.assertEquals(2088229419, model.properties().resource().readLocations().get(0).failoverPriority()); + Assertions.assertFalse(model.properties().resource().readLocations().get(0).isZoneRedundant()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountPropertiesTests.java new file mode 100644 index 000000000000..aa1e97643e4e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountPropertiesTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.SoftDeletedDatabaseAccountProperties; +import org.junit.jupiter.api.Assertions; + +public final class SoftDeletedDatabaseAccountPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SoftDeletedDatabaseAccountProperties model = BinaryData.fromString( + "{\"accountName\":\"m\",\"softDeletionMetadata\":{\"isSoftDeleted\":false,\"softDeletionStartTimestamp\":1207374245286390718,\"softDeletionResourceExpirationTimestamp\":7091441102511309173},\"softDeleteConfiguration\":{\"softDeletionEnabled\":false,\"minMinutesBeforePermanentDeletionAllowed\":321351381,\"softDeleteRetentionPeriodInMinutes\":629950914},\"resource\":{\"locations\":[{\"id\":\"pxtokljmtznp\",\"locationName\":\"wfqtyyqipr\",\"documentEndpoint\":\"tungbsoljckmiigz\",\"provisioningState\":\"uck\",\"failoverPriority\":547659236,\"isZoneRedundant\":false},{\"id\":\"w\",\"locationName\":\"iqqcq\",\"documentEndpoint\":\"clsmal\",\"provisioningState\":\"swoykdn\",\"failoverPriority\":1998533030,\"isZoneRedundant\":true}],\"writeLocations\":[{\"id\":\"zrujlqcwnyn\",\"locationName\":\"eiqbcbgvsbts\",\"documentEndpoint\":\"toxadhxuvjhxmnr\",\"provisioningState\":\"tjc\",\"failoverPriority\":1223754124,\"isZoneRedundant\":true},{\"id\":\"gicvnpvvdh\",\"locationName\":\"naqyqipslzmvcds\",\"documentEndpoint\":\"wbitekdtfob\",\"provisioningState\":\"iy\",\"failoverPriority\":930385503,\"isZoneRedundant\":false},{\"id\":\"gybfzdqekiv\",\"locationName\":\"p\",\"documentEndpoint\":\"vdizulrqtbh\",\"provisioningState\":\"ezp\",\"failoverPriority\":1784958915,\"isZoneRedundant\":false},{\"id\":\"mxmdutzfkgilnou\",\"locationName\":\"cgndjgdp\",\"documentEndpoint\":\"ggqqyeqfcb\",\"provisioningState\":\"lpyuflqjf\",\"failoverPriority\":1679929434,\"isZoneRedundant\":true}],\"readLocations\":[{\"id\":\"higimwdcsklkqnqv\",\"locationName\":\"xn\",\"documentEndpoint\":\"zmec\",\"provisioningState\":\"rzwimbzayspz\",\"failoverPriority\":215408890,\"isZoneRedundant\":true}]}}") + .toObject(SoftDeletedDatabaseAccountProperties.class); + Assertions.assertEquals("m", model.accountName()); + Assertions.assertFalse(model.softDeletionMetadata().isSoftDeleted()); + Assertions.assertEquals(1207374245286390718L, model.softDeletionMetadata().softDeletionStartTimestamp()); + Assertions.assertEquals(7091441102511309173L, + model.softDeletionMetadata().softDeletionResourceExpirationTimestamp()); + Assertions.assertFalse(model.softDeleteConfiguration().softDeletionEnabled()); + Assertions.assertEquals(321351381, model.softDeleteConfiguration().minMinutesBeforePermanentDeletionAllowed()); + Assertions.assertEquals(629950914, model.softDeleteConfiguration().softDeleteRetentionPeriodInMinutes()); + Assertions.assertEquals("wfqtyyqipr", model.resource().locations().get(0).locationName()); + Assertions.assertEquals(547659236, model.resource().locations().get(0).failoverPriority()); + Assertions.assertFalse(model.resource().locations().get(0).isZoneRedundant()); + Assertions.assertEquals("eiqbcbgvsbts", model.resource().writeLocations().get(0).locationName()); + Assertions.assertEquals(1223754124, model.resource().writeLocations().get(0).failoverPriority()); + Assertions.assertTrue(model.resource().writeLocations().get(0).isZoneRedundant()); + Assertions.assertEquals("xn", model.resource().readLocations().get(0).locationName()); + Assertions.assertEquals(215408890, model.resource().readLocations().get(0).failoverPriority()); + Assertions.assertTrue(model.resource().readLocations().get(0).isZoneRedundant()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountResourceTests.java new file mode 100644 index 000000000000..cc835e50e09f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountResourceTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.SoftDeletedDatabaseAccountResource; +import org.junit.jupiter.api.Assertions; + +public final class SoftDeletedDatabaseAccountResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SoftDeletedDatabaseAccountResource model = BinaryData.fromString( + "{\"locations\":[{\"id\":\"tpvdva\",\"locationName\":\"zmgschnzrsbkkzov\",\"documentEndpoint\":\"dmnfmfws\",\"provisioningState\":\"fo\",\"failoverPriority\":1386264221,\"isZoneRedundant\":false},{\"id\":\"mmovzwd\",\"locationName\":\"kkmvhzfovanyrva\",\"documentEndpoint\":\"tgelgwewikfy\",\"provisioningState\":\"a\",\"failoverPriority\":1559958018,\"isZoneRedundant\":false},{\"id\":\"qoq\",\"locationName\":\"movsfbpbvz\",\"documentEndpoint\":\"axmfmvsmcwoxfa\",\"provisioningState\":\"tnq\",\"failoverPriority\":903952775,\"isZoneRedundant\":false}],\"writeLocations\":[{\"id\":\"iauesugmocpcjy\",\"locationName\":\"oelrgttwfl\",\"documentEndpoint\":\"iuorinikc\",\"provisioningState\":\"pks\",\"failoverPriority\":621898517,\"isZoneRedundant\":false},{\"id\":\"mqr\",\"locationName\":\"zqv\",\"documentEndpoint\":\"czyayubtgmbxi\",\"provisioningState\":\"hragpxmib\",\"failoverPriority\":2119885662,\"isZoneRedundant\":true},{\"id\":\"yryefqm\",\"locationName\":\"vyztxlno\",\"documentEndpoint\":\"pbjceegvy\",\"provisioningState\":\"ztkutnj\",\"failoverPriority\":223070663,\"isZoneRedundant\":false}],\"readLocations\":[{\"id\":\"hyhtmjodui\",\"locationName\":\"ulxfaryrvjl\",\"documentEndpoint\":\"ezvjq\",\"provisioningState\":\"hoyiyaxqvjweiw\",\"failoverPriority\":185290437,\"isZoneRedundant\":true},{\"id\":\"nvovbooqbmdqrxy\",\"locationName\":\"ae\",\"documentEndpoint\":\"cflwtjdtlr\",\"provisioningState\":\"fooy\",\"failoverPriority\":1864219869,\"isZoneRedundant\":false}]}") + .toObject(SoftDeletedDatabaseAccountResource.class); + Assertions.assertEquals("zmgschnzrsbkkzov", model.locations().get(0).locationName()); + Assertions.assertEquals(1386264221, model.locations().get(0).failoverPriority()); + Assertions.assertFalse(model.locations().get(0).isZoneRedundant()); + Assertions.assertEquals("oelrgttwfl", model.writeLocations().get(0).locationName()); + Assertions.assertEquals(621898517, model.writeLocations().get(0).failoverPriority()); + Assertions.assertFalse(model.writeLocations().get(0).isZoneRedundant()); + Assertions.assertEquals("ulxfaryrvjl", model.readLocations().get(0).locationName()); + Assertions.assertEquals(185290437, model.readLocations().get(0).failoverPriority()); + Assertions.assertTrue(model.readLocations().get(0).isZoneRedundant()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsListResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsListResultInnerTests.java new file mode 100644 index 000000000000..ad6b988b0cf0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedDatabaseAccountsListResultInnerTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedDatabaseAccountsListResultInner; +import org.junit.jupiter.api.Assertions; + +public final class SoftDeletedDatabaseAccountsListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SoftDeletedDatabaseAccountsListResultInner model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"accountName\":\"q\",\"softDeletionMetadata\":{\"isSoftDeleted\":true,\"softDeletionStartTimestamp\":1168947371184852214,\"softDeletionResourceExpirationTimestamp\":295719585737960444},\"softDeleteConfiguration\":{\"softDeletionEnabled\":false,\"minMinutesBeforePermanentDeletionAllowed\":543700233,\"softDeleteRetentionPeriodInMinutes\":525078706},\"resource\":{\"locations\":[{},{},{},{}],\"writeLocations\":[{}],\"readLocations\":[{},{},{}]}},\"id\":\"bijux\",\"name\":\"qllczipvwdtgckz\",\"type\":\"qiqdlratrkwxoau\"},{\"properties\":{\"accountName\":\"u\",\"softDeletionMetadata\":{\"isSoftDeleted\":true,\"softDeletionStartTimestamp\":3189041283960797066,\"softDeletionResourceExpirationTimestamp\":5588879302005587936},\"softDeleteConfiguration\":{\"softDeletionEnabled\":true,\"minMinutesBeforePermanentDeletionAllowed\":384208738,\"softDeleteRetentionPeriodInMinutes\":1131150565},\"resource\":{\"locations\":[{},{}],\"writeLocations\":[{},{},{}],\"readLocations\":[{},{}]}},\"id\":\"eo\",\"name\":\"pajtfeyvkbd\",\"type\":\"dd\"}],\"nextLink\":\"hdccxb\"}") + .toObject(SoftDeletedDatabaseAccountsListResultInner.class); + Assertions.assertEquals("q", model.value().get(0).properties().accountName()); + Assertions.assertTrue(model.value().get(0).properties().softDeletionMetadata().isSoftDeleted()); + Assertions.assertEquals(1168947371184852214L, + model.value().get(0).properties().softDeletionMetadata().softDeletionStartTimestamp()); + Assertions.assertEquals(295719585737960444L, + model.value().get(0).properties().softDeletionMetadata().softDeletionResourceExpirationTimestamp()); + Assertions.assertFalse(model.value().get(0).properties().softDeleteConfiguration().softDeletionEnabled()); + Assertions.assertEquals(543700233, + model.value().get(0).properties().softDeleteConfiguration().minMinutesBeforePermanentDeletionAllowed()); + Assertions.assertEquals(525078706, + model.value().get(0).properties().softDeleteConfiguration().softDeleteRetentionPeriodInMinutes()); + Assertions.assertEquals("hdccxb", model.nextLink()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabaseGetResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabaseGetResultInnerTests.java new file mode 100644 index 000000000000..52c0deea7167 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabaseGetResultInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedSqlDatabaseGetResultInner; +import org.junit.jupiter.api.Assertions; + +public final class SoftDeletedSqlDatabaseGetResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SoftDeletedSqlDatabaseGetResultInner model = BinaryData.fromString( + "{\"properties\":{\"softDeletionMetadata\":{\"isSoftDeleted\":false,\"softDeletionStartTimestamp\":6321247129359555244,\"softDeletionResourceExpirationTimestamp\":4751914019689746283},\"resource\":{\"id\":\"wgu\",\"_rid\":\"tijcxfnondegjdy\"}},\"id\":\"qkkkbjuckcatuqbh\",\"name\":\"owcnxtpz\",\"type\":\"lyseidtoak\"}") + .toObject(SoftDeletedSqlDatabaseGetResultInner.class); + Assertions.assertFalse(model.properties().softDeletionMetadata().isSoftDeleted()); + Assertions.assertEquals(6321247129359555244L, + model.properties().softDeletionMetadata().softDeletionStartTimestamp()); + Assertions.assertEquals(4751914019689746283L, + model.properties().softDeletionMetadata().softDeletionResourceExpirationTimestamp()); + Assertions.assertEquals("wgu", model.properties().resource().id()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasePropertiesTests.java new file mode 100644 index 000000000000..012030dbcd04 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasePropertiesTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.SoftDeletedSqlDatabaseProperties; +import org.junit.jupiter.api.Assertions; + +public final class SoftDeletedSqlDatabasePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SoftDeletedSqlDatabaseProperties model = BinaryData.fromString( + "{\"softDeletionMetadata\":{\"isSoftDeleted\":true,\"softDeletionStartTimestamp\":5596056433288178051,\"softDeletionResourceExpirationTimestamp\":8795625755445877898},\"resource\":{\"id\":\"qfdpf\",\"_rid\":\"rptvcshtkutzcttb\"}}") + .toObject(SoftDeletedSqlDatabaseProperties.class); + Assertions.assertTrue(model.softDeletionMetadata().isSoftDeleted()); + Assertions.assertEquals(5596056433288178051L, model.softDeletionMetadata().softDeletionStartTimestamp()); + Assertions.assertEquals(8795625755445877898L, + model.softDeletionMetadata().softDeletionResourceExpirationTimestamp()); + Assertions.assertEquals("qfdpf", model.resource().id()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabaseResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabaseResourceTests.java new file mode 100644 index 000000000000..e6804a4eff5f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabaseResourceTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.SoftDeletedSqlDatabaseResource; +import org.junit.jupiter.api.Assertions; + +public final class SoftDeletedSqlDatabaseResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SoftDeletedSqlDatabaseResource model = BinaryData.fromString("{\"id\":\"gdirda\",\"_rid\":\"tzjgcfjfxtbwj\"}") + .toObject(SoftDeletedSqlDatabaseResource.class); + Assertions.assertEquals("gdirda", model.id()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesListResultInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesListResultInnerTests.java new file mode 100644 index 000000000000..68a93345c3f0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletedSqlDatabasesListResultInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.SoftDeletedSqlDatabasesListResultInner; +import org.junit.jupiter.api.Assertions; + +public final class SoftDeletedSqlDatabasesListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SoftDeletedSqlDatabasesListResultInner model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"softDeletionMetadata\":{\"isSoftDeleted\":false,\"softDeletionStartTimestamp\":3555702317432129368,\"softDeletionResourceExpirationTimestamp\":1646444870064449346},\"resource\":{\"id\":\"ofgeoagf\",\"_rid\":\"ftnxodwxmdajwiy\"}},\"id\":\"gsevmdm\",\"name\":\"enlrstgf\",\"type\":\"zljdnci\"}],\"nextLink\":\"jvamyyznmrgcdo\"}") + .toObject(SoftDeletedSqlDatabasesListResultInner.class); + Assertions.assertFalse(model.value().get(0).properties().softDeletionMetadata().isSoftDeleted()); + Assertions.assertEquals(3555702317432129368L, + model.value().get(0).properties().softDeletionMetadata().softDeletionStartTimestamp()); + Assertions.assertEquals(1646444870064449346L, + model.value().get(0).properties().softDeletionMetadata().softDeletionResourceExpirationTimestamp()); + Assertions.assertEquals("ofgeoagf", model.value().get(0).properties().resource().id()); + Assertions.assertEquals("jvamyyznmrgcdo", model.nextLink()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletionMetadataTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletionMetadataTests.java new file mode 100644 index 000000000000..2d33be20f21d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SoftDeletionMetadataTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.SoftDeletionMetadata; +import org.junit.jupiter.api.Assertions; + +public final class SoftDeletionMetadataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SoftDeletionMetadata model = BinaryData.fromString( + "{\"isSoftDeleted\":true,\"softDeletionStartTimestamp\":7048536431924339915,\"softDeletionResourceExpirationTimestamp\":6327913193427530871}") + .toObject(SoftDeletionMetadata.class); + Assertions.assertTrue(model.isSoftDeleted()); + Assertions.assertEquals(7048536431924339915L, model.softDeletionStartTimestamp()); + Assertions.assertEquals(6327913193427530871L, model.softDeletionResourceExpirationTimestamp()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SpatialSpecTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SpatialSpecTests.java index 394f4af590f1..1ca843ba72e8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SpatialSpecTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SpatialSpecTests.java @@ -13,18 +13,20 @@ public final class SpatialSpecTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SpatialSpec model = BinaryData.fromString("{\"path\":\"vudtjuewbcihx\",\"types\":[\"LineString\",\"Point\"]}") + SpatialSpec model = BinaryData + .fromString("{\"path\":\"ijddtvqc\",\"types\":[\"Point\",\"LineString\",\"MultiPolygon\",\"LineString\"]}") .toObject(SpatialSpec.class); - Assertions.assertEquals("vudtjuewbcihx", model.path()); - Assertions.assertEquals(SpatialType.LINE_STRING, model.types().get(0)); + Assertions.assertEquals("ijddtvqc", model.path()); + Assertions.assertEquals(SpatialType.POINT, model.types().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SpatialSpec model = new SpatialSpec().withPath("vudtjuewbcihx") - .withTypes(Arrays.asList(SpatialType.LINE_STRING, SpatialType.POINT)); + SpatialSpec model = new SpatialSpec().withPath("ijddtvqc") + .withTypes(Arrays.asList(SpatialType.POINT, SpatialType.LINE_STRING, SpatialType.MULTI_POLYGON, + SpatialType.LINE_STRING)); model = BinaryData.fromObject(model).toObject(SpatialSpec.class); - Assertions.assertEquals("vudtjuewbcihx", model.path()); - Assertions.assertEquals(SpatialType.LINE_STRING, model.types().get(0)); + Assertions.assertEquals("ijddtvqc", model.path()); + Assertions.assertEquals(SpatialType.POINT, model.types().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlContainerGetPropertiesOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlContainerGetPropertiesOptionsTests.java index 018dc624fedc..470e30122588 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlContainerGetPropertiesOptionsTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlContainerGetPropertiesOptionsTests.java @@ -12,9 +12,9 @@ public final class SqlContainerGetPropertiesOptionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlContainerGetPropertiesOptions model - = BinaryData.fromString("{\"throughput\":598557579,\"autoscaleSettings\":{\"maxThroughput\":1713301534}}") + = BinaryData.fromString("{\"throughput\":434775558,\"autoscaleSettings\":{\"maxThroughput\":6794810}}") .toObject(SqlContainerGetPropertiesOptions.class); - Assertions.assertEquals(598557579, model.throughput()); - Assertions.assertEquals(1713301534, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(434775558, model.throughput()); + Assertions.assertEquals(6794810, model.autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseCreateUpdateParametersTests.java index de87893ff59b..76c3847a6123 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseCreateUpdateParametersTests.java @@ -23,47 +23,49 @@ public final class SqlDatabaseCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlDatabaseCreateUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"id\":\"fxrxxle\",\"restoreParameters\":{\"restoreSource\":\"amxjezwlw\",\"restoreTimestampInUtc\":\"2021-07-30T12:05:38Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"},\"options\":{\"throughput\":292639460,\"autoscaleSettings\":{\"maxThroughput\":1148696906}}},\"id\":\"dooaojkniodko\",\"name\":\"bw\",\"type\":\"jhemms\",\"location\":\"dkcrodt\",\"tags\":{\"lfltka\":\"fw\",\"gaowpulpqblylsyx\":\"jvefkdlfoakggkfp\",\"xsdszuempsb\":\"qjnsjervtia\",\"v\":\"kfzbeyvpnqicvi\"},\"identity\":{\"principalId\":\"xdxr\",\"tenantId\":\"ukzclewyhmlwpaz\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"zfeqztppri\":{\"principalId\":\"cckwyfzqwhxxbu\",\"clientId\":\"a\"}}}}") + "{\"properties\":{\"resource\":{\"id\":\"ngwfqatm\",\"restoreParameters\":{\"restoreSource\":\"tmdvypgikdgs\",\"restoreTimestampInUtc\":\"2021-07-11T10:33:14Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":574847492,\"autoscaleSettings\":{\"maxThroughput\":421118351}}},\"id\":\"kj\",\"name\":\"rvqqaatj\",\"type\":\"rv\",\"location\":\"upmfiibfg\",\"tags\":{\"rwxkvtkkgl\":\"ool\",\"vblm\":\"qwjygvja\",\"byrqufeg\":\"vkzuhbxvvyhgso\",\"mctlpdngitv\":\"uvwzfbnh\"},\"identity\":{\"principalId\":\"hrixkwmy\",\"tenantId\":\"ejvegrhbpnaixex\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"tpwijnh\":{\"principalId\":\"ax\",\"clientId\":\"exdrrvqahqkg\"},\"qp\":{\"principalId\":\"svfycxzbfv\",\"clientId\":\"wvrvmtg\"},\"ekrrjr\":{\"principalId\":\"ostronz\",\"clientId\":\"hgfipnsxkmcw\"}}}}") .toObject(SqlDatabaseCreateUpdateParameters.class); - Assertions.assertEquals("dkcrodt", model.location()); - Assertions.assertEquals("fw", model.tags().get("lfltka")); - Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("fxrxxle", model.resource().id()); - Assertions.assertEquals("amxjezwlw", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T12:05:38Z"), + Assertions.assertEquals("upmfiibfg", model.location()); + Assertions.assertEquals("ool", model.tags().get("rwxkvtkkgl")); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("ngwfqatm", model.resource().id()); + Assertions.assertEquals("tmdvypgikdgs", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-11T10:33:14Z"), model.resource().restoreParameters().restoreTimestampInUtc()); - Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(292639460, model.options().throughput()); - Assertions.assertEquals(1148696906, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(574847492, model.options().throughput()); + Assertions.assertEquals(421118351, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SqlDatabaseCreateUpdateParameters model = new SqlDatabaseCreateUpdateParameters().withLocation("dkcrodt") - .withTags(mapOf("lfltka", "fw", "gaowpulpqblylsyx", "jvefkdlfoakggkfp", "xsdszuempsb", "qjnsjervtia", "v", - "kfzbeyvpnqicvi")) - .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("zfeqztppri", new ManagedServiceIdentityUserAssignedIdentities()))) - .withResource(new SqlDatabaseResource().withId("fxrxxle") - .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("amxjezwlw") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-07-30T12:05:38Z")) - .withRestoreWithTtlDisabled(false)) + SqlDatabaseCreateUpdateParameters model = new SqlDatabaseCreateUpdateParameters().withLocation("upmfiibfg") + .withTags( + mapOf("rwxkvtkkgl", "ool", "vblm", "qwjygvja", "byrqufeg", "vkzuhbxvvyhgso", "mctlpdngitv", "uvwzfbnh")) + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("tpwijnh", new ManagedServiceIdentityUserAssignedIdentities(), "qp", + new ManagedServiceIdentityUserAssignedIdentities(), "ekrrjr", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource(new SqlDatabaseResource().withId("ngwfqatm") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("tmdvypgikdgs") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-07-11T10:33:14Z")) + .withRestoreWithTtlDisabled(true)) .withCreateMode(CreateMode.RESTORE)) - .withOptions(new CreateUpdateOptions().withThroughput(292639460) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1148696906))); + .withOptions(new CreateUpdateOptions().withThroughput(574847492) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(421118351))); model = BinaryData.fromObject(model).toObject(SqlDatabaseCreateUpdateParameters.class); - Assertions.assertEquals("dkcrodt", model.location()); - Assertions.assertEquals("fw", model.tags().get("lfltka")); - Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("fxrxxle", model.resource().id()); - Assertions.assertEquals("amxjezwlw", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T12:05:38Z"), + Assertions.assertEquals("upmfiibfg", model.location()); + Assertions.assertEquals("ool", model.tags().get("rwxkvtkkgl")); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("ngwfqatm", model.resource().id()); + Assertions.assertEquals("tmdvypgikdgs", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-11T10:33:14Z"), model.resource().restoreParameters().restoreTimestampInUtc()); - Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(292639460, model.options().throughput()); - Assertions.assertEquals(1148696906, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(574847492, model.options().throughput()); + Assertions.assertEquals(421118351, model.options().autoscaleSettings().maxThroughput()); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseCreateUpdatePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseCreateUpdatePropertiesTests.java index 64e904a1f9bc..2a5e40d472b1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseCreateUpdatePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseCreateUpdatePropertiesTests.java @@ -18,36 +18,36 @@ public final class SqlDatabaseCreateUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlDatabaseCreateUpdateProperties model = BinaryData.fromString( - "{\"resource\":{\"id\":\"lxorjaltolmncws\",\"restoreParameters\":{\"restoreSource\":\"wcsdbnwdcfhucq\",\"restoreTimestampInUtc\":\"2021-05-09T06:54:09Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":665760554,\"autoscaleSettings\":{\"maxThroughput\":990974821}}}") + "{\"resource\":{\"id\":\"afxtsgum\",\"restoreParameters\":{\"restoreSource\":\"lik\",\"restoreTimestampInUtc\":\"2021-10-26T10:22:19Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"},\"options\":{\"throughput\":1671943968,\"autoscaleSettings\":{\"maxThroughput\":845097361}}}") .toObject(SqlDatabaseCreateUpdateProperties.class); - Assertions.assertEquals("lxorjaltolmncws", model.resource().id()); - Assertions.assertEquals("wcsdbnwdcfhucq", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-09T06:54:09Z"), + Assertions.assertEquals("afxtsgum", model.resource().id()); + Assertions.assertEquals("lik", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-26T10:22:19Z"), model.resource().restoreParameters().restoreTimestampInUtc()); - Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(665760554, model.options().throughput()); - Assertions.assertEquals(990974821, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1671943968, model.options().throughput()); + Assertions.assertEquals(845097361, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SqlDatabaseCreateUpdateProperties model = new SqlDatabaseCreateUpdateProperties() - .withResource(new SqlDatabaseResource().withId("lxorjaltolmncws") - .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("wcsdbnwdcfhucq") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-05-09T06:54:09Z")) - .withRestoreWithTtlDisabled(true)) + .withResource(new SqlDatabaseResource().withId("afxtsgum") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("lik") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-10-26T10:22:19Z")) + .withRestoreWithTtlDisabled(false)) .withCreateMode(CreateMode.RESTORE)) - .withOptions(new CreateUpdateOptions().withThroughput(665760554) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(990974821))); + .withOptions(new CreateUpdateOptions().withThroughput(1671943968) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(845097361))); model = BinaryData.fromObject(model).toObject(SqlDatabaseCreateUpdateProperties.class); - Assertions.assertEquals("lxorjaltolmncws", model.resource().id()); - Assertions.assertEquals("wcsdbnwdcfhucq", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-09T06:54:09Z"), + Assertions.assertEquals("afxtsgum", model.resource().id()); + Assertions.assertEquals("lik", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-26T10:22:19Z"), model.resource().restoreParameters().restoreTimestampInUtc()); - Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); + Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(665760554, model.options().throughput()); - Assertions.assertEquals(990974821, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1671943968, model.options().throughput()); + Assertions.assertEquals(845097361, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetPropertiesOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetPropertiesOptionsTests.java index 01e500a1348a..c0bad23a1ced 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetPropertiesOptionsTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetPropertiesOptionsTests.java @@ -12,9 +12,9 @@ public final class SqlDatabaseGetPropertiesOptionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlDatabaseGetPropertiesOptions model - = BinaryData.fromString("{\"throughput\":1754229077,\"autoscaleSettings\":{\"maxThroughput\":725255215}}") + = BinaryData.fromString("{\"throughput\":819440507,\"autoscaleSettings\":{\"maxThroughput\":84302397}}") .toObject(SqlDatabaseGetPropertiesOptions.class); - Assertions.assertEquals(1754229077, model.throughput()); - Assertions.assertEquals(725255215, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(819440507, model.throughput()); + Assertions.assertEquals(84302397, model.autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetPropertiesResourceTests.java index 7d6c1ad446b1..d59007fd3366 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetPropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetPropertiesResourceTests.java @@ -14,15 +14,15 @@ public final class SqlDatabaseGetPropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlDatabaseGetPropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"acqqudfnbyxbaaab\",\"_ts\":68.72236,\"_etag\":\"yffimrzrtuzqogs\",\"_colls\":\"nevfdnw\",\"_users\":\"mewzsyyc\",\"id\":\"uzsoi\",\"restoreParameters\":{\"restoreSource\":\"dpfrxtrthzvaytdw\",\"restoreTimestampInUtc\":\"2021-10-18T23:06:28Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"}") + "{\"_rid\":\"fhwygzlvdnkfxus\",\"_ts\":40.43431,\"_etag\":\"zrmuhapfcqdps\",\"_colls\":\"qvpsvuoymg\",\"_users\":\"elvezrypq\",\"id\":\"mfe\",\"restoreParameters\":{\"restoreSource\":\"rqwky\",\"restoreTimestampInUtc\":\"2021-10-15T18:34:18Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"}") .toObject(SqlDatabaseGetPropertiesResource.class); - Assertions.assertEquals("uzsoi", model.id()); - Assertions.assertEquals("dpfrxtrthzvaytdw", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-18T23:06:28Z"), + Assertions.assertEquals("mfe", model.id()); + Assertions.assertEquals("rqwky", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-15T18:34:18Z"), model.restoreParameters().restoreTimestampInUtc()); - Assertions.assertFalse(model.restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.RESTORE, model.createMode()); - Assertions.assertEquals("nevfdnw", model.colls()); - Assertions.assertEquals("mewzsyyc", model.users()); + Assertions.assertTrue(model.restoreParameters().restoreWithTtlDisabled()); + Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); + Assertions.assertEquals("qvpsvuoymg", model.colls()); + Assertions.assertEquals("elvezrypq", model.users()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetPropertiesTests.java index 295b4b335454..b229d7d31779 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetPropertiesTests.java @@ -14,17 +14,17 @@ public final class SqlDatabaseGetPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlDatabaseGetProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"m\",\"_ts\":39.09912,\"_etag\":\"jsjqbjhhyx\",\"_colls\":\"wlycoduhpkxkg\",\"_users\":\"areqna\",\"id\":\"xqugjhkycubedd\",\"restoreParameters\":{\"restoreSource\":\"ofwq\",\"restoreTimestampInUtc\":\"2021-05-03T03:51:25Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":1723578922,\"autoscaleSettings\":{\"maxThroughput\":438205503}}}") + "{\"resource\":{\"_rid\":\"o\",\"_ts\":41.892742,\"_etag\":\"udphqamvdkfwyn\",\"_colls\":\"vtbvkayh\",\"_users\":\"nvyq\",\"id\":\"atkzwpcnpw\",\"restoreParameters\":{\"restoreSource\":\"a\",\"restoreTimestampInUtc\":\"2021-02-06T15:24:08Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":1555062336,\"autoscaleSettings\":{\"maxThroughput\":306781812}}}") .toObject(SqlDatabaseGetProperties.class); - Assertions.assertEquals("xqugjhkycubedd", model.resource().id()); - Assertions.assertEquals("ofwq", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-03T03:51:25Z"), + Assertions.assertEquals("atkzwpcnpw", model.resource().id()); + Assertions.assertEquals("a", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T15:24:08Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); - Assertions.assertEquals("wlycoduhpkxkg", model.resource().colls()); - Assertions.assertEquals("areqna", model.resource().users()); - Assertions.assertEquals(1723578922, model.options().throughput()); - Assertions.assertEquals(438205503, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("vtbvkayh", model.resource().colls()); + Assertions.assertEquals("nvyq", model.resource().users()); + Assertions.assertEquals(1555062336, model.options().throughput()); + Assertions.assertEquals(306781812, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetResultsInnerTests.java index 60c0a09f4f1d..a6afce4df048 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetResultsInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseGetResultsInnerTests.java @@ -15,20 +15,20 @@ public final class SqlDatabaseGetResultsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlDatabaseGetResultsInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"g\",\"_ts\":60.119556,\"_etag\":\"fudxepxgyqagvrv\",\"_colls\":\"pkukghi\",\"_users\":\"blxgwimf\",\"id\":\"jhfjxwm\",\"restoreParameters\":{\"restoreSource\":\"kfoqreyfkzikfj\",\"restoreTimestampInUtc\":\"2021-02-22T10:12:12Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":322973840,\"autoscaleSettings\":{\"maxThroughput\":220414413}}},\"location\":\"c\",\"tags\":{\"xbjhwuaanozjosph\":\"lsfeaenwabfatkld\",\"ag\":\"oulpjrv\"},\"identity\":{\"principalId\":\"imjwosyt\",\"tenantId\":\"tcs\",\"type\":\"None\",\"userAssignedIdentities\":{\"jhdgqggebdunyga\":{\"principalId\":\"umiekkezzi\",\"clientId\":\"ly\"}}},\"id\":\"idb\",\"name\":\"fatpxllrxcyjmoa\",\"type\":\"su\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"kzhjj\",\"_ts\":70.339195,\"_etag\":\"hmouwqlgzrfze\",\"_colls\":\"ebizikayuh\",\"_users\":\"bjbsybb\",\"id\":\"wrv\",\"restoreParameters\":{\"restoreSource\":\"gmfpgvmp\",\"restoreTimestampInUtc\":\"2021-10-24T06:37:57Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":1160919949,\"autoscaleSettings\":{\"maxThroughput\":1464941672}}},\"location\":\"wutwbdsre\",\"tags\":{\"d\":\"rhneuyowq\",\"gpikpzimejza\":\"ytisibir\",\"rjqc\":\"lfzxiavrmbzonoki\"},\"identity\":{\"principalId\":\"zpfrla\",\"tenantId\":\"zrnw\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"sj\":{\"principalId\":\"pwp\",\"clientId\":\"lwbtlhf\"},\"hldvriii\":{\"principalId\":\"hszfjvfb\",\"clientId\":\"feljagrqm\"},\"qhhahhxvrhmzkwpj\":{\"principalId\":\"nalghfkvtvsexso\",\"clientId\":\"el\"},\"guufzd\":{\"principalId\":\"wspughftqsxhqx\",\"clientId\":\"xukndxdigr\"}}},\"id\":\"yqtfihwh\",\"name\":\"otzi\",\"type\":\"gamv\"}") .toObject(SqlDatabaseGetResultsInner.class); - Assertions.assertEquals("c", model.location()); - Assertions.assertEquals("lsfeaenwabfatkld", model.tags().get("xbjhwuaanozjosph")); - Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("jhfjxwm", model.resource().id()); - Assertions.assertEquals("kfoqreyfkzikfj", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-22T10:12:12Z"), + Assertions.assertEquals("wutwbdsre", model.location()); + Assertions.assertEquals("rhneuyowq", model.tags().get("d")); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("wrv", model.resource().id()); + Assertions.assertEquals("gmfpgvmp", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-24T06:37:57Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); - Assertions.assertEquals("pkukghi", model.resource().colls()); - Assertions.assertEquals("blxgwimf", model.resource().users()); - Assertions.assertEquals(322973840, model.options().throughput()); - Assertions.assertEquals(220414413, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("ebizikayuh", model.resource().colls()); + Assertions.assertEquals("bjbsybb", model.resource().users()); + Assertions.assertEquals(1160919949, model.options().throughput()); + Assertions.assertEquals(1464941672, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseListResultTests.java index a71938d5230d..628d7c0c1af5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseListResultTests.java @@ -12,8 +12,8 @@ public final class SqlDatabaseListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlDatabaseListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"tncormrlxqtvco\",\"_ts\":32.48449,\"_etag\":\"lvkgju\",\"_colls\":\"dknnqvsazn\",\"_users\":\"tor\",\"id\":\"dsg\",\"restoreParameters\":{\"restoreSource\":\"mkycgra\",\"restoreTimestampInUtc\":\"2021-03-08T23:46:06Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"},\"options\":{\"throughput\":825611906,\"autoscaleSettings\":{\"maxThroughput\":1406520561}}},\"location\":\"movsmzlxwabmqoe\",\"tags\":{\"mqlgk\":\"frvtpuqu\",\"ongbjcnt\":\"btndo\"},\"identity\":{\"principalId\":\"tcje\",\"tenantId\":\"twwaezkojvdcpzf\",\"type\":\"None\",\"userAssignedIdentities\":{\"iqopidoamciod\":{\"principalId\":\"ybxarzgszu\",\"clientId\":\"x\"}}},\"id\":\"haz\",\"name\":\"khnzbonlw\",\"type\":\"toego\"},{\"properties\":{\"resource\":{\"_rid\":\"whkszzcmrvexztvb\",\"_ts\":73.09652,\"_etag\":\"frao\",\"_colls\":\"koowtl\",\"_users\":\"guxawqaldsyuuxi\",\"id\":\"erqf\",\"restoreParameters\":{\"restoreSource\":\"yznkby\",\"restoreTimestampInUtc\":\"2021-01-17T13:00:38Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":2014772944,\"autoscaleSettings\":{\"maxThroughput\":155762894}}},\"location\":\"kdsnfdsdoakgtdl\",\"tags\":{\"l\":\"zev\",\"ejdcngqqmoakuf\":\"ewpusdsttwvogvb\",\"zr\":\"m\",\"enuuzkopbm\":\"rdgrtw\"},\"identity\":{\"principalId\":\"fdwoyuhh\",\"tenantId\":\"u\",\"type\":\"None\",\"userAssignedIdentities\":{\"ah\":{\"principalId\":\"hdmsmlmzqhoftrm\",\"clientId\":\"qu\"}}},\"id\":\"cslfaoqzpiyylha\",\"name\":\"nswhcc\",\"type\":\"ph\"},{\"properties\":{\"resource\":{\"_rid\":\"witqscywuggwoluh\",\"_ts\":55.104637,\"_etag\":\"emh\",\"_colls\":\"rsbrgzdwm\",\"_users\":\"eypqwdxggicccn\",\"id\":\"qhuexm\",\"restoreParameters\":{\"restoreSource\":\"lstvlzywe\",\"restoreTimestampInUtc\":\"2021-12-10T13:38:49Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":1411475506,\"autoscaleSettings\":{\"maxThroughput\":1367209105}}},\"location\":\"ypbsfgytguslfead\",\"tags\":{\"xgfpelolppv\":\"qukyhejhzi\"},\"identity\":{\"principalId\":\"pqvujzraehtwdwrf\",\"tenantId\":\"wib\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ykhevxccedcpnmdy\":{\"principalId\":\"h\",\"clientId\":\"fwpracstwi\"}}},\"id\":\"nwzxltjcv\",\"name\":\"hlt\",\"type\":\"ugcxnavvwxq\"}],\"nextLink\":\"y\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"lfktgplcrpwjxe\",\"_ts\":6.5758047,\"_etag\":\"gbrn\",\"_colls\":\"mw\",\"_users\":\"nbsazejjoqkag\",\"id\":\"hsxttaugzxnf\",\"restoreParameters\":{\"restoreSource\":\"pxdtnkdmkq\",\"restoreTimestampInUtc\":\"2021-01-29T06:17:27Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":1870026194,\"autoscaleSettings\":{\"maxThroughput\":438145341}}},\"location\":\"aibrebqaaysjkixq\",\"tags\":{\"ffiakp\":\"ttezlw\",\"tmmjihyeozph\":\"pqqmted\",\"qncygupkvi\":\"wau\",\"hfstotxhojujbyp\":\"mdscwxqupev\"},\"identity\":{\"principalId\":\"c\",\"tenantId\":\"hixbjxyfwnyl\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"iwii\":{\"principalId\":\"ttpkiwkkbnujrywv\",\"clientId\":\"lbfpncurd\"},\"umwctondz\":{\"principalId\":\"tywubxcbihwq\",\"clientId\":\"fdntwjchrdgoih\"},\"gseinq\":{\"principalId\":\"uu\",\"clientId\":\"dlwggytsbwtovv\"},\"mqnrojlpijnkr\":{\"principalId\":\"ufxqknpirgnepttw\",\"clientId\":\"sniffc\"}}},\"id\":\"rddh\",\"name\":\"ratiz\",\"type\":\"ronasxift\"}],\"nextLink\":\"qyzhf\"}") .toObject(SqlDatabaseListResult.class); - Assertions.assertEquals("y", model.nextLink()); + Assertions.assertEquals("qyzhf", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseResourceTests.java index 515474141112..c3fcde62b20b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDatabaseResourceTests.java @@ -15,11 +15,11 @@ public final class SqlDatabaseResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlDatabaseResource model = BinaryData.fromString( - "{\"id\":\"paxh\",\"restoreParameters\":{\"restoreSource\":\"i\",\"restoreTimestampInUtc\":\"2021-11-01T17:10:34Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"}") + "{\"id\":\"xedk\",\"restoreParameters\":{\"restoreSource\":\"pbqpcrfkbwccsn\",\"restoreTimestampInUtc\":\"2021-11-03T02:22:23Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"}") .toObject(SqlDatabaseResource.class); - Assertions.assertEquals("paxh", model.id()); - Assertions.assertEquals("i", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-01T17:10:34Z"), + Assertions.assertEquals("xedk", model.id()); + Assertions.assertEquals("pbqpcrfkbwccsn", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T02:22:23Z"), model.restoreParameters().restoreTimestampInUtc()); Assertions.assertFalse(model.restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); @@ -27,15 +27,15 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SqlDatabaseResource model = new SqlDatabaseResource().withId("paxh") - .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("i") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-11-01T17:10:34Z")) + SqlDatabaseResource model = new SqlDatabaseResource().withId("xedk") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("pbqpcrfkbwccsn") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-11-03T02:22:23Z")) .withRestoreWithTtlDisabled(false)) .withCreateMode(CreateMode.DEFAULT); model = BinaryData.fromObject(model).toObject(SqlDatabaseResource.class); - Assertions.assertEquals("paxh", model.id()); - Assertions.assertEquals("i", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-01T17:10:34Z"), + Assertions.assertEquals("xedk", model.id()); + Assertions.assertEquals("pbqpcrfkbwccsn", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T02:22:23Z"), model.restoreParameters().restoreTimestampInUtc()); Assertions.assertFalse(model.restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDedicatedGatewayRegionalServiceResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDedicatedGatewayRegionalServiceResourceTests.java index 66d64e060f14..df0f9648a4ff 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDedicatedGatewayRegionalServiceResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDedicatedGatewayRegionalServiceResourceTests.java @@ -11,7 +11,7 @@ public final class SqlDedicatedGatewayRegionalServiceResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlDedicatedGatewayRegionalServiceResource model = BinaryData.fromString( - "{\"sqlDedicatedGatewayEndpoint\":\"xbeuuqu\",\"name\":\"zwtjwwguzytijc\",\"location\":\"nondegjdyd\",\"status\":\"Updating\"}") + "{\"sqlDedicatedGatewayEndpoint\":\"mcthtpqgf\",\"name\":\"osizk\",\"location\":\"u\",\"status\":\"Deleting\"}") .toObject(SqlDedicatedGatewayRegionalServiceResource.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDedicatedGatewayServiceResourceCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDedicatedGatewayServiceResourceCreateUpdateParametersTests.java index 312b2f773e48..49a8edd31484 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDedicatedGatewayServiceResourceCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDedicatedGatewayServiceResourceCreateUpdateParametersTests.java @@ -14,22 +14,22 @@ public final class SqlDedicatedGatewayServiceResourceCreateUpdateParametersTests @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlDedicatedGatewayServiceResourceCreateUpdateParameters model = BinaryData.fromString( - "{\"serviceType\":\"SqlDedicatedGateway\",\"dedicatedGatewayType\":\"IntegratedCache\",\"instanceSize\":\"Cosmos.D16s\",\"instanceCount\":1247158338}") + "{\"serviceType\":\"SqlDedicatedGateway\",\"dedicatedGatewayType\":\"IntegratedCache\",\"instanceSize\":\"Cosmos.D4s\",\"instanceCount\":8510650}") .toObject(SqlDedicatedGatewayServiceResourceCreateUpdateParameters.class); - Assertions.assertEquals(ServiceSize.COSMOS_D16S, model.instanceSize()); - Assertions.assertEquals(1247158338, model.instanceCount()); + Assertions.assertEquals(ServiceSize.COSMOS_D4S, model.instanceSize()); + Assertions.assertEquals(8510650, model.instanceCount()); Assertions.assertEquals(DedicatedGatewayType.INTEGRATED_CACHE, model.dedicatedGatewayType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SqlDedicatedGatewayServiceResourceCreateUpdateParameters model - = new SqlDedicatedGatewayServiceResourceCreateUpdateParameters().withInstanceSize(ServiceSize.COSMOS_D16S) - .withInstanceCount(1247158338) + = new SqlDedicatedGatewayServiceResourceCreateUpdateParameters().withInstanceSize(ServiceSize.COSMOS_D4S) + .withInstanceCount(8510650) .withDedicatedGatewayType(DedicatedGatewayType.INTEGRATED_CACHE); model = BinaryData.fromObject(model).toObject(SqlDedicatedGatewayServiceResourceCreateUpdateParameters.class); - Assertions.assertEquals(ServiceSize.COSMOS_D16S, model.instanceSize()); - Assertions.assertEquals(1247158338, model.instanceCount()); + Assertions.assertEquals(ServiceSize.COSMOS_D4S, model.instanceSize()); + Assertions.assertEquals(8510650, model.instanceCount()); Assertions.assertEquals(DedicatedGatewayType.INTEGRATED_CACHE, model.dedicatedGatewayType()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDedicatedGatewayServiceResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDedicatedGatewayServiceResourcePropertiesTests.java index 367e86df23b7..b462046f1fa4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDedicatedGatewayServiceResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlDedicatedGatewayServiceResourcePropertiesTests.java @@ -14,11 +14,11 @@ public final class SqlDedicatedGatewayServiceResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlDedicatedGatewayServiceResourceProperties model = BinaryData.fromString( - "{\"serviceType\":\"SqlDedicatedGateway\",\"sqlDedicatedGatewayEndpoint\":\"kkreh\",\"dedicatedGatewayType\":\"DistributedQuery\",\"locations\":[{\"sqlDedicatedGatewayEndpoint\":\"dui\",\"name\":\"ulxfaryrvjl\",\"location\":\"ezvjq\",\"status\":\"Creating\"},{\"sqlDedicatedGatewayEndpoint\":\"yiyaxqvjweiwtczk\",\"name\":\"nvovbooqbmdqrxy\",\"location\":\"ae\",\"status\":\"Creating\"},{\"sqlDedicatedGatewayEndpoint\":\"lw\",\"name\":\"dtlri\",\"location\":\"ooy\",\"status\":\"Error\"},{\"sqlDedicatedGatewayEndpoint\":\"dtzcqi\",\"name\":\"dudgcozzomeh\",\"location\":\"antolamlbijuxkq\",\"status\":\"Stopped\"}],\"creationTime\":\"2021-07-06T21:24:13Z\",\"instanceSize\":\"Cosmos.D4s\",\"instanceCount\":1550585160,\"status\":\"Running\",\"kwx\":\"\\\"datazdqiqdlrat\\\"\",\"lhpryjfzihuio\":\"\\\"dataauwxsuykznhrfgsl\\\"\",\"pajtfeyvkbd\":\"\\\"dataeo\\\"\",\"rhd\":\"\\\"datadd\\\"\"}") + "{\"serviceType\":\"SqlDedicatedGateway\",\"sqlDedicatedGatewayEndpoint\":\"pngvyvuoikdlpsx\",\"dedicatedGatewayType\":\"IntegratedCache\",\"locations\":[{\"sqlDedicatedGatewayEndpoint\":\"imq\",\"name\":\"yclocfmvswxvjel\",\"location\":\"fqhdxt\",\"status\":\"Creating\"},{\"sqlDedicatedGatewayEndpoint\":\"krybpaevykby\",\"name\":\"crqkwakkc\",\"location\":\"foulborcxuibsdq\",\"status\":\"Running\"},{\"sqlDedicatedGatewayEndpoint\":\"lp\",\"name\":\"t\",\"location\":\"wpgweoqhbj\",\"status\":\"Deleting\"},{\"sqlDedicatedGatewayEndpoint\":\"bleru\",\"name\":\"llcshjuci\",\"location\":\"y\",\"status\":\"Deleting\"}],\"creationTime\":\"2021-08-16T21:39:41Z\",\"instanceSize\":\"Cosmos.D16s\",\"instanceCount\":1562445388,\"status\":\"Running\",\"elhbimyiie\":\"\\\"dataazra\\\"\"}") .toObject(SqlDedicatedGatewayServiceResourceProperties.class); - Assertions.assertEquals(ServiceSize.COSMOS_D4S, model.instanceSize()); - Assertions.assertEquals(1550585160, model.instanceCount()); - Assertions.assertEquals("kkreh", model.sqlDedicatedGatewayEndpoint()); - Assertions.assertEquals(DedicatedGatewayType.DISTRIBUTED_QUERY, model.dedicatedGatewayType()); + Assertions.assertEquals(ServiceSize.COSMOS_D16S, model.instanceSize()); + Assertions.assertEquals(1562445388, model.instanceCount()); + Assertions.assertEquals("pngvyvuoikdlpsx", model.sqlDedicatedGatewayEndpoint()); + Assertions.assertEquals(DedicatedGatewayType.INTEGRATED_CACHE, model.dedicatedGatewayType()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentCreateUpdateParametersTests.java index 6bd5c7c2252b..c36d1c097173 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentCreateUpdateParametersTests.java @@ -12,22 +12,22 @@ public final class SqlRoleAssignmentCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlRoleAssignmentCreateUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"roleDefinitionId\":\"txrdcqtjvi\",\"scope\":\"tgepuslvyjtcvuwk\",\"principalId\":\"iziesfuughtuq\"}}") + "{\"properties\":{\"roleDefinitionId\":\"splzga\",\"scope\":\"cshhv\",\"principalId\":\"wgnxkympqanxrj\"}}") .toObject(SqlRoleAssignmentCreateUpdateParameters.class); - Assertions.assertEquals("txrdcqtjvi", model.roleDefinitionId()); - Assertions.assertEquals("tgepuslvyjtcvuwk", model.scope()); - Assertions.assertEquals("iziesfuughtuq", model.principalId()); + Assertions.assertEquals("splzga", model.roleDefinitionId()); + Assertions.assertEquals("cshhv", model.scope()); + Assertions.assertEquals("wgnxkympqanxrj", model.principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SqlRoleAssignmentCreateUpdateParameters model - = new SqlRoleAssignmentCreateUpdateParameters().withRoleDefinitionId("txrdcqtjvi") - .withScope("tgepuslvyjtcvuwk") - .withPrincipalId("iziesfuughtuq"); + = new SqlRoleAssignmentCreateUpdateParameters().withRoleDefinitionId("splzga") + .withScope("cshhv") + .withPrincipalId("wgnxkympqanxrj"); model = BinaryData.fromObject(model).toObject(SqlRoleAssignmentCreateUpdateParameters.class); - Assertions.assertEquals("txrdcqtjvi", model.roleDefinitionId()); - Assertions.assertEquals("tgepuslvyjtcvuwk", model.scope()); - Assertions.assertEquals("iziesfuughtuq", model.principalId()); + Assertions.assertEquals("splzga", model.roleDefinitionId()); + Assertions.assertEquals("cshhv", model.scope()); + Assertions.assertEquals("wgnxkympqanxrj", model.principalId()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentGetResultsInnerTests.java index 0de041a584da..4b89df577cbc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentGetResultsInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentGetResultsInnerTests.java @@ -12,10 +12,10 @@ public final class SqlRoleAssignmentGetResultsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlRoleAssignmentGetResultsInner model = BinaryData.fromString( - "{\"properties\":{\"roleDefinitionId\":\"jvzuy\",\"scope\":\"rmlmuowo\",\"principalId\":\"au\"},\"id\":\"opionszon\",\"name\":\"pngajin\",\"type\":\"ixjawrtm\"}") + "{\"properties\":{\"roleDefinitionId\":\"xhnpo\",\"scope\":\"qwcabvnui\",\"principalId\":\"ey\"},\"id\":\"wlpaugmrmfjlrxwt\",\"name\":\"aukhfkvcisiz\",\"type\":\"oaedsxjwuivedwcg\"}") .toObject(SqlRoleAssignmentGetResultsInner.class); - Assertions.assertEquals("jvzuy", model.roleDefinitionId()); - Assertions.assertEquals("rmlmuowo", model.scope()); - Assertions.assertEquals("au", model.principalId()); + Assertions.assertEquals("xhnpo", model.roleDefinitionId()); + Assertions.assertEquals("qwcabvnui", model.scope()); + Assertions.assertEquals("ey", model.principalId()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentListResultTests.java index aa2e7d17b9bc..674166da9909 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentListResultTests.java @@ -12,8 +12,8 @@ public final class SqlRoleAssignmentListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlRoleAssignmentListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"roleDefinitionId\":\"ey\",\"scope\":\"uhxu\",\"principalId\":\"buew\"},\"id\":\"s\",\"name\":\"njlx\",\"type\":\"zrhwp\"},{\"properties\":{\"roleDefinitionId\":\"jbaqehgpdoh\",\"scope\":\"qatucoigebxnc\",\"principalId\":\"fepbnwgfmxjgc\"},\"id\":\"jbgdlfgtdysnaquf\",\"name\":\"qbctqha\",\"type\":\"zjrwdkqze\"}],\"nextLink\":\"jleziunjx\"}") + "{\"value\":[{\"properties\":{\"roleDefinitionId\":\"bta\",\"scope\":\"pnyghs\",\"principalId\":\"cyl\"},\"id\":\"gmnsghpxy\",\"name\":\"phdrw\",\"type\":\"jkhvyomacluzvxnq\"},{\"properties\":{\"roleDefinitionId\":\"pqpdfwmkoisqc\",\"scope\":\"f\",\"principalId\":\"uifmc\"},\"id\":\"p\",\"name\":\"bkdq\",\"type\":\"rdzsylollgtrczzy\"}],\"nextLink\":\"xzji\"}") .toObject(SqlRoleAssignmentListResult.class); - Assertions.assertEquals("jleziunjx", model.nextLink()); + Assertions.assertEquals("xzji", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentResourceTests.java index df98212d109e..a783150ed33c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleAssignmentResourceTests.java @@ -11,22 +11,22 @@ public final class SqlRoleAssignmentResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SqlRoleAssignmentResource model = BinaryData - .fromString("{\"roleDefinitionId\":\"jmyccxlzhcoxov\",\"scope\":\"khenlus\",\"principalId\":\"rd\"}") - .toObject(SqlRoleAssignmentResource.class); - Assertions.assertEquals("jmyccxlzhcoxov", model.roleDefinitionId()); - Assertions.assertEquals("khenlus", model.scope()); - Assertions.assertEquals("rd", model.principalId()); + SqlRoleAssignmentResource model + = BinaryData.fromString("{\"roleDefinitionId\":\"ewxeiqbpsm\",\"scope\":\"mguaml\",\"principalId\":\"l\"}") + .toObject(SqlRoleAssignmentResource.class); + Assertions.assertEquals("ewxeiqbpsm", model.roleDefinitionId()); + Assertions.assertEquals("mguaml", model.scope()); + Assertions.assertEquals("l", model.principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SqlRoleAssignmentResource model = new SqlRoleAssignmentResource().withRoleDefinitionId("jmyccxlzhcoxov") - .withScope("khenlus") - .withPrincipalId("rd"); + SqlRoleAssignmentResource model = new SqlRoleAssignmentResource().withRoleDefinitionId("ewxeiqbpsm") + .withScope("mguaml") + .withPrincipalId("l"); model = BinaryData.fromObject(model).toObject(SqlRoleAssignmentResource.class); - Assertions.assertEquals("jmyccxlzhcoxov", model.roleDefinitionId()); - Assertions.assertEquals("khenlus", model.scope()); - Assertions.assertEquals("rd", model.principalId()); + Assertions.assertEquals("ewxeiqbpsm", model.roleDefinitionId()); + Assertions.assertEquals("mguaml", model.scope()); + Assertions.assertEquals("l", model.principalId()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionCreateUpdateParametersTests.java index 955e41533eeb..b11cc1249df0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionCreateUpdateParametersTests.java @@ -15,41 +15,35 @@ public final class SqlRoleDefinitionCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlRoleDefinitionCreateUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"roleName\":\"lnkvxlx\",\"type\":\"CustomRole\",\"assignableScopes\":[\"ivbgkcv\",\"hpzvuqdflvoniyp\",\"pubcpzgpxtivhjk\"],\"permissions\":[{\"id\":\"bgqjxgpnrhgo\",\"dataActions\":[\"pikqmh\",\"ao\"],\"notDataActions\":[\"mzvupor\",\"zdfuydzvkfvxcnqm\"]},{\"id\":\"psw\",\"dataActions\":[\"vkhlggdhbemz\",\"kzsz\"],\"notDataActions\":[\"wtglxx\",\"ljfp\",\"picrmnzhrgmqgjsx\",\"pqcbfrmbodthsq\"]},{\"id\":\"vriibakclacjfr\",\"dataActions\":[\"usx\",\"uzlwvsgmw\",\"hqf\",\"izvu\"],\"notDataActions\":[\"kjsvthnwpzteko\"]},{\"id\":\"ribi\",\"dataActions\":[\"gplucfotangcfhny\",\"zcugswvxwlmzqw\",\"vtxnjmxmcuqud\"],\"notDataActions\":[\"clxyn\"]}]}}") + "{\"properties\":{\"roleName\":\"txd\",\"type\":\"CustomRole\",\"assignableScopes\":[\"us\"],\"permissions\":[{\"id\":\"ns\",\"dataActions\":[\"zfpafolpymwamxqz\",\"agpgdph\",\"vdulajv\",\"ejchcsrlz\"],\"notDataActions\":[\"zlanrupdwvnph\",\"nzqtpjhmqrhvt\"]},{\"id\":\"aiwdcxsmlzzhz\",\"dataActions\":[\"etlgydlhqvlnnpx\",\"b\",\"fiqgeaar\"],\"notDataActions\":[\"ekglklb\",\"ulidwc\",\"vmzegj\"]}]}}") .toObject(SqlRoleDefinitionCreateUpdateParameters.class); - Assertions.assertEquals("lnkvxlx", model.roleName()); + Assertions.assertEquals("txd", model.roleName()); Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.type()); - Assertions.assertEquals("ivbgkcv", model.assignableScopes().get(0)); - Assertions.assertEquals("bgqjxgpnrhgo", model.permissions().get(0).id()); - Assertions.assertEquals("pikqmh", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("mzvupor", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("us", model.assignableScopes().get(0)); + Assertions.assertEquals("ns", model.permissions().get(0).id()); + Assertions.assertEquals("zfpafolpymwamxqz", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("zlanrupdwvnph", model.permissions().get(0).notDataActions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SqlRoleDefinitionCreateUpdateParameters model - = new SqlRoleDefinitionCreateUpdateParameters().withRoleName("lnkvxlx") + = new SqlRoleDefinitionCreateUpdateParameters().withRoleName("txd") .withType(RoleDefinitionType.CUSTOM_ROLE) - .withAssignableScopes(Arrays.asList("ivbgkcv", "hpzvuqdflvoniyp", "pubcpzgpxtivhjk")) + .withAssignableScopes(Arrays.asList("us")) .withPermissions(Arrays.asList( - new Permission().withId("bgqjxgpnrhgo") - .withDataActions(Arrays.asList("pikqmh", "ao")) - .withNotDataActions(Arrays.asList("mzvupor", "zdfuydzvkfvxcnqm")), - new Permission().withId("psw") - .withDataActions(Arrays.asList("vkhlggdhbemz", "kzsz")) - .withNotDataActions(Arrays.asList("wtglxx", "ljfp", "picrmnzhrgmqgjsx", "pqcbfrmbodthsq")), - new Permission().withId("vriibakclacjfr") - .withDataActions(Arrays.asList("usx", "uzlwvsgmw", "hqf", "izvu")) - .withNotDataActions(Arrays.asList("kjsvthnwpzteko")), - new Permission().withId("ribi") - .withDataActions(Arrays.asList("gplucfotangcfhny", "zcugswvxwlmzqw", "vtxnjmxmcuqud")) - .withNotDataActions(Arrays.asList("clxyn")))); + new Permission().withId("ns") + .withDataActions(Arrays.asList("zfpafolpymwamxqz", "agpgdph", "vdulajv", "ejchcsrlz")) + .withNotDataActions(Arrays.asList("zlanrupdwvnph", "nzqtpjhmqrhvt")), + new Permission().withId("aiwdcxsmlzzhz") + .withDataActions(Arrays.asList("etlgydlhqvlnnpx", "b", "fiqgeaar")) + .withNotDataActions(Arrays.asList("ekglklb", "ulidwc", "vmzegj")))); model = BinaryData.fromObject(model).toObject(SqlRoleDefinitionCreateUpdateParameters.class); - Assertions.assertEquals("lnkvxlx", model.roleName()); + Assertions.assertEquals("txd", model.roleName()); Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.type()); - Assertions.assertEquals("ivbgkcv", model.assignableScopes().get(0)); - Assertions.assertEquals("bgqjxgpnrhgo", model.permissions().get(0).id()); - Assertions.assertEquals("pikqmh", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("mzvupor", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("us", model.assignableScopes().get(0)); + Assertions.assertEquals("ns", model.permissions().get(0).id()); + Assertions.assertEquals("zfpafolpymwamxqz", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("zlanrupdwvnph", model.permissions().get(0).notDataActions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionGetResultsInnerTests.java index 22a9db391c12..ecbd0623d46b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionGetResultsInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionGetResultsInnerTests.java @@ -13,13 +13,13 @@ public final class SqlRoleDefinitionGetResultsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlRoleDefinitionGetResultsInner model = BinaryData.fromString( - "{\"properties\":{\"roleName\":\"kjaosrxuzv\",\"type\":\"CustomRole\",\"assignableScopes\":[\"cqiosmgbza\",\"gxq\"],\"permissions\":[{\"id\":\"tlt\",\"dataActions\":[\"rltzkatbhjmz\",\"nbsoqeqalarv\",\"agunbtgfebw\",\"nbmhyree\"],\"notDataActions\":[\"qavbpdqmj\",\"lyyzglgouwtlmjj\",\"uojqt\"]},{\"id\":\"axkjeytunlbfjk\",\"dataActions\":[\"snkq\"],\"notDataActions\":[\"y\"]},{\"id\":\"unjqh\",\"dataActions\":[\"xaulkpakdkifmjnn\",\"wtqabpxuckp\"],\"notDataActions\":[\"oweyirdhlis\",\"gwflq\",\"mpizru\"]},{\"id\":\"pqxpx\",\"dataActions\":[\"cng\",\"saasiixtmkzj\"],\"notDataActions\":[\"iirhgfgrwsd\",\"gratzvzbglbyvict\",\"tbrxkjz\"]}]},\"id\":\"gxffmshkwf\",\"name\":\"kgozxwop\",\"type\":\"bydpizqaclnapxb\"}") + "{\"properties\":{\"roleName\":\"sfar\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"lkjxnqpvwgf\",\"tmhqykiz\"],\"permissions\":[{\"id\":\"aoaf\",\"dataActions\":[\"qvoxmycj\",\"mr\",\"vwg\",\"wwpbmzgwesyd\"],\"notDataActions\":[\"efoh\",\"cbvopwndyqleallk\",\"mtkhlowkxxpvbr\"]},{\"id\":\"jmzsyzfh\",\"dataActions\":[\"h\",\"k\",\"yych\",\"nsjlpjrtws\"],\"notDataActions\":[\"vuicp\"]},{\"id\":\"trrmhwrb\",\"dataActions\":[\"yflubhvjglroc\"],\"notDataActions\":[\"lw\",\"hmem\",\"ooclutnp\",\"memczjkmmyk\"]},{\"id\":\"jxsglhsr\",\"dataActions\":[\"ejylmbkzu\",\"nigrfihotjewl\",\"xuzzjgnrefq\",\"hqo\"],\"notDataActions\":[\"hiqakydiwfbrk\",\"pzdqtvhcspod\",\"qaxsipietgbebjf\"]}]},\"id\":\"bmoichd\",\"name\":\"pnfpubntnbat\",\"type\":\"viqsowsaaelcattc\"}") .toObject(SqlRoleDefinitionGetResultsInner.class); - Assertions.assertEquals("kjaosrxuzv", model.roleName()); - Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.typePropertiesType()); - Assertions.assertEquals("cqiosmgbza", model.assignableScopes().get(0)); - Assertions.assertEquals("tlt", model.permissions().get(0).id()); - Assertions.assertEquals("rltzkatbhjmz", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("qavbpdqmj", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("sfar", model.roleName()); + Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.typePropertiesType()); + Assertions.assertEquals("lkjxnqpvwgf", model.assignableScopes().get(0)); + Assertions.assertEquals("aoaf", model.permissions().get(0).id()); + Assertions.assertEquals("qvoxmycj", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("efoh", model.permissions().get(0).notDataActions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionListResultTests.java index 429313a9fd65..76ede33559aa 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionListResultTests.java @@ -12,8 +12,8 @@ public final class SqlRoleDefinitionListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlRoleDefinitionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"roleName\":\"fabuiyjibu\",\"type\":\"CustomRole\",\"assignableScopes\":[\"gneik\",\"pgoxgji\"],\"permissions\":[{\"id\":\"btozipqwje\",\"dataActions\":[\"rrxxgewpktvq\",\"lkm\",\"pzoyhlfbcg\"],\"notDataActions\":[\"loxoebqin\",\"ipnwj\"]},{\"id\":\"jqlafcbahhpzp\",\"dataActions\":[\"iyjwpfilkmkkho\"],\"notDataActions\":[\"ndviauogphuartvt\",\"ukyefchnmnahmnxh\",\"xjqirwrweoox\"]},{\"id\":\"i\",\"dataActions\":[\"wrsnewmozqvbu\",\"qmamhsycxhxzga\"],\"notDataActions\":[\"abo\",\"dvmfqhppub\",\"w\"]},{\"id\":\"pdfgkmtdherngbt\",\"dataActions\":[\"ahokqtobkauxofsh\",\"phwpnulaiywzej\"],\"notDataActions\":[\"slwkojpl\"]}]},\"id\":\"dnpdwrpqaf\",\"name\":\"fugsnnfhyetefy\",\"type\":\"oc\"}],\"nextLink\":\"tfjgt\"}") + "{\"value\":[{\"properties\":{\"roleName\":\"irwgdnqzbrf\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"zmtksjci\",\"digsxcdgl\"],\"permissions\":[{\"id\":\"euachtomfl\",\"dataActions\":[\"swfpfmd\",\"ycxnmskw\",\"qjjyslurl\",\"shhkvpedw\"],\"notDataActions\":[\"srhmpqvww\",\"kondcb\",\"wimuvqej\",\"so\"]},{\"id\":\"rrleaesinuqt\",\"dataActions\":[\"obbpihehc\",\"cy\",\"mrqbrjbbmpxdlv\"],\"notDataActions\":[\"rexcrseqwjksghu\",\"gzhxog\",\"ggsvoujkxibdaf\"]}]},\"id\":\"kmdyomkxfbvfbh\",\"name\":\"y\",\"type\":\"rhpw\"},{\"properties\":{\"roleName\":\"deimawzov\",\"type\":\"CustomRole\",\"assignableScopes\":[\"ui\",\"jcjcazt\",\"wsnsqowx\",\"comlikytwvczc\"],\"permissions\":[{\"id\":\"cvejyfdvlvhbwrn\",\"dataActions\":[\"gddpq\",\"hehnmnaoya\",\"kcoeqswank\",\"t\"],\"notDataActions\":[\"hdroznnh\",\"rlktgjcsggu\",\"hemlwywaee\",\"zgfbukklelssx\"]}]},\"id\":\"ycsxzu\",\"name\":\"ksrl\",\"type\":\"mdesqp\"},{\"properties\":{\"roleName\":\"mjc\",\"type\":\"CustomRole\",\"assignableScopes\":[\"idyvteow\",\"vgp\"],\"permissions\":[{\"id\":\"ugfsxzecpaxwk\",\"dataActions\":[\"khvuhxepmrutz\"],\"notDataActions\":[\"aobn\",\"lujdjltymkmv\"]},{\"id\":\"ihywartspph\",\"dataActions\":[\"ky\",\"xdssjpemmucfxhi\",\"kflrmymy\"],\"notDataActions\":[\"qlhris\"]}]},\"id\":\"lmiiiovg\",\"name\":\"cgxuugqkctotiowl\",\"type\":\"teqdptj\"},{\"properties\":{\"roleName\":\"tgukranblwphql\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"gygqwah\",\"iul\",\"gniiprglvaw\",\"wzdufypivlsbb\"],\"permissions\":[{\"id\":\"ubkmifo\",\"dataActions\":[\"ubvphavpmhbrbqgv\"],\"notDataActions\":[\"pbbttefjoknss\",\"yzqedikdfrd\"]}]},\"id\":\"qmrjg\",\"name\":\"ihfqlggwfiwzc\",\"type\":\"mjpb\"}],\"nextLink\":\"phmgtvljvrcmyfq\"}") .toObject(SqlRoleDefinitionListResult.class); - Assertions.assertEquals("tfjgt", model.nextLink()); + Assertions.assertEquals("phmgtvljvrcmyfq", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionResourceTests.java index 88d407d9561e..3141b223857e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlRoleDefinitionResourceTests.java @@ -15,30 +15,30 @@ public final class SqlRoleDefinitionResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlRoleDefinitionResource model = BinaryData.fromString( - "{\"roleName\":\"gn\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"fsmfcttuxuuyi\"],\"permissions\":[{\"id\":\"oiquvrehmrnjhvs\",\"dataActions\":[\"tczytqjtwh\",\"uunfprnjletlxsm\"],\"notDataActions\":[\"do\",\"ifamowazi\"]}]}") + "{\"roleName\":\"hplrvkmjcwmjvlg\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"kyylizr\",\"bjpsfxsfuztlvtm\",\"agb\",\"idqlvhu\"],\"permissions\":[{\"id\":\"ofizrvjfnmjmvlwy\",\"dataActions\":[\"blkujrllfojuidjp\",\"uyjucejikzo\"],\"notDataActions\":[\"vtzejetjklnti\",\"yjuzkdb\",\"zolxrzvhqjwtr\"]}]}") .toObject(SqlRoleDefinitionResource.class); - Assertions.assertEquals("gn", model.roleName()); + Assertions.assertEquals("hplrvkmjcwmjvlg", model.roleName()); Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.type()); - Assertions.assertEquals("fsmfcttuxuuyi", model.assignableScopes().get(0)); - Assertions.assertEquals("oiquvrehmrnjhvs", model.permissions().get(0).id()); - Assertions.assertEquals("tczytqjtwh", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("do", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("kyylizr", model.assignableScopes().get(0)); + Assertions.assertEquals("ofizrvjfnmjmvlwy", model.permissions().get(0).id()); + Assertions.assertEquals("blkujrllfojuidjp", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("vtzejetjklnti", model.permissions().get(0).notDataActions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SqlRoleDefinitionResource model = new SqlRoleDefinitionResource().withRoleName("gn") + SqlRoleDefinitionResource model = new SqlRoleDefinitionResource().withRoleName("hplrvkmjcwmjvlg") .withType(RoleDefinitionType.BUILT_IN_ROLE) - .withAssignableScopes(Arrays.asList("fsmfcttuxuuyi")) - .withPermissions(Arrays.asList(new Permission().withId("oiquvrehmrnjhvs") - .withDataActions(Arrays.asList("tczytqjtwh", "uunfprnjletlxsm")) - .withNotDataActions(Arrays.asList("do", "ifamowazi")))); + .withAssignableScopes(Arrays.asList("kyylizr", "bjpsfxsfuztlvtm", "agb", "idqlvhu")) + .withPermissions(Arrays.asList(new Permission().withId("ofizrvjfnmjmvlwy") + .withDataActions(Arrays.asList("blkujrllfojuidjp", "uyjucejikzo")) + .withNotDataActions(Arrays.asList("vtzejetjklnti", "yjuzkdb", "zolxrzvhqjwtr")))); model = BinaryData.fromObject(model).toObject(SqlRoleDefinitionResource.class); - Assertions.assertEquals("gn", model.roleName()); + Assertions.assertEquals("hplrvkmjcwmjvlg", model.roleName()); Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.type()); - Assertions.assertEquals("fsmfcttuxuuyi", model.assignableScopes().get(0)); - Assertions.assertEquals("oiquvrehmrnjhvs", model.permissions().get(0).id()); - Assertions.assertEquals("tczytqjtwh", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("do", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("kyylizr", model.assignableScopes().get(0)); + Assertions.assertEquals("ofizrvjfnmjmvlwy", model.permissions().get(0).id()); + Assertions.assertEquals("blkujrllfojuidjp", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("vtzejetjklnti", model.permissions().get(0).notDataActions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureCreateUpdateParametersTests.java index 52a398781314..cf7fef07eb54 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureCreateUpdateParametersTests.java @@ -20,37 +20,39 @@ public final class SqlStoredProcedureCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlStoredProcedureCreateUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"id\":\"uktalhsnvkcdmxz\",\"body\":\"oaimlnw\"},\"options\":{\"throughput\":1776733764,\"autoscaleSettings\":{\"maxThroughput\":234368989}}},\"id\":\"eazulcs\",\"name\":\"hwwn\",\"type\":\"hlf\",\"location\":\"wpchwahf\",\"tags\":{\"ncxykxhdjhlimm\":\"snfepgfewetwlyx\",\"cjzhqi\":\"cxfhbcporxv\",\"ftjuh\":\"xfpxtgqscja\"},\"identity\":{\"principalId\":\"zkmtgguwpijrajci\",\"tenantId\":\"mghfcfiwrxgkne\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"zdjtxvzflbqv\":{\"principalId\":\"qodfvp\",\"clientId\":\"hoxgsgbpf\"},\"cvuzhyrmewipmve\":{\"principalId\":\"qvlgafcqusrdvetn\",\"clientId\":\"dtutnwldu\"},\"hhzjhfj\":{\"principalId\":\"xukuqgsj\",\"clientId\":\"undxgketw\"}}}}") + "{\"properties\":{\"resource\":{\"id\":\"nsmjbl\",\"body\":\"jhlnymzotqyryu\"},\"options\":{\"throughput\":1337241911,\"autoscaleSettings\":{\"maxThroughput\":1331204401}}},\"id\":\"mv\",\"name\":\"gtayxonsupeujlz\",\"type\":\"hcvsqltnzoi\",\"location\":\"sxgnx\",\"tags\":{\"bxiqxeiiqbimht\":\"onmpqoxwdof\",\"pofvwb\":\"wwinhehf\",\"vqihebwtswbzuwf\":\"blembnkbwvqvxkd\"},\"identity\":{\"principalId\":\"ragegi\",\"tenantId\":\"cjfelisdjubgg\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"apvu\":{\"principalId\":\"kbsazgak\",\"clientId\":\"cyrcmjdmspo\"},\"jed\":{\"principalId\":\"ylnio\",\"clientId\":\"zgb\"},\"ibmikostbzb\":{\"principalId\":\"tkvnlvxbcuiiznkt\",\"clientId\":\"ansnvp\"},\"bcunezzceze\":{\"principalId\":\"wbuqn\",\"clientId\":\"phzfylsgcrp\"}}}}") .toObject(SqlStoredProcedureCreateUpdateParameters.class); - Assertions.assertEquals("wpchwahf", model.location()); - Assertions.assertEquals("snfepgfewetwlyx", model.tags().get("ncxykxhdjhlimm")); + Assertions.assertEquals("sxgnx", model.location()); + Assertions.assertEquals("onmpqoxwdof", model.tags().get("bxiqxeiiqbimht")); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("uktalhsnvkcdmxz", model.resource().id()); - Assertions.assertEquals("oaimlnw", model.resource().body()); - Assertions.assertEquals(1776733764, model.options().throughput()); - Assertions.assertEquals(234368989, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("nsmjbl", model.resource().id()); + Assertions.assertEquals("jhlnymzotqyryu", model.resource().body()); + Assertions.assertEquals(1337241911, model.options().throughput()); + Assertions.assertEquals(1331204401, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SqlStoredProcedureCreateUpdateParameters model = new SqlStoredProcedureCreateUpdateParameters() - .withLocation("wpchwahf") - .withTags(mapOf("ncxykxhdjhlimm", "snfepgfewetwlyx", "cjzhqi", "cxfhbcporxv", "ftjuh", "xfpxtgqscja")) - .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("zdjtxvzflbqv", new ManagedServiceIdentityUserAssignedIdentities(), - "cvuzhyrmewipmve", new ManagedServiceIdentityUserAssignedIdentities(), "hhzjhfj", - new ManagedServiceIdentityUserAssignedIdentities()))) - .withResource(new SqlStoredProcedureResource().withId("uktalhsnvkcdmxz").withBody("oaimlnw")) - .withOptions(new CreateUpdateOptions().withThroughput(1776733764) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(234368989))); + SqlStoredProcedureCreateUpdateParameters model + = new SqlStoredProcedureCreateUpdateParameters().withLocation("sxgnx") + .withTags( + mapOf("bxiqxeiiqbimht", "onmpqoxwdof", "pofvwb", "wwinhehf", "vqihebwtswbzuwf", "blembnkbwvqvxkd")) + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("apvu", new ManagedServiceIdentityUserAssignedIdentities(), "jed", + new ManagedServiceIdentityUserAssignedIdentities(), "ibmikostbzb", + new ManagedServiceIdentityUserAssignedIdentities(), "bcunezzceze", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource(new SqlStoredProcedureResource().withId("nsmjbl").withBody("jhlnymzotqyryu")) + .withOptions(new CreateUpdateOptions().withThroughput(1337241911) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1331204401))); model = BinaryData.fromObject(model).toObject(SqlStoredProcedureCreateUpdateParameters.class); - Assertions.assertEquals("wpchwahf", model.location()); - Assertions.assertEquals("snfepgfewetwlyx", model.tags().get("ncxykxhdjhlimm")); + Assertions.assertEquals("sxgnx", model.location()); + Assertions.assertEquals("onmpqoxwdof", model.tags().get("bxiqxeiiqbimht")); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("uktalhsnvkcdmxz", model.resource().id()); - Assertions.assertEquals("oaimlnw", model.resource().body()); - Assertions.assertEquals(1776733764, model.options().throughput()); - Assertions.assertEquals(234368989, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("nsmjbl", model.resource().id()); + Assertions.assertEquals("jhlnymzotqyryu", model.resource().body()); + Assertions.assertEquals(1337241911, model.options().throughput()); + Assertions.assertEquals(1331204401, model.options().autoscaleSettings().maxThroughput()); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureCreateUpdatePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureCreateUpdatePropertiesTests.java index bebabfa7a121..2cc39090eef7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureCreateUpdatePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureCreateUpdatePropertiesTests.java @@ -15,24 +15,24 @@ public final class SqlStoredProcedureCreateUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlStoredProcedureCreateUpdateProperties model = BinaryData.fromString( - "{\"resource\":{\"id\":\"hvvmuvgpmun\",\"body\":\"sx\"},\"options\":{\"throughput\":43120418,\"autoscaleSettings\":{\"maxThroughput\":837522232}}}") + "{\"resource\":{\"id\":\"fwyfwlwxjwet\",\"body\":\"sihclafzvaylp\"},\"options\":{\"throughput\":1236951545,\"autoscaleSettings\":{\"maxThroughput\":1346932281}}}") .toObject(SqlStoredProcedureCreateUpdateProperties.class); - Assertions.assertEquals("hvvmuvgpmun", model.resource().id()); - Assertions.assertEquals("sx", model.resource().body()); - Assertions.assertEquals(43120418, model.options().throughput()); - Assertions.assertEquals(837522232, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("fwyfwlwxjwet", model.resource().id()); + Assertions.assertEquals("sihclafzvaylp", model.resource().body()); + Assertions.assertEquals(1236951545, model.options().throughput()); + Assertions.assertEquals(1346932281, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SqlStoredProcedureCreateUpdateProperties model = new SqlStoredProcedureCreateUpdateProperties() - .withResource(new SqlStoredProcedureResource().withId("hvvmuvgpmun").withBody("sx")) - .withOptions(new CreateUpdateOptions().withThroughput(43120418) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(837522232))); + .withResource(new SqlStoredProcedureResource().withId("fwyfwlwxjwet").withBody("sihclafzvaylp")) + .withOptions(new CreateUpdateOptions().withThroughput(1236951545) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1346932281))); model = BinaryData.fromObject(model).toObject(SqlStoredProcedureCreateUpdateProperties.class); - Assertions.assertEquals("hvvmuvgpmun", model.resource().id()); - Assertions.assertEquals("sx", model.resource().body()); - Assertions.assertEquals(43120418, model.options().throughput()); - Assertions.assertEquals(837522232, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("fwyfwlwxjwet", model.resource().id()); + Assertions.assertEquals("sihclafzvaylp", model.resource().body()); + Assertions.assertEquals(1236951545, model.options().throughput()); + Assertions.assertEquals(1346932281, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureGetPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureGetPropertiesResourceTests.java index b375efbadc02..cf2d7fbae8a9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureGetPropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureGetPropertiesResourceTests.java @@ -11,10 +11,10 @@ public final class SqlStoredProcedureGetPropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SqlStoredProcedureGetPropertiesResource model = BinaryData - .fromString("{\"_rid\":\"ob\",\"_ts\":8.356482,\"_etag\":\"idgfc\",\"id\":\"qmpimaqxzhem\",\"body\":\"h\"}") + SqlStoredProcedureGetPropertiesResource model = BinaryData.fromString( + "{\"_rid\":\"mkqscaz\",\"_ts\":68.94478,\"_etag\":\"tzxpuamwabzxrv\",\"id\":\"cush\",\"body\":\"haivm\"}") .toObject(SqlStoredProcedureGetPropertiesResource.class); - Assertions.assertEquals("qmpimaqxzhem", model.id()); - Assertions.assertEquals("h", model.body()); + Assertions.assertEquals("cush", model.id()); + Assertions.assertEquals("haivm", model.body()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureGetPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureGetPropertiesTests.java index c4e4652319d1..6e8a4aa0fceb 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureGetPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureGetPropertiesTests.java @@ -12,9 +12,9 @@ public final class SqlStoredProcedureGetPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlStoredProcedureGetProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"nk\",\"_ts\":27.386929,\"_etag\":\"jb\",\"id\":\"rgaehvvibrxjj\",\"body\":\"oqbeitpkxzt\"}}") + "{\"resource\":{\"_rid\":\"vigorqjbttzhragl\",\"_ts\":96.13141,\"_etag\":\"onqjujeickpzvcpo\",\"id\":\"mxelnwcltyjed\",\"body\":\"xm\"}}") .toObject(SqlStoredProcedureGetProperties.class); - Assertions.assertEquals("rgaehvvibrxjj", model.resource().id()); - Assertions.assertEquals("oqbeitpkxzt", model.resource().body()); + Assertions.assertEquals("mxelnwcltyjed", model.resource().id()); + Assertions.assertEquals("xm", model.resource().body()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureGetResultsInnerTests.java index ec823e880f13..515fde35183f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureGetResultsInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureGetResultsInnerTests.java @@ -13,12 +13,12 @@ public final class SqlStoredProcedureGetResultsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlStoredProcedureGetResultsInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"wqfbylyrfgiagt\",\"_ts\":87.74515,\"_etag\":\"cqwogfnzjvusfzl\",\"id\":\"mozuxylfsb\",\"body\":\"adpysownbt\"}},\"location\":\"bugrj\",\"tags\":{\"foj\":\"ojcmisofieyp\"},\"identity\":{\"principalId\":\"hcuplc\",\"tenantId\":\"cwkhihi\",\"type\":\"None\",\"userAssignedIdentities\":{\"ecactx\":{\"principalId\":\"qtz\",\"clientId\":\"rgnowcjhfgm\"},\"ifzmpjwyivqi\":{\"principalId\":\"oteyowc\",\"clientId\":\"qovekqvgqou\"},\"kvyklxubyjaffmm\":{\"principalId\":\"xcvhrfs\",\"clientId\":\"uagrttikteusqc\"},\"lqxihhrmooiz\":{\"principalId\":\"lcqcuubgqibrt\",\"clientId\":\"metttwgd\"}}},\"id\":\"eypxiutcxapzhyr\",\"name\":\"etoge\",\"type\":\"joxslhvnhla\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"ubwefqs\",\"_ts\":15.355677,\"_etag\":\"qtferrqwexjkmf\",\"id\":\"apjwogqqnobpudcd\",\"body\":\"tqwpwya\"}},\"location\":\"zasqbucljgkyexao\",\"tags\":{\"jumfqwazlnq\":\"aipidsdaultxi\",\"zqdqxt\":\"mcjn\",\"nyfusfzsvtuikzh\":\"jw\"},\"identity\":{\"principalId\":\"glcfhmlrqryxyn\",\"tenantId\":\"zrdpsovwxznptgoe\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ioovzidsxwaab\":{\"principalId\":\"pfhvfslk\",\"clientId\":\"tjlrigjksky\"},\"kzobgopxlhsln\":{\"principalId\":\"ifrygzn\",\"clientId\":\"axri\"}}},\"id\":\"xieixynllxec\",\"name\":\"crojp\",\"type\":\"slhcawjutifd\"}") .toObject(SqlStoredProcedureGetResultsInner.class); - Assertions.assertEquals("bugrj", model.location()); - Assertions.assertEquals("ojcmisofieyp", model.tags().get("foj")); - Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("mozuxylfsb", model.resource().id()); - Assertions.assertEquals("adpysownbt", model.resource().body()); + Assertions.assertEquals("zasqbucljgkyexao", model.location()); + Assertions.assertEquals("aipidsdaultxi", model.tags().get("jumfqwazlnq")); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("apjwogqqnobpudcd", model.resource().id()); + Assertions.assertEquals("tqwpwya", model.resource().body()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureListResultTests.java index b26ece53d66a..3431f357e439 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureListResultTests.java @@ -12,8 +12,8 @@ public final class SqlStoredProcedureListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlStoredProcedureListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"as\",\"_ts\":66.27348,\"_etag\":\"ypoh\",\"id\":\"uemsly\",\"body\":\"qyrp\"}},\"location\":\"obrltt\",\"tags\":{\"nfwqzdzgtilaxhn\":\"jnygq\",\"wivkxo\":\"hqlyvijo\",\"ti\":\"zunbixx\",\"vtsoxf\":\"vcpwpgclrc\"},\"identity\":{\"principalId\":\"nxpmyyefrpmpdnq\",\"tenantId\":\"ka\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"nitgvkxlz\":{\"principalId\":\"mbnpqf\",\"clientId\":\"qlkzme\"}}},\"id\":\"drf\",\"name\":\"gcealzxwh\",\"type\":\"ansym\"},{\"properties\":{\"resource\":{\"_rid\":\"lwigdivbkbx\",\"_ts\":10.386032,\"_etag\":\"ajuwas\",\"id\":\"vdaeyyguxakjsq\",\"body\":\"zbezkgimsidxasic\"}},\"location\":\"yvvjskgfmo\",\"tags\":{\"hnakzyb\":\"hpqgatjeaahhvj\"},\"identity\":{\"principalId\":\"idjks\",\"tenantId\":\"kyxvxevblbjedn\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"svxeizzgwklnsr\":{\"principalId\":\"uaulxunsm\",\"clientId\":\"nkppxynen\"},\"kzddrtkgdojbmxva\":{\"principalId\":\"feycxcktp\",\"clientId\":\"merteeammxqiek\"}}},\"id\":\"efdeesve\",\"name\":\"uij\",\"type\":\"xtxsuwprtujw\"},{\"properties\":{\"resource\":{\"_rid\":\"djibabxvitit\",\"_ts\":80.21522,\"_etag\":\"exavoxt\",\"id\":\"glecdmdqbwpypq\",\"body\":\"sfj\"}},\"location\":\"b\",\"tags\":{\"sirudhzmmesckdlp\":\"hxudbxvodht\",\"xdfgsftufqobr\":\"gzrcxfailcfxwmdb\"},\"identity\":{\"principalId\":\"acgcckknhx\",\"tenantId\":\"zvytnrzvuljraaer\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"b\":{\"principalId\":\"ukkjqnvbroyla\",\"clientId\":\"ulcdisdosf\"},\"dclxgc\":{\"principalId\":\"vgjrwhr\",\"clientId\":\"ycy\"},\"a\":{\"principalId\":\"nfnw\",\"clientId\":\"tmvpdvjdhtt\"}}},\"id\":\"edxihchrphkmcrj\",\"name\":\"qnsdfzpbgtgky\",\"type\":\"kdghrjeuutlwx\"},{\"properties\":{\"resource\":{\"_rid\":\"hokvbwnh\",\"_ts\":36.913025,\"_etag\":\"gehgppi\",\"id\":\"ifhpf\",\"body\":\"ajvgcxtxjcsheafi\"}},\"location\":\"tugsresmkssjh\",\"tags\":{\"rhptilluc\":\"txfkfweg\",\"cwsldri\":\"iqtgdqoh\"},\"identity\":{\"principalId\":\"pwbralllibphbqz\",\"tenantId\":\"zakakankjpdn\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"primr\":{\"principalId\":\"ylhjlm\",\"clientId\":\"y\"},\"vasylwxdzau\":{\"principalId\":\"pteecjme\",\"clientId\":\"ls\"}}},\"id\":\"eoohguufuzboyj\",\"name\":\"thwtzol\",\"type\":\"a\"}],\"nextLink\":\"wm\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"kchcxwa\",\"_ts\":57.15707,\"_etag\":\"zjkjexfdeqv\",\"id\":\"psylkkshkbffmbmx\",\"body\":\"rgywwp\"}},\"location\":\"xs\",\"tags\":{\"cg\":\"fujg\"},\"identity\":{\"principalId\":\"epttaqu\",\"tenantId\":\"ewemxs\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"ffqyinlj\":{\"principalId\":\"zzjgehkfki\",\"clientId\":\"tixo\"},\"xgvelfclduccbird\":{\"principalId\":\"pqwhixmonst\",\"clientId\":\"i\"},\"inwjizcilngh\":{\"principalId\":\"uwc\",\"clientId\":\"iegstm\"}}},\"id\":\"h\",\"name\":\"jjtbxqmuluxlxqz\",\"type\":\"nersb\"},{\"properties\":{\"resource\":{\"_rid\":\"rwnamikzeb\",\"_ts\":58.452225,\"_etag\":\"mswziq\",\"id\":\"fuhok\",\"body\":\"uswhvhczznvfbycj\"}},\"location\":\"jww\",\"tags\":{\"dvnoamldsehaohdj\":\"vumwmxqh\"},\"identity\":{\"principalId\":\"lzok\",\"tenantId\":\"ox\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"ftgz\":{\"principalId\":\"tag\",\"clientId\":\"sxoa\"},\"jcxcjxgrytfmpcyc\":{\"principalId\":\"pbswvefloccsrm\",\"clientId\":\"ihmipgawtxxpk\"},\"t\":{\"principalId\":\"rmcaykgg\",\"clientId\":\"xu\"},\"amktcqiosmgbzah\":{\"principalId\":\"sxwpndfcpfnznthj\",\"clientId\":\"kjaosrxuzv\"}}},\"id\":\"qdlyrtl\",\"name\":\"laprlt\",\"type\":\"katbhjm\"},{\"properties\":{\"resource\":{\"_rid\":\"s\",\"_ts\":9.8183155,\"_etag\":\"ala\",\"id\":\"vlagun\",\"body\":\"gfebwlnb\"}},\"location\":\"yreeudz\",\"tags\":{\"glgou\":\"bpdqmjxlyy\",\"yuojqtobaxk\":\"tlmj\",\"lbfjkwr\":\"eytu\",\"hsyrqunj\":\"snkq\"},\"identity\":{\"principalId\":\"enx\",\"tenantId\":\"l\",\"type\":\"None\",\"userAssignedIdentities\":{\"oweyirdhlis\":{\"principalId\":\"ifmjnn\",\"clientId\":\"tqabpxuckpgg\"}}},\"id\":\"wfl\",\"name\":\"qmp\",\"type\":\"zruwn\"}],\"nextLink\":\"xpxiwfcngjs\"}") .toObject(SqlStoredProcedureListResult.class); - Assertions.assertEquals("wm", model.nextLink()); + Assertions.assertEquals("xpxiwfcngjs", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureResourceTests.java index e08ee4311b19..c7c229c1b45f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlStoredProcedureResourceTests.java @@ -11,19 +11,17 @@ public final class SqlStoredProcedureResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SqlStoredProcedureResource model - = BinaryData.fromString("{\"id\":\"hujswtwkozzwcul\",\"body\":\"awpfajnjwltlwtjj\"}") - .toObject(SqlStoredProcedureResource.class); - Assertions.assertEquals("hujswtwkozzwcul", model.id()); - Assertions.assertEquals("awpfajnjwltlwtjj", model.body()); + SqlStoredProcedureResource model = BinaryData.fromString("{\"id\":\"yasflvgsgzwy\",\"body\":\"koih\"}") + .toObject(SqlStoredProcedureResource.class); + Assertions.assertEquals("yasflvgsgzwy", model.id()); + Assertions.assertEquals("koih", model.body()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SqlStoredProcedureResource model - = new SqlStoredProcedureResource().withId("hujswtwkozzwcul").withBody("awpfajnjwltlwtjj"); + SqlStoredProcedureResource model = new SqlStoredProcedureResource().withId("yasflvgsgzwy").withBody("koih"); model = BinaryData.fromObject(model).toObject(SqlStoredProcedureResource.class); - Assertions.assertEquals("hujswtwkozzwcul", model.id()); - Assertions.assertEquals("awpfajnjwltlwtjj", model.body()); + Assertions.assertEquals("yasflvgsgzwy", model.id()); + Assertions.assertEquals("koih", model.body()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerCreateUpdateParametersTests.java index cbd764415c31..c47aba6b417c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerCreateUpdateParametersTests.java @@ -22,42 +22,44 @@ public final class SqlTriggerCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlTriggerCreateUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"id\":\"mfxapjwogqqno\",\"body\":\"udcdabtqwpwyawb\",\"triggerType\":\"Pre\",\"triggerOperation\":\"Delete\"},\"options\":{\"throughput\":1611232173,\"autoscaleSettings\":{\"maxThroughput\":1122336945}}},\"id\":\"exaoguya\",\"name\":\"ids\",\"type\":\"ultxijjumfq\",\"location\":\"z\",\"tags\":{\"jng\":\"nm\",\"bjwgnyfus\":\"qdqx\",\"fh\":\"zsvtuikzhajqgl\"},\"identity\":{\"principalId\":\"qryxyn\",\"tenantId\":\"zrdpsovwxznptgoe\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ioovzidsxwaab\":{\"principalId\":\"pfhvfslk\",\"clientId\":\"tjlrigjksky\"},\"kzobgopxlhsln\":{\"principalId\":\"ifrygzn\",\"clientId\":\"axri\"}}}}") + "{\"properties\":{\"resource\":{\"id\":\"wklsnoxaxmqe\",\"body\":\"lhhjnh\",\"triggerType\":\"Post\",\"triggerOperation\":\"Create\"},\"options\":{\"throughput\":1952545143,\"autoscaleSettings\":{\"maxThroughput\":837661803}}},\"id\":\"gbv\",\"name\":\"anarfdlpukhpyrne\",\"type\":\"jcpeogkhnmg\",\"location\":\"ouxddbhfhpfpazj\",\"tags\":{\"acn\":\"wjxhpdulon\",\"rljyoogwxhnsdu\":\"qwtehtuevr\"},\"identity\":{\"principalId\":\"bsre\",\"tenantId\":\"fqkfuarenl\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"jboslcqxypok\":{\"principalId\":\"nvnaf\",\"clientId\":\"kyfede\"},\"ninvudbchaqdt\":{\"principalId\":\"minqcym\",\"clientId\":\"ngnbdxxew\"},\"xxdtddmflh\":{\"principalId\":\"ec\",\"clientId\":\"ct\"},\"xc\":{\"principalId\":\"tx\",\"clientId\":\"tznapxbannovv\"}}}}") .toObject(SqlTriggerCreateUpdateParameters.class); - Assertions.assertEquals("z", model.location()); - Assertions.assertEquals("nm", model.tags().get("jng")); + Assertions.assertEquals("ouxddbhfhpfpazj", model.location()); + Assertions.assertEquals("wjxhpdulon", model.tags().get("acn")); Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("mfxapjwogqqno", model.resource().id()); - Assertions.assertEquals("udcdabtqwpwyawb", model.resource().body()); - Assertions.assertEquals(TriggerType.PRE, model.resource().triggerType()); - Assertions.assertEquals(TriggerOperation.DELETE, model.resource().triggerOperation()); - Assertions.assertEquals(1611232173, model.options().throughput()); - Assertions.assertEquals(1122336945, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("wklsnoxaxmqe", model.resource().id()); + Assertions.assertEquals("lhhjnh", model.resource().body()); + Assertions.assertEquals(TriggerType.POST, model.resource().triggerType()); + Assertions.assertEquals(TriggerOperation.CREATE, model.resource().triggerOperation()); + Assertions.assertEquals(1952545143, model.options().throughput()); + Assertions.assertEquals(837661803, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SqlTriggerCreateUpdateParameters model = new SqlTriggerCreateUpdateParameters().withLocation("z") - .withTags(mapOf("jng", "nm", "bjwgnyfus", "qdqx", "fh", "zsvtuikzhajqgl")) + SqlTriggerCreateUpdateParameters model = new SqlTriggerCreateUpdateParameters().withLocation("ouxddbhfhpfpazj") + .withTags(mapOf("acn", "wjxhpdulon", "rljyoogwxhnsdu", "qwtehtuevr")) .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("ioovzidsxwaab", new ManagedServiceIdentityUserAssignedIdentities(), - "kzobgopxlhsln", new ManagedServiceIdentityUserAssignedIdentities()))) - .withResource(new SqlTriggerResource().withId("mfxapjwogqqno") - .withBody("udcdabtqwpwyawb") - .withTriggerType(TriggerType.PRE) - .withTriggerOperation(TriggerOperation.DELETE)) - .withOptions(new CreateUpdateOptions().withThroughput(1611232173) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1122336945))); + .withUserAssignedIdentities(mapOf("jboslcqxypok", new ManagedServiceIdentityUserAssignedIdentities(), + "ninvudbchaqdt", new ManagedServiceIdentityUserAssignedIdentities(), "xxdtddmflh", + new ManagedServiceIdentityUserAssignedIdentities(), "xc", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource(new SqlTriggerResource().withId("wklsnoxaxmqe") + .withBody("lhhjnh") + .withTriggerType(TriggerType.POST) + .withTriggerOperation(TriggerOperation.CREATE)) + .withOptions(new CreateUpdateOptions().withThroughput(1952545143) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(837661803))); model = BinaryData.fromObject(model).toObject(SqlTriggerCreateUpdateParameters.class); - Assertions.assertEquals("z", model.location()); - Assertions.assertEquals("nm", model.tags().get("jng")); + Assertions.assertEquals("ouxddbhfhpfpazj", model.location()); + Assertions.assertEquals("wjxhpdulon", model.tags().get("acn")); Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("mfxapjwogqqno", model.resource().id()); - Assertions.assertEquals("udcdabtqwpwyawb", model.resource().body()); - Assertions.assertEquals(TriggerType.PRE, model.resource().triggerType()); - Assertions.assertEquals(TriggerOperation.DELETE, model.resource().triggerOperation()); - Assertions.assertEquals(1611232173, model.options().throughput()); - Assertions.assertEquals(1122336945, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("wklsnoxaxmqe", model.resource().id()); + Assertions.assertEquals("lhhjnh", model.resource().body()); + Assertions.assertEquals(TriggerType.POST, model.resource().triggerType()); + Assertions.assertEquals(TriggerOperation.CREATE, model.resource().triggerOperation()); + Assertions.assertEquals(1952545143, model.options().throughput()); + Assertions.assertEquals(837661803, model.options().autoscaleSettings().maxThroughput()); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerCreateUpdatePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerCreateUpdatePropertiesTests.java index 03df81f83c9e..2f6aa6aaab3a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerCreateUpdatePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerCreateUpdatePropertiesTests.java @@ -17,31 +17,31 @@ public final class SqlTriggerCreateUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlTriggerCreateUpdateProperties model = BinaryData.fromString( - "{\"resource\":{\"id\":\"lxieixynllxecwcr\",\"body\":\"phslhcawjutifdw\",\"triggerType\":\"Post\",\"triggerOperation\":\"Update\"},\"options\":{\"throughput\":342779147,\"autoscaleSettings\":{\"maxThroughput\":1455188230}}}") + "{\"resource\":{\"id\":\"ytprwnwvroev\",\"body\":\"lyokrrrou\",\"triggerType\":\"Post\",\"triggerOperation\":\"Delete\"},\"options\":{\"throughput\":687704848,\"autoscaleSettings\":{\"maxThroughput\":238758843}}}") .toObject(SqlTriggerCreateUpdateProperties.class); - Assertions.assertEquals("lxieixynllxecwcr", model.resource().id()); - Assertions.assertEquals("phslhcawjutifdw", model.resource().body()); + Assertions.assertEquals("ytprwnwvroev", model.resource().id()); + Assertions.assertEquals("lyokrrrou", model.resource().body()); Assertions.assertEquals(TriggerType.POST, model.resource().triggerType()); - Assertions.assertEquals(TriggerOperation.UPDATE, model.resource().triggerOperation()); - Assertions.assertEquals(342779147, model.options().throughput()); - Assertions.assertEquals(1455188230, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(TriggerOperation.DELETE, model.resource().triggerOperation()); + Assertions.assertEquals(687704848, model.options().throughput()); + Assertions.assertEquals(238758843, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SqlTriggerCreateUpdateProperties model = new SqlTriggerCreateUpdateProperties() - .withResource(new SqlTriggerResource().withId("lxieixynllxecwcr") - .withBody("phslhcawjutifdw") + .withResource(new SqlTriggerResource().withId("ytprwnwvroev") + .withBody("lyokrrrou") .withTriggerType(TriggerType.POST) - .withTriggerOperation(TriggerOperation.UPDATE)) - .withOptions(new CreateUpdateOptions().withThroughput(342779147) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1455188230))); + .withTriggerOperation(TriggerOperation.DELETE)) + .withOptions(new CreateUpdateOptions().withThroughput(687704848) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(238758843))); model = BinaryData.fromObject(model).toObject(SqlTriggerCreateUpdateProperties.class); - Assertions.assertEquals("lxieixynllxecwcr", model.resource().id()); - Assertions.assertEquals("phslhcawjutifdw", model.resource().body()); + Assertions.assertEquals("ytprwnwvroev", model.resource().id()); + Assertions.assertEquals("lyokrrrou", model.resource().body()); Assertions.assertEquals(TriggerType.POST, model.resource().triggerType()); - Assertions.assertEquals(TriggerOperation.UPDATE, model.resource().triggerOperation()); - Assertions.assertEquals(342779147, model.options().throughput()); - Assertions.assertEquals(1455188230, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(TriggerOperation.DELETE, model.resource().triggerOperation()); + Assertions.assertEquals(687704848, model.options().throughput()); + Assertions.assertEquals(238758843, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerGetPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerGetPropertiesResourceTests.java index bc895a1bf183..e2de5085cf3b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerGetPropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerGetPropertiesResourceTests.java @@ -14,11 +14,11 @@ public final class SqlTriggerGetPropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlTriggerGetPropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"jnhlbkpbzpcpiljh\",\"_ts\":9.317743,\"_etag\":\"echndbnwieholew\",\"id\":\"wiuub\",\"body\":\"fqsfa\",\"triggerType\":\"Post\",\"triggerOperation\":\"Delete\"}") + "{\"_rid\":\"bnchrsziz\",\"_ts\":52.515366,\"_etag\":\"lyetndnbfqygg\",\"id\":\"g\",\"body\":\"nlgmtrwahzjmu\",\"triggerType\":\"Pre\",\"triggerOperation\":\"Delete\"}") .toObject(SqlTriggerGetPropertiesResource.class); - Assertions.assertEquals("wiuub", model.id()); - Assertions.assertEquals("fqsfa", model.body()); - Assertions.assertEquals(TriggerType.POST, model.triggerType()); + Assertions.assertEquals("g", model.id()); + Assertions.assertEquals("nlgmtrwahzjmu", model.body()); + Assertions.assertEquals(TriggerType.PRE, model.triggerType()); Assertions.assertEquals(TriggerOperation.DELETE, model.triggerOperation()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerGetPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerGetPropertiesTests.java index 8087a79f5305..a3bded51fd0f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerGetPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerGetPropertiesTests.java @@ -14,10 +14,10 @@ public final class SqlTriggerGetPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlTriggerGetProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"tutmzl\",\"_ts\":91.25174,\"_etag\":\"lvfhrbbp\",\"id\":\"eqvcwwyyurmoch\",\"body\":\"rprsnm\",\"triggerType\":\"Post\",\"triggerOperation\":\"Update\"}}") + "{\"resource\":{\"_rid\":\"axpunjqikczvv\",\"_ts\":62.381447,\"_etag\":\"gx\",\"id\":\"fcsserxhtvsox\",\"body\":\"wntsjgqrsxy\",\"triggerType\":\"Post\",\"triggerOperation\":\"Update\"}}") .toObject(SqlTriggerGetProperties.class); - Assertions.assertEquals("eqvcwwyyurmoch", model.resource().id()); - Assertions.assertEquals("rprsnm", model.resource().body()); + Assertions.assertEquals("fcsserxhtvsox", model.resource().id()); + Assertions.assertEquals("wntsjgqrsxy", model.resource().body()); Assertions.assertEquals(TriggerType.POST, model.resource().triggerType()); Assertions.assertEquals(TriggerOperation.UPDATE, model.resource().triggerOperation()); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerGetResultsInnerTests.java index eecd216ce0ff..f5cd2f049363 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerGetResultsInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerGetResultsInnerTests.java @@ -15,14 +15,14 @@ public final class SqlTriggerGetResultsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlTriggerGetResultsInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"bzqgqqi\",\"_ts\":32.8468,\"_etag\":\"vqwt\",\"id\":\"mkyi\",\"body\":\"ysi\",\"triggerType\":\"Post\",\"triggerOperation\":\"Replace\"}},\"location\":\"dhohsdtmcdzsuf\",\"tags\":{\"vhdbevwqqxey\":\"dxbzlmcmuap\",\"qzinkfkbg\":\"ko\"},\"identity\":{\"principalId\":\"owxeqocljmy\",\"tenantId\":\"kzq\",\"type\":\"None\",\"userAssignedIdentities\":{\"q\":{\"principalId\":\"bzefezr\",\"clientId\":\"czurtlei\"},\"noda\":{\"principalId\":\"kwv\",\"clientId\":\"nzvdfbzdixzmq\"}}},\"id\":\"pqhe\",\"name\":\"jptmcgsbost\",\"type\":\"eln\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"mzjr\",\"_ts\":88.29674,\"_etag\":\"zeqyjleziun\",\"id\":\"xdfzantkw\",\"body\":\"gyamlbnseqacjjv\",\"triggerType\":\"Post\",\"triggerOperation\":\"Update\"}},\"location\":\"oq\",\"tags\":{\"itgueiookjbs\":\"m\",\"cslmotoebnfxo\":\"hrtdtpdelq\",\"razftxejwabmdujt\":\"vcjkgd\",\"m\":\"vcopex\"},\"identity\":{\"principalId\":\"buhhlkyqlt\",\"tenantId\":\"rogtuwkf\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ogsf\":{\"principalId\":\"ysidfvclgl\",\"clientId\":\"fuijtkbus\"},\"vwkpqh\":{\"principalId\":\"ayiansharujtji\",\"clientId\":\"fzyjqt\"}}},\"id\":\"enuygbq\",\"name\":\"qqekewvnqvcdlgu\",\"type\":\"ucmfdj\"}") .toObject(SqlTriggerGetResultsInner.class); - Assertions.assertEquals("dhohsdtmcdzsuf", model.location()); - Assertions.assertEquals("dxbzlmcmuap", model.tags().get("vhdbevwqqxey")); - Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("mkyi", model.resource().id()); - Assertions.assertEquals("ysi", model.resource().body()); + Assertions.assertEquals("oq", model.location()); + Assertions.assertEquals("m", model.tags().get("itgueiookjbs")); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("xdfzantkw", model.resource().id()); + Assertions.assertEquals("gyamlbnseqacjjv", model.resource().body()); Assertions.assertEquals(TriggerType.POST, model.resource().triggerType()); - Assertions.assertEquals(TriggerOperation.REPLACE, model.resource().triggerOperation()); + Assertions.assertEquals(TriggerOperation.UPDATE, model.resource().triggerOperation()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerListResultTests.java index ac63bf1f2e21..8f262f43ed51 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerListResultTests.java @@ -12,8 +12,8 @@ public final class SqlTriggerListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlTriggerListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"glka\",\"_ts\":96.37377,\"_etag\":\"qjujeickpzvcp\",\"id\":\"pmxelnwcltyje\",\"body\":\"xxmlfmkqscazua\",\"triggerType\":\"Post\",\"triggerOperation\":\"All\"}},\"location\":\"uamwabzxrvxc\",\"tags\":{\"gzwywak\":\"sphaivmxyasflvg\",\"ljhlnymzotq\":\"ihknsmjbl\",\"mv\":\"ryuzcbmqqv\"},\"identity\":{\"principalId\":\"tayx\",\"tenantId\":\"supe\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"yqo\":{\"principalId\":\"hcvsqltnzoi\",\"clientId\":\"sxgnx\"},\"iqxeiiqbimht\":{\"principalId\":\"p\",\"clientId\":\"xwdofdb\"},\"embnkbw\":{\"principalId\":\"winhehfqpo\",\"clientId\":\"wbcb\"},\"izvcjfe\":{\"principalId\":\"vxkdivqihebwtswb\",\"clientId\":\"wfmdurage\"}}},\"id\":\"sdjubggbqigkxkbs\",\"name\":\"zgakgacyrcmj\",\"type\":\"mspofapvuhryl\"},{\"properties\":{\"resource\":{\"_rid\":\"rz\",\"_ts\":69.57918,\"_etag\":\"edm\",\"id\":\"tkvnlvxbcuiiznkt\",\"body\":\"ansnvp\",\"triggerType\":\"Pre\",\"triggerOperation\":\"Create\"}},\"location\":\"ostbzbkiwb\",\"tags\":{\"yls\":\"yophz\"},\"identity\":{\"principalId\":\"pfbcunezzcez\",\"tenantId\":\"fwyfwlwxjwet\",\"type\":\"None\",\"userAssignedIdentities\":{\"cxwaxfewz\":{\"principalId\":\"lafzvaylptr\",\"clientId\":\"qwztcmwqkc\"},\"jrgywwpgjxsn\":{\"principalId\":\"jexfdeqvhp\",\"clientId\":\"lkkshkbffmbmx\"},\"pttaqutd\":{\"principalId\":\"fujg\",\"clientId\":\"gaao\"},\"tixo\":{\"principalId\":\"emxswvruu\",\"clientId\":\"zjgehkfkim\"}}},\"id\":\"fqyinljqepqw\",\"name\":\"ixmonstshiyxg\",\"type\":\"elfclducc\"},{\"properties\":{\"resource\":{\"_rid\":\"svu\",\"_ts\":1.7061472,\"_etag\":\"iegstm\",\"id\":\"inwjizcilngh\",\"body\":\"h\",\"triggerType\":\"Post\",\"triggerOperation\":\"Update\"}},\"location\":\"qmuluxlxqz\",\"tags\":{\"mikzeb\":\"rsbycucrwn\"},\"identity\":{\"principalId\":\"smswziqgfuh\",\"tenantId\":\"zruswh\",\"type\":\"None\",\"userAssignedIdentities\":{\"xzv\":{\"principalId\":\"vfbyc\",\"clientId\":\"xjww\"},\"flzokxco\":{\"principalId\":\"wmxqhndvnoamlds\",\"clientId\":\"aohdjh\"},\"zpnpbswv\":{\"principalId\":\"e\",\"clientId\":\"jetagltsxoatft\"},\"wtxxpkyjcx\":{\"principalId\":\"loccsrmozihm\",\"clientId\":\"g\"}}},\"id\":\"xgrytfmp\",\"name\":\"ycilrmcaykggnox\",\"type\":\"ztrksxwpndf\"}],\"nextLink\":\"fnznth\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"rxklobdxnazpmk\",\"_ts\":7.287538,\"_etag\":\"evfxzopjhbzxlioh\",\"id\":\"d\",\"body\":\"tfgxqbawpcb\",\"triggerType\":\"Pre\",\"triggerOperation\":\"Delete\"}},\"location\":\"knapq\",\"tags\":{\"d\":\"uicdhzbdybwwg\",\"fmuvapckccr\":\"ibidmhmwffp\",\"oxoyyukp\":\"vwe\"},\"identity\":{\"principalId\":\"mmoiroqboshbra\",\"tenantId\":\"pyyrmfs\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"sjcaacfdmmcpugm\":{\"principalId\":\"opfppdbwnupgah\",\"clientId\":\"um\"},\"qnbldxe\":{\"principalId\":\"qepvufhbzeh\",\"clientId\":\"hoqhnl\"},\"krsrrmoucs\":{\"principalId\":\"lgsc\",\"clientId\":\"ri\"}}},\"id\":\"ldpuviy\",\"name\":\"caab\",\"type\":\"olhbhlvb\"}],\"nextLink\":\"uqibsxtkcu\"}") .toObject(SqlTriggerListResult.class); - Assertions.assertEquals("fnznth", model.nextLink()); + Assertions.assertEquals("uqibsxtkcu", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerResourceTests.java index 9882702e6e2a..06241c1136f6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlTriggerResourceTests.java @@ -14,23 +14,23 @@ public final class SqlTriggerResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlTriggerResource model = BinaryData - .fromString("{\"id\":\"e\",\"body\":\"q\",\"triggerType\":\"Pre\",\"triggerOperation\":\"All\"}") + .fromString("{\"id\":\"r\",\"body\":\"rohkpigqfusu\",\"triggerType\":\"Pre\",\"triggerOperation\":\"All\"}") .toObject(SqlTriggerResource.class); - Assertions.assertEquals("e", model.id()); - Assertions.assertEquals("q", model.body()); + Assertions.assertEquals("r", model.id()); + Assertions.assertEquals("rohkpigqfusu", model.body()); Assertions.assertEquals(TriggerType.PRE, model.triggerType()); Assertions.assertEquals(TriggerOperation.ALL, model.triggerOperation()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SqlTriggerResource model = new SqlTriggerResource().withId("e") - .withBody("q") + SqlTriggerResource model = new SqlTriggerResource().withId("r") + .withBody("rohkpigqfusu") .withTriggerType(TriggerType.PRE) .withTriggerOperation(TriggerOperation.ALL); model = BinaryData.fromObject(model).toObject(SqlTriggerResource.class); - Assertions.assertEquals("e", model.id()); - Assertions.assertEquals("q", model.body()); + Assertions.assertEquals("r", model.id()); + Assertions.assertEquals("rohkpigqfusu", model.body()); Assertions.assertEquals(TriggerType.PRE, model.triggerType()); Assertions.assertEquals(TriggerOperation.ALL, model.triggerOperation()); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionCreateUpdateParametersTests.java index 07cea58c3918..2c9eabf81f0f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionCreateUpdateParametersTests.java @@ -20,37 +20,36 @@ public final class SqlUserDefinedFunctionCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlUserDefinedFunctionCreateUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"id\":\"we\",\"body\":\"wlalniexzsrzp\"},\"options\":{\"throughput\":125361630,\"autoscaleSettings\":{\"maxThroughput\":417783908}}},\"id\":\"wwpgdakchzyvlixq\",\"name\":\"kcxk\",\"type\":\"bn\",\"location\":\"ysux\",\"tags\":{\"ttexoqqpwcyyufmh\":\"rntvlwijp\",\"qspkcdqzhlctd\":\"uncuw\"},\"identity\":{\"principalId\":\"qn\",\"tenantId\":\"fpch\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"r\":{\"principalId\":\"rcgegydcwboxjum\",\"clientId\":\"qoli\"},\"rzpasccbiuimzdly\":{\"principalId\":\"iouaubrjt\",\"clientId\":\"qxfuojrngif\"},\"pctf\":{\"principalId\":\"fqwmkyoquf\",\"clientId\":\"ruzslzoj\"}}}}") + "{\"properties\":{\"resource\":{\"id\":\"hsqqgvriibakcl\",\"body\":\"jfrnxousxauzlwv\"},\"options\":{\"throughput\":491196265,\"autoscaleSettings\":{\"maxThroughput\":414245170}}},\"id\":\"zizvuxmmk\",\"name\":\"vthn\",\"type\":\"zt\",\"location\":\"ovmribiattg\",\"tags\":{\"swvxwlmzqwmv\":\"cfotangcfhnykzcu\",\"uqudtcvclxyn\":\"xnjmxm\",\"dugneiknp\":\"dkvgfabuiyjibuzp\"},\"identity\":{\"principalId\":\"gjiuqhibto\",\"tenantId\":\"pqwjedm\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"cloxo\":{\"principalId\":\"ewpktvqy\",\"clientId\":\"mqpzoyhlfbcgw\"}}}}") .toObject(SqlUserDefinedFunctionCreateUpdateParameters.class); - Assertions.assertEquals("ysux", model.location()); - Assertions.assertEquals("rntvlwijp", model.tags().get("ttexoqqpwcyyufmh")); + Assertions.assertEquals("ovmribiattg", model.location()); + Assertions.assertEquals("cfotangcfhnykzcu", model.tags().get("swvxwlmzqwmv")); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("we", model.resource().id()); - Assertions.assertEquals("wlalniexzsrzp", model.resource().body()); - Assertions.assertEquals(125361630, model.options().throughput()); - Assertions.assertEquals(417783908, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("hsqqgvriibakcl", model.resource().id()); + Assertions.assertEquals("jfrnxousxauzlwv", model.resource().body()); + Assertions.assertEquals(491196265, model.options().throughput()); + Assertions.assertEquals(414245170, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SqlUserDefinedFunctionCreateUpdateParameters model - = new SqlUserDefinedFunctionCreateUpdateParameters().withLocation("ysux") - .withTags(mapOf("ttexoqqpwcyyufmh", "rntvlwijp", "qspkcdqzhlctd", "uncuw")) - .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("r", new ManagedServiceIdentityUserAssignedIdentities(), - "rzpasccbiuimzdly", new ManagedServiceIdentityUserAssignedIdentities(), "pctf", - new ManagedServiceIdentityUserAssignedIdentities()))) - .withResource(new SqlUserDefinedFunctionResource().withId("we").withBody("wlalniexzsrzp")) - .withOptions(new CreateUpdateOptions().withThroughput(125361630) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(417783908))); + SqlUserDefinedFunctionCreateUpdateParameters model = new SqlUserDefinedFunctionCreateUpdateParameters() + .withLocation("ovmribiattg") + .withTags( + mapOf("swvxwlmzqwmv", "cfotangcfhnykzcu", "uqudtcvclxyn", "xnjmxm", "dugneiknp", "dkvgfabuiyjibuzp")) + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("cloxo", new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource(new SqlUserDefinedFunctionResource().withId("hsqqgvriibakcl").withBody("jfrnxousxauzlwv")) + .withOptions(new CreateUpdateOptions().withThroughput(491196265) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(414245170))); model = BinaryData.fromObject(model).toObject(SqlUserDefinedFunctionCreateUpdateParameters.class); - Assertions.assertEquals("ysux", model.location()); - Assertions.assertEquals("rntvlwijp", model.tags().get("ttexoqqpwcyyufmh")); + Assertions.assertEquals("ovmribiattg", model.location()); + Assertions.assertEquals("cfotangcfhnykzcu", model.tags().get("swvxwlmzqwmv")); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("we", model.resource().id()); - Assertions.assertEquals("wlalniexzsrzp", model.resource().body()); - Assertions.assertEquals(125361630, model.options().throughput()); - Assertions.assertEquals(417783908, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("hsqqgvriibakcl", model.resource().id()); + Assertions.assertEquals("jfrnxousxauzlwv", model.resource().body()); + Assertions.assertEquals(491196265, model.options().throughput()); + Assertions.assertEquals(414245170, model.options().autoscaleSettings().maxThroughput()); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionCreateUpdatePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionCreateUpdatePropertiesTests.java index 1c062df41fb6..39d40c5b0592 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionCreateUpdatePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionCreateUpdatePropertiesTests.java @@ -15,24 +15,24 @@ public final class SqlUserDefinedFunctionCreateUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlUserDefinedFunctionCreateUpdateProperties model = BinaryData.fromString( - "{\"resource\":{\"id\":\"mdxotngfdgu\",\"body\":\"yzihgrkyuizabsn\"},\"options\":{\"throughput\":464167190,\"autoscaleSettings\":{\"maxThroughput\":537597244}}}") + "{\"resource\":{\"id\":\"bqinjipnwjfu\",\"body\":\"lafcbahh\"},\"options\":{\"throughput\":1336272838,\"autoscaleSettings\":{\"maxThroughput\":1504313101}}}") .toObject(SqlUserDefinedFunctionCreateUpdateProperties.class); - Assertions.assertEquals("mdxotngfdgu", model.resource().id()); - Assertions.assertEquals("yzihgrkyuizabsn", model.resource().body()); - Assertions.assertEquals(464167190, model.options().throughput()); - Assertions.assertEquals(537597244, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("bqinjipnwjfu", model.resource().id()); + Assertions.assertEquals("lafcbahh", model.resource().body()); + Assertions.assertEquals(1336272838, model.options().throughput()); + Assertions.assertEquals(1504313101, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SqlUserDefinedFunctionCreateUpdateProperties model = new SqlUserDefinedFunctionCreateUpdateProperties() - .withResource(new SqlUserDefinedFunctionResource().withId("mdxotngfdgu").withBody("yzihgrkyuizabsn")) - .withOptions(new CreateUpdateOptions().withThroughput(464167190) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(537597244))); + .withResource(new SqlUserDefinedFunctionResource().withId("bqinjipnwjfu").withBody("lafcbahh")) + .withOptions(new CreateUpdateOptions().withThroughput(1336272838) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1504313101))); model = BinaryData.fromObject(model).toObject(SqlUserDefinedFunctionCreateUpdateProperties.class); - Assertions.assertEquals("mdxotngfdgu", model.resource().id()); - Assertions.assertEquals("yzihgrkyuizabsn", model.resource().body()); - Assertions.assertEquals(464167190, model.options().throughput()); - Assertions.assertEquals(537597244, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals("bqinjipnwjfu", model.resource().id()); + Assertions.assertEquals("lafcbahh", model.resource().body()); + Assertions.assertEquals(1336272838, model.options().throughput()); + Assertions.assertEquals(1504313101, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionGetPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionGetPropertiesResourceTests.java index 2a9c6d91cdbe..2d7c4fda4c6b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionGetPropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionGetPropertiesResourceTests.java @@ -12,9 +12,9 @@ public final class SqlUserDefinedFunctionGetPropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlUserDefinedFunctionGetPropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"jlvizbfhfovva\",\"_ts\":16.778976,\"_etag\":\"tuodxeszabbelaw\",\"id\":\"muaslzkw\",\"body\":\"woycqucwyha\"}") + "{\"_rid\":\"mvkhlggd\",\"_ts\":10.865116,\"_etag\":\"zqkzszuwi\",\"id\":\"tglxx\",\"body\":\"jfpgpicrmn\"}") .toObject(SqlUserDefinedFunctionGetPropertiesResource.class); - Assertions.assertEquals("muaslzkw", model.id()); - Assertions.assertEquals("woycqucwyha", model.body()); + Assertions.assertEquals("tglxx", model.id()); + Assertions.assertEquals("jfpgpicrmn", model.body()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionGetPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionGetPropertiesTests.java index 518ee6950fb4..7fb9efcaa46e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionGetPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionGetPropertiesTests.java @@ -12,9 +12,9 @@ public final class SqlUserDefinedFunctionGetPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlUserDefinedFunctionGetProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"jctzenkei\",\"_ts\":71.052414,\"_etag\":\"mkdasv\",\"id\":\"lyhb\",\"body\":\"udchxgsrboldforo\"}}") + "{\"resource\":{\"_rid\":\"mhha\",\"_ts\":54.6727,\"_etag\":\"mzvupor\",\"id\":\"zdfuydzvkfvxcnqm\",\"body\":\"psw\"}}") .toObject(SqlUserDefinedFunctionGetProperties.class); - Assertions.assertEquals("lyhb", model.resource().id()); - Assertions.assertEquals("udchxgsrboldforo", model.resource().body()); + Assertions.assertEquals("zdfuydzvkfvxcnqm", model.resource().id()); + Assertions.assertEquals("psw", model.resource().body()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionGetResultsInnerTests.java index fbcab00b5491..1e6504081b99 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionGetResultsInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionGetResultsInnerTests.java @@ -13,12 +13,12 @@ public final class SqlUserDefinedFunctionGetResultsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlUserDefinedFunctionGetResultsInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"bwjscjpahlxveab\",\"_ts\":94.557976,\"_etag\":\"mwmqtibx\",\"id\":\"ijddtvqc\",\"body\":\"adijaeukmrsie\"}},\"location\":\"pndzaapmudqmeq\",\"tags\":{\"znrtffyaqit\":\"pibudqwyxebeybpm\"},\"identity\":{\"principalId\":\"eioqaqhvse\",\"tenantId\":\"uqyrxpdl\",\"type\":\"None\",\"userAssignedIdentities\":{\"cdisyir\":{\"principalId\":\"smjqfrddgam\",\"clientId\":\"hiosrsjuiv\"},\"lrpiqywnc\":{\"principalId\":\"zhczexrxzbujrtrh\",\"clientId\":\"wrevkhgnlnzon\"},\"urvzmlovuanashc\":{\"principalId\":\"tszcofizehtdhgb\",\"clientId\":\"vreljea\"}}},\"id\":\"pmjerbdkelvidiz\",\"name\":\"zsdbccxjmon\",\"type\":\"dgnwncypuuwwlt\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"ixtmkzjvkviirhgf\",\"_ts\":70.06768,\"_etag\":\"dpgra\",\"id\":\"zvzbglbyv\",\"body\":\"tctbrxkjzwrgxffm\"}},\"location\":\"kwfbkgo\",\"tags\":{\"napxbiygnug\":\"opdbydpizqac\",\"lq\":\"knfsmfcttuxuuyil\",\"njhvsujztc\":\"iquvrehm\"},\"identity\":{\"principalId\":\"qjtwhauu\",\"tenantId\":\"prnjletlxsmr\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"knlqwzdvpiwhxqsz\":{\"principalId\":\"fa\",\"clientId\":\"waziy\"},\"ygjbmzyospspsh\":{\"principalId\":\"maajquhuxylr\",\"clientId\":\"m\"},\"eyujtvczkcnyxrx\":{\"principalId\":\"fkyjpmspbpssdfpp\",\"clientId\":\"gt\"},\"zvuqdflvon\":{\"principalId\":\"njdxvglnkvxl\",\"clientId\":\"aglqivbgkcvkh\"}}},\"id\":\"pfpubcpzgpx\",\"name\":\"ivhjknidi\",\"type\":\"gqjxgpnrhgovfgp\"}") .toObject(SqlUserDefinedFunctionGetResultsInner.class); - Assertions.assertEquals("pndzaapmudqmeq", model.location()); - Assertions.assertEquals("pibudqwyxebeybpm", model.tags().get("znrtffyaqit")); - Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("ijddtvqc", model.resource().id()); - Assertions.assertEquals("adijaeukmrsie", model.resource().body()); + Assertions.assertEquals("kwfbkgo", model.location()); + Assertions.assertEquals("opdbydpizqac", model.tags().get("napxbiygnug")); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("zvzbglbyv", model.resource().id()); + Assertions.assertEquals("tctbrxkjzwrgxffm", model.resource().body()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionListResultTests.java index dce6c8f00a2f..34a99fae4c39 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionListResultTests.java @@ -12,8 +12,8 @@ public final class SqlUserDefinedFunctionListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SqlUserDefinedFunctionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"yhsgz\",\"_ts\":56.90114,\"_etag\":\"gomfgbeglq\",\"id\":\"leohibetnluankr\",\"body\":\"xeeebtijvacvbmqz\"}},\"location\":\"q\",\"tags\":{\"h\":\"jrnwxacev\"},\"identity\":{\"principalId\":\"yxoaf\",\"tenantId\":\"oqltfae\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"gh\":{\"principalId\":\"gv\",\"clientId\":\"r\"},\"nuciqdsmexiit\":{\"principalId\":\"ypoq\",\"clientId\":\"hlqhykprlpy\"},\"nlj\":{\"principalId\":\"uxtyasiibmi\",\"clientId\":\"nnust\"},\"yyprotwyp\":{\"principalId\":\"mgixhcmavmqfou\",\"clientId\":\"rhc\"}}},\"id\":\"d\",\"name\":\"bxhugcmjkavlgorb\",\"type\":\"ftpmdtzfjltfv\"}],\"nextLink\":\"cyjtotpvop\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"ilkmk\",\"_ts\":31.33989,\"_etag\":\"vdndviauo\",\"id\":\"phuartv\",\"body\":\"ukyefchnmnahmnxh\"}},\"location\":\"jqirwrw\",\"tags\":{\"hx\":\"xffi\",\"hsycxhxzgaz\":\"rsnewmozqvbubqma\"},\"identity\":{\"principalId\":\"boi\",\"tenantId\":\"mfqhppubowse\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"phwpnulaiywzej\":{\"principalId\":\"tdherngbtcjuahok\",\"clientId\":\"obkauxofsh\"},\"llndnpd\":{\"principalId\":\"hs\",\"clientId\":\"koj\"}}},\"id\":\"pqafgfugsnnfhy\",\"name\":\"tefypococtfjgti\",\"type\":\"rjvzuyt\"},{\"properties\":{\"resource\":{\"_rid\":\"muowolbauiro\",\"_ts\":16.613323,\"_etag\":\"szonwpngajinn\",\"id\":\"xjawrt\",\"body\":\"fjmyccxlzhco\"}},\"location\":\"vnekhenlusfnrdtj\",\"tags\":{\"cq\":\"r\",\"uslvyjtcvuwkasi\":\"jvidttge\"},\"identity\":{\"principalId\":\"sfuughtuqfecjx\",\"tenantId\":\"gtuhxuicbu\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"jbaqehgpdoh\":{\"principalId\":\"njlx\",\"clientId\":\"rhwpus\"}}},\"id\":\"qatucoigebxnc\",\"name\":\"wfepbnwgfmx\",\"type\":\"gcgbjb\"}],\"nextLink\":\"lfgtdysnaquflqbc\"}") .toObject(SqlUserDefinedFunctionListResult.class); - Assertions.assertEquals("cyjtotpvop", model.nextLink()); + Assertions.assertEquals("lfgtdysnaquflqbc", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionResourceTests.java index 51c5acd53051..fee8e04c7ef2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/SqlUserDefinedFunctionResourceTests.java @@ -11,18 +11,18 @@ public final class SqlUserDefinedFunctionResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SqlUserDefinedFunctionResource model = BinaryData.fromString("{\"id\":\"nomdrkywuhpsv\",\"body\":\"urut\"}") + SqlUserDefinedFunctionResource model = BinaryData.fromString("{\"id\":\"hr\",\"body\":\"qgjsxvpqcbfrmbod\"}") .toObject(SqlUserDefinedFunctionResource.class); - Assertions.assertEquals("nomdrkywuhpsv", model.id()); - Assertions.assertEquals("urut", model.body()); + Assertions.assertEquals("hr", model.id()); + Assertions.assertEquals("qgjsxvpqcbfrmbod", model.body()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SqlUserDefinedFunctionResource model - = new SqlUserDefinedFunctionResource().withId("nomdrkywuhpsv").withBody("urut"); + = new SqlUserDefinedFunctionResource().withId("hr").withBody("qgjsxvpqcbfrmbod"); model = BinaryData.fromObject(model).toObject(SqlUserDefinedFunctionResource.class); - Assertions.assertEquals("nomdrkywuhpsv", model.id()); - Assertions.assertEquals("urut", model.body()); + Assertions.assertEquals("hr", model.id()); + Assertions.assertEquals("qgjsxvpqcbfrmbod", model.body()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableCreateUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableCreateUpdateParametersTests.java index 600ede8fd9ed..87953c04bc1a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableCreateUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableCreateUpdateParametersTests.java @@ -23,46 +23,47 @@ public final class TableCreateUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableCreateUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"id\":\"kgqxn\",\"restoreParameters\":{\"restoreSource\":\"keznjaujvaa\",\"restoreTimestampInUtc\":\"2021-07-20T05:39:01Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":2110011560,\"autoscaleSettings\":{\"maxThroughput\":1670599893}}},\"id\":\"xw\",\"name\":\"ka\",\"type\":\"rrqmbzmqk\",\"location\":\"tbnxwbjsid\",\"tags\":{\"ewijymrhbguz\":\"kfpksokdgo\",\"nfnzhhh\":\"zkye\"},\"identity\":{\"principalId\":\"mffjkutycyarn\",\"tenantId\":\"ohguabz\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"cnhz\":{\"principalId\":\"pyc\",\"clientId\":\"coe\"}}}}") + "{\"properties\":{\"resource\":{\"id\":\"urcclfgxannn\",\"restoreParameters\":{\"restoreSource\":\"zposewxigpxvkqm\",\"restoreTimestampInUtc\":\"2021-05-06T23:25:16Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":102361694,\"autoscaleSettings\":{\"maxThroughput\":479705193}}},\"id\":\"zyzeyuubeidsz\",\"name\":\"ytoithgygvfl\",\"type\":\"vdihoynkrx\",\"location\":\"twk\",\"tags\":{\"moenodnaien\":\"yrucpcunnuzdq\"},\"identity\":{\"principalId\":\"skndnelqkaadlknw\",\"tenantId\":\"anniyopetxivcnr\",\"type\":\"None\",\"userAssignedIdentities\":{\"qsdtcjbctvivuzq\":{\"principalId\":\"aephblkw\",\"clientId\":\"atv\"}}}}") .toObject(TableCreateUpdateParameters.class); - Assertions.assertEquals("tbnxwbjsid", model.location()); - Assertions.assertEquals("kfpksokdgo", model.tags().get("ewijymrhbguz")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("kgqxn", model.resource().id()); - Assertions.assertEquals("keznjaujvaa", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T05:39:01Z"), + Assertions.assertEquals("twk", model.location()); + Assertions.assertEquals("yrucpcunnuzdq", model.tags().get("moenodnaien")); + Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals("urcclfgxannn", model.resource().id()); + Assertions.assertEquals("zposewxigpxvkqm", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T23:25:16Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); - Assertions.assertEquals(2110011560, model.options().throughput()); - Assertions.assertEquals(1670599893, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(102361694, model.options().throughput()); + Assertions.assertEquals(479705193, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TableCreateUpdateParameters model = new TableCreateUpdateParameters().withLocation("tbnxwbjsid") - .withTags(mapOf("ewijymrhbguz", "kfpksokdgo", "nfnzhhh", "zkye")) - .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("cnhz", new ManagedServiceIdentityUserAssignedIdentities()))) - .withResource(new TableResource().withId("kgqxn") - .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("keznjaujvaa") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-07-20T05:39:01Z")) + TableCreateUpdateParameters model = new TableCreateUpdateParameters().withLocation("twk") + .withTags(mapOf("moenodnaien", "yrucpcunnuzdq")) + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.NONE) + .withUserAssignedIdentities( + mapOf("qsdtcjbctvivuzq", new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource(new TableResource().withId("urcclfgxannn") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("zposewxigpxvkqm") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-05-06T23:25:16Z")) .withRestoreWithTtlDisabled(false)) .withCreateMode(CreateMode.DEFAULT)) - .withOptions(new CreateUpdateOptions().withThroughput(2110011560) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1670599893))); + .withOptions(new CreateUpdateOptions().withThroughput(102361694) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(479705193))); model = BinaryData.fromObject(model).toObject(TableCreateUpdateParameters.class); - Assertions.assertEquals("tbnxwbjsid", model.location()); - Assertions.assertEquals("kfpksokdgo", model.tags().get("ewijymrhbguz")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("kgqxn", model.resource().id()); - Assertions.assertEquals("keznjaujvaa", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T05:39:01Z"), + Assertions.assertEquals("twk", model.location()); + Assertions.assertEquals("yrucpcunnuzdq", model.tags().get("moenodnaien")); + Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals("urcclfgxannn", model.resource().id()); + Assertions.assertEquals("zposewxigpxvkqm", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T23:25:16Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); - Assertions.assertEquals(2110011560, model.options().throughput()); - Assertions.assertEquals(1670599893, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(102361694, model.options().throughput()); + Assertions.assertEquals(479705193, model.options().autoscaleSettings().maxThroughput()); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableCreateUpdatePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableCreateUpdatePropertiesTests.java index 63a59e5e170b..4da25ffc283f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableCreateUpdatePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableCreateUpdatePropertiesTests.java @@ -18,36 +18,36 @@ public final class TableCreateUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableCreateUpdateProperties model = BinaryData.fromString( - "{\"resource\":{\"id\":\"rottjzcfyjzptw\",\"restoreParameters\":{\"restoreSource\":\"h\",\"restoreTimestampInUtc\":\"2021-03-15T17:03:59Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":1335089450,\"autoscaleSettings\":{\"maxThroughput\":1933149866}}}") + "{\"resource\":{\"id\":\"mtuowogtgitsqhzv\",\"restoreParameters\":{\"restoreSource\":\"cdb\",\"restoreTimestampInUtc\":\"2021-09-14T13:57:27Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":1628332910,\"autoscaleSettings\":{\"maxThroughput\":505838668}}}") .toObject(TableCreateUpdateProperties.class); - Assertions.assertEquals("rottjzcfyjzptw", model.resource().id()); - Assertions.assertEquals("h", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T17:03:59Z"), + Assertions.assertEquals("mtuowogtgitsqhzv", model.resource().id()); + Assertions.assertEquals("cdb", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-14T13:57:27Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(1335089450, model.options().throughput()); - Assertions.assertEquals(1933149866, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); + Assertions.assertEquals(1628332910, model.options().throughput()); + Assertions.assertEquals(505838668, model.options().autoscaleSettings().maxThroughput()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TableCreateUpdateProperties model = new TableCreateUpdateProperties() - .withResource(new TableResource().withId("rottjzcfyjzptw") - .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("h") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-03-15T17:03:59Z")) + .withResource(new TableResource().withId("mtuowogtgitsqhzv") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("cdb") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-09-14T13:57:27Z")) .withRestoreWithTtlDisabled(true)) - .withCreateMode(CreateMode.RESTORE)) - .withOptions(new CreateUpdateOptions().withThroughput(1335089450) - .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(1933149866))); + .withCreateMode(CreateMode.DEFAULT)) + .withOptions(new CreateUpdateOptions().withThroughput(1628332910) + .withAutoscaleSettings(new AutoscaleSettings().withMaxThroughput(505838668))); model = BinaryData.fromObject(model).toObject(TableCreateUpdateProperties.class); - Assertions.assertEquals("rottjzcfyjzptw", model.resource().id()); - Assertions.assertEquals("h", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T17:03:59Z"), + Assertions.assertEquals("mtuowogtgitsqhzv", model.resource().id()); + Assertions.assertEquals("cdb", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-14T13:57:27Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertTrue(model.resource().restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); - Assertions.assertEquals(1335089450, model.options().throughput()); - Assertions.assertEquals(1933149866, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); + Assertions.assertEquals(1628332910, model.options().throughput()); + Assertions.assertEquals(505838668, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetPropertiesOptionsTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetPropertiesOptionsTests.java index 3fa50511daf7..59ffd82fe74b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetPropertiesOptionsTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetPropertiesOptionsTests.java @@ -12,9 +12,9 @@ public final class TableGetPropertiesOptionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableGetPropertiesOptions model - = BinaryData.fromString("{\"throughput\":345832677,\"autoscaleSettings\":{\"maxThroughput\":833526505}}") + = BinaryData.fromString("{\"throughput\":59854716,\"autoscaleSettings\":{\"maxThroughput\":227025000}}") .toObject(TableGetPropertiesOptions.class); - Assertions.assertEquals(345832677, model.throughput()); - Assertions.assertEquals(833526505, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(59854716, model.throughput()); + Assertions.assertEquals(227025000, model.autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetPropertiesResourceTests.java index 56759b03dcbc..55d4d8bb275b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetPropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetPropertiesResourceTests.java @@ -14,13 +14,13 @@ public final class TableGetPropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableGetPropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"mbltoo\",\"_ts\":36.390366,\"_etag\":\"qlwxldyka\",\"id\":\"sy\",\"restoreParameters\":{\"restoreSource\":\"lnjpnnbmjksibjgs\",\"restoreTimestampInUtc\":\"2021-02-15T10:10:41Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"}") + "{\"_rid\":\"ednwyyshtu\",\"_ts\":56.477654,\"_etag\":\"vuafpwzyifr\",\"id\":\"gwltxeqip\",\"restoreParameters\":{\"restoreSource\":\"dyimsfay\",\"restoreTimestampInUtc\":\"2021-07-01T11:25:11Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"}") .toObject(TableGetPropertiesResource.class); - Assertions.assertEquals("sy", model.id()); - Assertions.assertEquals("lnjpnnbmjksibjgs", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-15T10:10:41Z"), + Assertions.assertEquals("gwltxeqip", model.id()); + Assertions.assertEquals("dyimsfay", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-01T11:25:11Z"), model.restoreParameters().restoreTimestampInUtc()); - Assertions.assertTrue(model.restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.RESTORE, model.createMode()); + Assertions.assertFalse(model.restoreParameters().restoreWithTtlDisabled()); + Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetPropertiesTests.java index fd850a2c60ab..e07e6d65789e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetPropertiesTests.java @@ -14,15 +14,15 @@ public final class TableGetPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableGetProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"kbr\",\"_ts\":69.84359,\"_etag\":\"l\",\"id\":\"ukkutvl\",\"restoreParameters\":{\"restoreSource\":\"pqhvmblcouqehbhb\",\"restoreTimestampInUtc\":\"2021-08-15T10:10:07Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":658833709,\"autoscaleSettings\":{\"maxThroughput\":1186687273}}}") + "{\"resource\":{\"_rid\":\"udqll\",\"_ts\":43.651176,\"_etag\":\"zp\",\"id\":\"lxeehuxiq\",\"restoreParameters\":{\"restoreSource\":\"raymezx\",\"restoreTimestampInUtc\":\"2021-07-22T12:24:12Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"},\"options\":{\"throughput\":1114789403,\"autoscaleSettings\":{\"maxThroughput\":448994705}}}") .toObject(TableGetProperties.class); - Assertions.assertEquals("ukkutvl", model.resource().id()); - Assertions.assertEquals("pqhvmblcouqehbhb", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-15T10:10:07Z"), + Assertions.assertEquals("lxeehuxiq", model.resource().id()); + Assertions.assertEquals("raymezx", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-22T12:24:12Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); - Assertions.assertEquals(658833709, model.options().throughput()); - Assertions.assertEquals(1186687273, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); + Assertions.assertEquals(1114789403, model.options().throughput()); + Assertions.assertEquals(448994705, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetResultsInnerTests.java index 1aa0e8f40b38..f94d29e31bab 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetResultsInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableGetResultsInnerTests.java @@ -15,18 +15,18 @@ public final class TableGetResultsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableGetResultsInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"oeoq\",\"_ts\":89.666664,\"_etag\":\"vefgwbmqjchntas\",\"id\":\"ay\",\"restoreParameters\":{\"restoreSource\":\"ulpzealb\",\"restoreTimestampInUtc\":\"2021-03-15T17:18:54Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":1419393058,\"autoscaleSettings\":{\"maxThroughput\":1939476525}}},\"location\":\"suah\",\"tags\":{\"biwsd\":\"xjcmmzrrsc\"},\"identity\":{\"principalId\":\"xqw\",\"tenantId\":\"iffjxcjrm\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"foyzbamwineof\":{\"principalId\":\"bv\",\"clientId\":\"gjonmcy\"},\"boclzhzjknyuxgv\":{\"principalId\":\"kak\",\"clientId\":\"ldtve\"}}},\"id\":\"xpn\",\"name\":\"upzaamrdixtre\",\"type\":\"ids\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"yzjdnrqjbt\",\"_ts\":71.58526,\"_etag\":\"oqa\",\"id\":\"bzgyhfwwvuatbw\",\"restoreParameters\":{\"restoreSource\":\"mteuliyslp\",\"restoreTimestampInUtc\":\"2021-01-10T15:58:56Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"},\"options\":{\"throughput\":476641770,\"autoscaleSettings\":{\"maxThroughput\":601850943}}},\"location\":\"wbormcqmi\",\"tags\":{\"xjmcsmyqwixvcpw\":\"jqpkzfbo\",\"duoiqt\":\"kwywzwofalic\",\"vsknxrwzawnv\":\"mt\",\"ycvdimw\":\"bcfhzagxnv\"},\"identity\":{\"principalId\":\"e\",\"tenantId\":\"gy\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"osxw\":{\"principalId\":\"pweryekzk\",\"clientId\":\"meottawj\"}}},\"id\":\"nhjtf\",\"name\":\"p\",\"type\":\"dpmiljpn\"}") .toObject(TableGetResultsInner.class); - Assertions.assertEquals("suah", model.location()); - Assertions.assertEquals("xjcmmzrrsc", model.tags().get("biwsd")); + Assertions.assertEquals("wbormcqmi", model.location()); + Assertions.assertEquals("jqpkzfbo", model.tags().get("xjmcsmyqwixvcpw")); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("ay", model.resource().id()); - Assertions.assertEquals("ulpzealb", model.resource().restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T17:18:54Z"), + Assertions.assertEquals("bzgyhfwwvuatbw", model.resource().id()); + Assertions.assertEquals("mteuliyslp", model.resource().restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-10T15:58:56Z"), model.resource().restoreParameters().restoreTimestampInUtc()); Assertions.assertFalse(model.resource().restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.DEFAULT, model.resource().createMode()); - Assertions.assertEquals(1419393058, model.options().throughput()); - Assertions.assertEquals(1939476525, model.options().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(CreateMode.RESTORE, model.resource().createMode()); + Assertions.assertEquals(476641770, model.options().throughput()); + Assertions.assertEquals(601850943, model.options().autoscaleSettings().maxThroughput()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableListResultTests.java index 18877cc32a13..d9b98f8971d4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableListResultTests.java @@ -12,8 +12,8 @@ public final class TableListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"zralcxpjbyyps\",\"_ts\":55.48249,\"_etag\":\"jenkyh\",\"id\":\"qzvs\",\"restoreParameters\":{\"restoreSource\":\"xj\",\"restoreTimestampInUtc\":\"2021-06-12T18:10:21Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":213001563,\"autoscaleSettings\":{\"maxThroughput\":1956305014}}},\"location\":\"uwyvcacoyvi\",\"tags\":{\"szlbscm\":\"izus\"},\"identity\":{\"principalId\":\"ijiufehgmvfln\",\"tenantId\":\"v\",\"type\":\"None\",\"userAssignedIdentities\":{\"jtcdxabbujftaben\":{\"principalId\":\"lniylylyfwxz\",\"clientId\":\"gqztwhghmupgx\"},\"nlzafwxudgnh\":{\"principalId\":\"klqpx\",\"clientId\":\"cafeddw\"},\"uclvdjj\":{\"principalId\":\"okrtalvnb\",\"clientId\":\"pbeme\"}}},\"id\":\"yrdnqod\",\"name\":\"ahhxhqfaqnvzoqg\",\"type\":\"ipemchgavscz\"},{\"properties\":{\"resource\":{\"_rid\":\"txptlghw\",\"_ts\":22.819323,\"_etag\":\"ewj\",\"id\":\"s\",\"restoreParameters\":{\"restoreSource\":\"uhqawmoaianc\",\"restoreTimestampInUtc\":\"2021-09-01T14:01:13Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"},\"options\":{\"throughput\":1931817911,\"autoscaleSettings\":{\"maxThroughput\":1245043898}}},\"location\":\"kxrx\",\"tags\":{\"nqkhych\":\"xiwkgfbql\",\"kulehurqlrq\":\"c\",\"rkphyjdxr\":\"fawey\"},\"identity\":{\"principalId\":\"uqd\",\"tenantId\":\"xmrgchbapxkiy\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ioycbl\":{\"principalId\":\"jbuscg\",\"clientId\":\"u\"},\"gsjgkzzlta\":{\"principalId\":\"p\",\"clientId\":\"lujyxkyxl\"},\"dwnapf\":{\"principalId\":\"bzf\",\"clientId\":\"vwmbjlzqsczpg\"},\"qyhleseyq\":{\"principalId\":\"wow\",\"clientId\":\"ptnuwjtkschgc\"}}},\"id\":\"vyeldot\",\"name\":\"v\",\"type\":\"kwiswskukjtas\"},{\"properties\":{\"resource\":{\"_rid\":\"spkxkdt\",\"_ts\":71.16073,\"_etag\":\"dlqvtwknvg\",\"id\":\"mb\",\"restoreParameters\":{\"restoreSource\":\"yw\",\"restoreTimestampInUtc\":\"2021-02-15T15:11:29Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"},\"options\":{\"throughput\":1015275933,\"autoscaleSettings\":{\"maxThroughput\":432652261}}},\"location\":\"eshoygzcb\",\"tags\":{\"faoytehqpuv\":\"x\",\"ndljdjuskbr\":\"mvqmtdwckygroej\",\"kceysfaqegplw\":\"eqy\"},\"identity\":{\"principalId\":\"hwddkvbxgkq\",\"tenantId\":\"ybwptda\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"wenaz\":{\"principalId\":\"f\",\"clientId\":\"ymtpo\"}}},\"id\":\"ohzrsqalsx\",\"name\":\"dnwqapfg\",\"type\":\"dpcve\"},{\"properties\":{\"resource\":{\"_rid\":\"hhkuuip\",\"_ts\":2.2629797,\"_etag\":\"ctekval\",\"id\":\"l\",\"restoreParameters\":{\"restoreSource\":\"qvqyvweht\",\"restoreTimestampInUtc\":\"2021-04-25T17:11:30Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Restore\"},\"options\":{\"throughput\":344678657,\"autoscaleSettings\":{\"maxThroughput\":807850436}}},\"location\":\"ivzrrryveimipsk\",\"tags\":{\"vru\":\"atvfuzkaftj\",\"tgrqgdgkkile\":\"wigsyeipqdsm\",\"orvvmqfloygbdgw\":\"lkcsmknhwtbbae\"},\"identity\":{\"principalId\":\"xdgd\",\"tenantId\":\"abgdexj\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"efh\":{\"principalId\":\"qwotmmwllcol\",\"clientId\":\"sxap\"}}},\"id\":\"cgjokjljnhvlq\",\"name\":\"bekpeeksnbksdqhj\",\"type\":\"yklxe\"}],\"nextLink\":\"khh\"}") + "{\"value\":[{\"properties\":{\"resource\":{\"_rid\":\"wnrdjyibqbnaom\",\"_ts\":30.702627,\"_etag\":\"ku\",\"id\":\"maxljalfihcj\",\"restoreParameters\":{\"restoreSource\":\"cancd\",\"restoreTimestampInUtc\":\"2021-09-11T23:10:37Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Default\"},\"options\":{\"throughput\":638429138,\"autoscaleSettings\":{\"maxThroughput\":867890991}}},\"location\":\"nokzwjjz\",\"tags\":{\"pqsixymmp\":\"ixldzyyfy\",\"mbmslzoyov\":\"jivyqlkjuv\",\"befgvmxn\":\"zdbpqv\",\"bse\":\"kcvtl\"},\"identity\":{\"principalId\":\"cua\",\"tenantId\":\"rhunlp\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"onql\":{\"principalId\":\"ndzfqivjreuyk\",\"clientId\":\"mnwagltbxoe\"},\"crcss\":{\"principalId\":\"wmyymvqdbpbhf\",\"clientId\":\"dve\"}}},\"id\":\"hddubbnqfbl\",\"name\":\"kalehp\",\"type\":\"vawu\"}],\"nextLink\":\"qjtiogqgdm\"}") .toObject(TableListResult.class); - Assertions.assertEquals("khh", model.nextLink()); + Assertions.assertEquals("qjtiogqgdm", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableResourceTests.java index 14a089c990a5..829c2e2408d5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableResourceTests.java @@ -15,29 +15,29 @@ public final class TableResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableResource model = BinaryData.fromString( - "{\"id\":\"nadzyq\",\"restoreParameters\":{\"restoreSource\":\"yi\",\"restoreTimestampInUtc\":\"2021-08-23T03:34:59Z\",\"restoreWithTtlDisabled\":false},\"createMode\":\"Restore\"}") + "{\"id\":\"jogeslabnsmjkwyn\",\"restoreParameters\":{\"restoreSource\":\"ekqsykvwjtqpkev\",\"restoreTimestampInUtc\":\"2021-09-09T16:32:42Z\",\"restoreWithTtlDisabled\":true},\"createMode\":\"Default\"}") .toObject(TableResource.class); - Assertions.assertEquals("nadzyq", model.id()); - Assertions.assertEquals("yi", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-23T03:34:59Z"), + Assertions.assertEquals("jogeslabnsmjkwyn", model.id()); + Assertions.assertEquals("ekqsykvwjtqpkev", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-09T16:32:42Z"), model.restoreParameters().restoreTimestampInUtc()); - Assertions.assertFalse(model.restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.RESTORE, model.createMode()); + Assertions.assertTrue(model.restoreParameters().restoreWithTtlDisabled()); + Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TableResource model = new TableResource().withId("nadzyq") - .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("yi") - .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-08-23T03:34:59Z")) - .withRestoreWithTtlDisabled(false)) - .withCreateMode(CreateMode.RESTORE); + TableResource model = new TableResource().withId("jogeslabnsmjkwyn") + .withRestoreParameters(new ResourceRestoreParameters().withRestoreSource("ekqsykvwjtqpkev") + .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-09-09T16:32:42Z")) + .withRestoreWithTtlDisabled(true)) + .withCreateMode(CreateMode.DEFAULT); model = BinaryData.fromObject(model).toObject(TableResource.class); - Assertions.assertEquals("nadzyq", model.id()); - Assertions.assertEquals("yi", model.restoreParameters().restoreSource()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-23T03:34:59Z"), + Assertions.assertEquals("jogeslabnsmjkwyn", model.id()); + Assertions.assertEquals("ekqsykvwjtqpkev", model.restoreParameters().restoreSource()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-09T16:32:42Z"), model.restoreParameters().restoreTimestampInUtc()); - Assertions.assertFalse(model.restoreParameters().restoreWithTtlDisabled()); - Assertions.assertEquals(CreateMode.RESTORE, model.createMode()); + Assertions.assertTrue(model.restoreParameters().restoreWithTtlDisabled()); + Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleAssignmentListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleAssignmentListResultTests.java index 2dd0c7d3d610..9a12a1c6f0ae 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleAssignmentListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleAssignmentListResultTests.java @@ -12,11 +12,11 @@ public final class TableRoleAssignmentListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableRoleAssignmentListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"roleDefinitionId\":\"pifdfaifyzyzeyu\",\"scope\":\"eidszlfytoi\",\"principalId\":\"gygvfltgvdiho\",\"provisioningState\":\"krxwet\"},\"id\":\"drcyrucpcun\",\"name\":\"uzdqumoenod\",\"type\":\"aienhqhsknd\"},{\"properties\":{\"roleDefinitionId\":\"qkaadlknw\",\"scope\":\"anniyopetxivcnr\",\"principalId\":\"xnucaephblkwqp\",\"provisioningState\":\"vbqsdt\"},\"id\":\"bctvivuzqym\",\"name\":\"uo\",\"type\":\"o\"},{\"properties\":{\"roleDefinitionId\":\"it\",\"scope\":\"hzvb\",\"principalId\":\"cdb\",\"provisioningState\":\"fzndscxmxeatkd\"},\"id\":\"wnrdjyibqbnaom\",\"name\":\"jrmkuhmaxljalf\",\"type\":\"hcjmo\"}],\"nextLink\":\"anc\"}") + "{\"value\":[{\"properties\":{\"roleDefinitionId\":\"xk\",\"scope\":\"cxetyvkunmignoh\",\"principalId\":\"kgqogjw\",\"provisioningState\":\"nd\"},\"id\":\"vabbx\",\"name\":\"hmedeilbjywfcfxz\",\"type\":\"rzzihvwypus\"},{\"properties\":{\"roleDefinitionId\":\"slczwciidjsllf\",\"scope\":\"vdmvxadqa\",\"principalId\":\"rgnawbabgfbk\",\"provisioningState\":\"jmfczlfsyqkf\"},\"id\":\"zgowox\",\"name\":\"mj\",\"type\":\"ajcxnyqgxhl\"}],\"nextLink\":\"rvxisimjceagbj\"}") .toObject(TableRoleAssignmentListResult.class); - Assertions.assertEquals("pifdfaifyzyzeyu", model.value().get(0).roleDefinitionId()); - Assertions.assertEquals("eidszlfytoi", model.value().get(0).scope()); - Assertions.assertEquals("gygvfltgvdiho", model.value().get(0).principalId()); - Assertions.assertEquals("anc", model.nextLink()); + Assertions.assertEquals("xk", model.value().get(0).roleDefinitionId()); + Assertions.assertEquals("cxetyvkunmignoh", model.value().get(0).scope()); + Assertions.assertEquals("kgqogjw", model.value().get(0).principalId()); + Assertions.assertEquals("rvxisimjceagbj", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleAssignmentResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleAssignmentResourceInnerTests.java index ab01729f7fad..8af99d996621 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleAssignmentResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleAssignmentResourceInnerTests.java @@ -12,22 +12,22 @@ public final class TableRoleAssignmentResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableRoleAssignmentResourceInner model = BinaryData.fromString( - "{\"properties\":{\"roleDefinitionId\":\"mevuafpwzy\",\"scope\":\"rkgwltxeqip\",\"principalId\":\"zdyi\",\"provisioningState\":\"fayorpravkjoges\"},\"id\":\"bnsmjkwynqxaek\",\"name\":\"sykvwjtqpke\",\"type\":\"myltj\"}") + "{\"properties\":{\"roleDefinitionId\":\"yngydgrpxncaki\",\"scope\":\"ondjrkclam\",\"principalId\":\"lvlmfej\",\"provisioningState\":\"qey\"},\"id\":\"ltygxhqfgqkayej\",\"name\":\"xtlgflwfg\",\"type\":\"ii\"}") .toObject(TableRoleAssignmentResourceInner.class); - Assertions.assertEquals("mevuafpwzy", model.roleDefinitionId()); - Assertions.assertEquals("rkgwltxeqip", model.scope()); - Assertions.assertEquals("zdyi", model.principalId()); + Assertions.assertEquals("yngydgrpxncaki", model.roleDefinitionId()); + Assertions.assertEquals("ondjrkclam", model.scope()); + Assertions.assertEquals("lvlmfej", model.principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TableRoleAssignmentResourceInner model - = new TableRoleAssignmentResourceInner().withRoleDefinitionId("mevuafpwzy") - .withScope("rkgwltxeqip") - .withPrincipalId("zdyi"); + = new TableRoleAssignmentResourceInner().withRoleDefinitionId("yngydgrpxncaki") + .withScope("ondjrkclam") + .withPrincipalId("lvlmfej"); model = BinaryData.fromObject(model).toObject(TableRoleAssignmentResourceInner.class); - Assertions.assertEquals("mevuafpwzy", model.roleDefinitionId()); - Assertions.assertEquals("rkgwltxeqip", model.scope()); - Assertions.assertEquals("zdyi", model.principalId()); + Assertions.assertEquals("yngydgrpxncaki", model.roleDefinitionId()); + Assertions.assertEquals("ondjrkclam", model.scope()); + Assertions.assertEquals("lvlmfej", model.principalId()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleAssignmentResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleAssignmentResourcePropertiesTests.java index e1bb2e178e54..2285512701c9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleAssignmentResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleAssignmentResourcePropertiesTests.java @@ -12,22 +12,22 @@ public final class TableRoleAssignmentResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableRoleAssignmentResourceProperties model = BinaryData.fromString( - "{\"roleDefinitionId\":\"spxklu\",\"scope\":\"clf\",\"principalId\":\"annnoytzposewx\",\"provisioningState\":\"pxvkqma\"}") + "{\"roleDefinitionId\":\"ijjcea\",\"scope\":\"ijjj\",\"principalId\":\"va\",\"provisioningState\":\"a\"}") .toObject(TableRoleAssignmentResourceProperties.class); - Assertions.assertEquals("spxklu", model.roleDefinitionId()); - Assertions.assertEquals("clf", model.scope()); - Assertions.assertEquals("annnoytzposewx", model.principalId()); + Assertions.assertEquals("ijjcea", model.roleDefinitionId()); + Assertions.assertEquals("ijjj", model.scope()); + Assertions.assertEquals("va", model.principalId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TableRoleAssignmentResourceProperties model - = new TableRoleAssignmentResourceProperties().withRoleDefinitionId("spxklu") - .withScope("clf") - .withPrincipalId("annnoytzposewx"); + = new TableRoleAssignmentResourceProperties().withRoleDefinitionId("ijjcea") + .withScope("ijjj") + .withPrincipalId("va"); model = BinaryData.fromObject(model).toObject(TableRoleAssignmentResourceProperties.class); - Assertions.assertEquals("spxklu", model.roleDefinitionId()); - Assertions.assertEquals("clf", model.scope()); - Assertions.assertEquals("annnoytzposewx", model.principalId()); + Assertions.assertEquals("ijjcea", model.roleDefinitionId()); + Assertions.assertEquals("ijjj", model.scope()); + Assertions.assertEquals("va", model.principalId()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleDefinitionListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleDefinitionListResultTests.java index be4a18c24100..6ba6aa017dbc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleDefinitionListResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleDefinitionListResultTests.java @@ -13,15 +13,15 @@ public final class TableRoleDefinitionListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableRoleDefinitionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"id\":\"ecjujcng\",\"roleName\":\"dyedmzrgjfo\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"oitpkpztrgdgx\",\"coqra\",\"wugyx\"],\"permissions\":[{\"id\":\"we\",\"dataActions\":[\"wvskbuhzacaqtylt\"],\"notDataActions\":[\"cujp\",\"sxzakuejkm\"]},{\"id\":\"iztjof\",\"dataActions\":[\"ovjufycsjmlbe\",\"yeji\",\"iuxegth\",\"rtudawlpjfel\"],\"notDataActions\":[\"pptcbgqnzmnhii\",\"ialwc\",\"gckbb\",\"ccgzpraoxnyu\"]},{\"id\":\"a\",\"dataActions\":[\"ftipwcxbyubhiq\",\"xyur\"],\"notDataActions\":[\"uhzafccnuhii\",\"byl\",\"ui\"]},{\"id\":\"xvatvcr\",\"dataActions\":[\"b\"],\"notDataActions\":[\"xvhcs\",\"hzlwxaea\",\"vurex\",\"ndsbdw\"]}]},\"id\":\"derzmwnto\",\"name\":\"agttm\",\"type\":\"mmagoaqylkjzt\"},{\"properties\":{\"id\":\"azjcgmxitpfin\",\"roleName\":\"pdltkrlg\",\"type\":\"CustomRole\",\"assignableScopes\":[\"rvcqguefzhomphe\",\"durelyujl\",\"youmpc\"],\"permissions\":[{\"id\":\"lcdi\",\"dataActions\":[\"ajbrzmqxucy\",\"ijo\"],\"notDataActions\":[\"iutgj\",\"yzyzjd\",\"r\"]},{\"id\":\"btxjeaoqaqbzg\",\"dataActions\":[\"w\",\"v\",\"atbwbqam\",\"e\"],\"notDataActions\":[\"yslpkcvmw\",\"auxxepmyw\",\"ormcqmic\",\"ijqpkzfbojxjmcs\"]},{\"id\":\"qwixvcpwnk\",\"dataActions\":[\"zwofalick\",\"uoiqt\",\"mt\",\"vsknxrwzawnv\"],\"notDataActions\":[\"fhzag\",\"nvhycvdimwrz\",\"e\",\"zgyufutrwp\"]},{\"id\":\"ryekzkd\",\"dataActions\":[\"ottaw\",\"yos\"],\"notDataActions\":[\"hnhjtfvpndpmi\",\"jpnwynudql\"]}]},\"id\":\"sauzpjlx\",\"name\":\"ehuxiqhzlraym\",\"type\":\"zxlskihmxr\"}],\"nextLink\":\"sajrednwyysht\"}") + "{\"value\":[{\"properties\":{\"id\":\"llywpvtiotzbp\",\"roleName\":\"ollgry\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"sigrowsocnequygd\",\"bo\",\"grmtqjk\"],\"permissions\":[{\"id\":\"drmmwiuawvcmjz\",\"dataActions\":[\"idisczskosw\",\"qiqazugamxzkr\",\"coiisbamnppcce\",\"u\"],\"notDataActions\":[\"sbezaxyfukzxuizh\",\"hnepkpeti\",\"rx\"]},{\"id\":\"ubxdukecpxdazvdh\",\"dataActions\":[\"mkoszudbl\",\"s\",\"trpc\"],\"notDataActions\":[\"iofkbtfmh\",\"lbnld\"]}]},\"id\":\"cbhhez\",\"name\":\"quwusq\",\"type\":\"utrpbr\"},{\"properties\":{\"id\":\"uuatvlmbjwcol\",\"roleName\":\"x\",\"type\":\"CustomRole\",\"assignableScopes\":[\"pcpahprzrvxhmtf\"],\"permissions\":[{\"id\":\"xzcmjhngxno\",\"dataActions\":[\"tdisnjevhdlmyd\",\"dwhepfwwtjfdoes\",\"xhmw\"],\"notDataActions\":[\"ck\",\"oikxkxhnegk\",\"jzrbhtmeplv\"]},{\"id\":\"aobrlbp\",\"dataActions\":[\"bagn\",\"hjhgem\"],\"notDataActions\":[\"akywalhjymxcgqta\",\"drclssoljome\",\"tfy\",\"nlbvgjcodkk\"]}]},\"id\":\"iiy\",\"name\":\"s\",\"type\":\"ikizbcu\"},{\"properties\":{\"id\":\"vntnrgmqso\",\"roleName\":\"cekxgnly\",\"type\":\"CustomRole\",\"assignableScopes\":[\"wzvmdoksqd\",\"iw\",\"wxlboncqbazqicq\",\"hygtv\"],\"permissions\":[{\"id\":\"anepubd\",\"dataActions\":[\"yqvgxia\",\"detv\"],\"notDataActions\":[\"xdxuwsaifmc\",\"nosbz\",\"ehgcvkbcknjo\",\"gjyy\"]},{\"id\":\"velsz\",\"dataActions\":[\"zevxoqein\",\"xwaljgl\",\"o\"],\"notDataActions\":[\"waafrqulh\",\"zyqbhd\",\"afjrqpjiyrqjcrg\"]},{\"id\":\"wmzwdfkbnrzorpdl\",\"dataActions\":[\"ctqjfgxxsae\",\"gzdgvpyigda\"],\"notDataActions\":[\"lzdcduwjoedxng\",\"caifpaurww\",\"ilfjqqacdmk\"]}]},\"id\":\"xdcvjwcy\",\"name\":\"iakeciqc\",\"type\":\"xrtuicds\"}],\"nextLink\":\"dfmmpzhzzwvy\"}") .toObject(TableRoleDefinitionListResult.class); - Assertions.assertEquals("ecjujcng", model.value().get(0).idPropertiesId()); - Assertions.assertEquals("dyedmzrgjfo", model.value().get(0).roleName()); + Assertions.assertEquals("llywpvtiotzbp", model.value().get(0).idPropertiesId()); + Assertions.assertEquals("ollgry", model.value().get(0).roleName()); Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.value().get(0).typePropertiesType()); - Assertions.assertEquals("oitpkpztrgdgx", model.value().get(0).assignableScopes().get(0)); - Assertions.assertEquals("we", model.value().get(0).permissions().get(0).id()); - Assertions.assertEquals("wvskbuhzacaqtylt", model.value().get(0).permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("cujp", model.value().get(0).permissions().get(0).notDataActions().get(0)); - Assertions.assertEquals("sajrednwyysht", model.nextLink()); + Assertions.assertEquals("sigrowsocnequygd", model.value().get(0).assignableScopes().get(0)); + Assertions.assertEquals("drmmwiuawvcmjz", model.value().get(0).permissions().get(0).id()); + Assertions.assertEquals("idisczskosw", model.value().get(0).permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("sbezaxyfukzxuizh", model.value().get(0).permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("dfmmpzhzzwvy", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleDefinitionResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleDefinitionResourceInnerTests.java index 4ce4a4fc8dd5..c5b8bf35038b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleDefinitionResourceInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleDefinitionResourceInnerTests.java @@ -15,43 +15,37 @@ public final class TableRoleDefinitionResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableRoleDefinitionResourceInner model = BinaryData.fromString( - "{\"properties\":{\"id\":\"cpoq\",\"roleName\":\"vnwqjwgo\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"jj\",\"xybwfdbkjbzten\",\"vkzykjtjknsxf\"],\"permissions\":[{\"id\":\"cdp\",\"dataActions\":[\"nq\"],\"notDataActions\":[\"jfbp\",\"uwxeoiojfizf\",\"vkjzwfbcyaykm\"]},{\"id\":\"zs\",\"dataActions\":[\"xrzxmdewsrsxkrp\",\"bjazejwwviy\",\"y\",\"suhbrnn\"],\"notDataActions\":[\"sqwjhqkbiwetpozy\"]},{\"id\":\"qiqyhgfsetzlexbs\",\"dataActions\":[\"dynojpziuwfb\"],\"notDataActions\":[\"dtn\",\"qsyclj\",\"elpkpbafvafhlbyl\"]},{\"id\":\"bevxrhyzd\",\"dataActions\":[\"sofpltd\",\"mairrh\",\"hfnrac\",\"npq\"],\"notDataActions\":[\"uuj\",\"ouhdawsigrb\"]}]},\"id\":\"xsjybvitvqk\",\"name\":\"y\",\"type\":\"znumtggmuwdchoz\"}") + "{\"properties\":{\"id\":\"ctteajohi\",\"roleName\":\"spnbonhpcz\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"p\"],\"permissions\":[{\"id\":\"csehchkhufm\",\"dataActions\":[\"mqyjgy\"],\"notDataActions\":[\"lod\",\"aeuzanh\",\"fnhsenwphp\",\"fngq\"]},{\"id\":\"lidftujwjj\",\"dataActions\":[\"beqrkuorh\",\"ssruqnmdvhazcvj\",\"tiq\"],\"notDataActions\":[\"qer\",\"w\"]}]},\"id\":\"ytxtdgu\",\"name\":\"vlbpktgdstyou\",\"type\":\"mbewreswmo\"}") .toObject(TableRoleDefinitionResourceInner.class); - Assertions.assertEquals("cpoq", model.idPropertiesId()); - Assertions.assertEquals("vnwqjwgo", model.roleName()); + Assertions.assertEquals("ctteajohi", model.idPropertiesId()); + Assertions.assertEquals("spnbonhpcz", model.roleName()); Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.typePropertiesType()); - Assertions.assertEquals("jj", model.assignableScopes().get(0)); - Assertions.assertEquals("cdp", model.permissions().get(0).id()); - Assertions.assertEquals("nq", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("jfbp", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("p", model.assignableScopes().get(0)); + Assertions.assertEquals("csehchkhufm", model.permissions().get(0).id()); + Assertions.assertEquals("mqyjgy", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("lod", model.permissions().get(0).notDataActions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TableRoleDefinitionResourceInner model = new TableRoleDefinitionResourceInner().withIdPropertiesId("cpoq") - .withRoleName("vnwqjwgo") + TableRoleDefinitionResourceInner model = new TableRoleDefinitionResourceInner().withIdPropertiesId("ctteajohi") + .withRoleName("spnbonhpcz") .withTypePropertiesType(RoleDefinitionType.BUILT_IN_ROLE) - .withAssignableScopes(Arrays.asList("jj", "xybwfdbkjbzten", "vkzykjtjknsxf")) + .withAssignableScopes(Arrays.asList("p")) .withPermissions(Arrays.asList( - new Permission().withId("cdp") - .withDataActions(Arrays.asList("nq")) - .withNotDataActions(Arrays.asList("jfbp", "uwxeoiojfizf", "vkjzwfbcyaykm")), - new Permission().withId("zs") - .withDataActions(Arrays.asList("xrzxmdewsrsxkrp", "bjazejwwviy", "y", "suhbrnn")) - .withNotDataActions(Arrays.asList("sqwjhqkbiwetpozy")), - new Permission().withId("qiqyhgfsetzlexbs") - .withDataActions(Arrays.asList("dynojpziuwfb")) - .withNotDataActions(Arrays.asList("dtn", "qsyclj", "elpkpbafvafhlbyl")), - new Permission().withId("bevxrhyzd") - .withDataActions(Arrays.asList("sofpltd", "mairrh", "hfnrac", "npq")) - .withNotDataActions(Arrays.asList("uuj", "ouhdawsigrb")))); + new Permission().withId("csehchkhufm") + .withDataActions(Arrays.asList("mqyjgy")) + .withNotDataActions(Arrays.asList("lod", "aeuzanh", "fnhsenwphp", "fngq")), + new Permission().withId("lidftujwjj") + .withDataActions(Arrays.asList("beqrkuorh", "ssruqnmdvhazcvj", "tiq")) + .withNotDataActions(Arrays.asList("qer", "w")))); model = BinaryData.fromObject(model).toObject(TableRoleDefinitionResourceInner.class); - Assertions.assertEquals("cpoq", model.idPropertiesId()); - Assertions.assertEquals("vnwqjwgo", model.roleName()); + Assertions.assertEquals("ctteajohi", model.idPropertiesId()); + Assertions.assertEquals("spnbonhpcz", model.roleName()); Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.typePropertiesType()); - Assertions.assertEquals("jj", model.assignableScopes().get(0)); - Assertions.assertEquals("cdp", model.permissions().get(0).id()); - Assertions.assertEquals("nq", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("jfbp", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("p", model.assignableScopes().get(0)); + Assertions.assertEquals("csehchkhufm", model.permissions().get(0).id()); + Assertions.assertEquals("mqyjgy", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("lod", model.permissions().get(0).notDataActions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleDefinitionResourcePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleDefinitionResourcePropertiesTests.java index 46d086d9445e..1bd3713fd037 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleDefinitionResourcePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/TableRoleDefinitionResourcePropertiesTests.java @@ -15,40 +15,43 @@ public final class TableRoleDefinitionResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableRoleDefinitionResourceProperties model = BinaryData.fromString( - "{\"id\":\"kfexlv\",\"roleName\":\"oakizvoai\",\"type\":\"BuiltInRole\",\"assignableScopes\":[\"nuwiguyxlykwph\",\"xzcwxhmpejt\"],\"permissions\":[{\"id\":\"aonwivkcqhrxh\",\"dataActions\":[\"lccrmmkyupi\",\"ubyqj\"],\"notDataActions\":[\"kfq\",\"rke\",\"yildudxjascow\",\"f\"]},{\"id\":\"kpdxphlk\",\"dataActions\":[\"mgzvyfi\",\"dkz\",\"qnwsithuqolyah\",\"uqwqulsutrjbhxyk\"],\"notDataActions\":[\"qezv\"]},{\"id\":\"ugdrftbc\",\"dataActions\":[\"reuquowtljvf\",\"hreagk\",\"yxvrqtvbczsul\"],\"notDataActions\":[\"glmep\",\"pfseykgs\",\"ngpszngafpg\"]}]}") + "{\"id\":\"gmmuteyxey\",\"roleName\":\"qigijiitnspxlzde\",\"type\":\"CustomRole\",\"assignableScopes\":[\"jwaiuf\",\"n\"],\"permissions\":[{\"id\":\"fueqfrojs\",\"dataActions\":[\"rhydkygywez\",\"kiecafygzm\"],\"notDataActions\":[\"qv\",\"smaklixqcahy\"]},{\"id\":\"alybxawoijpo\",\"dataActions\":[\"lxp\",\"kwjdjodqhy\",\"incnr\",\"mehllizhceu\"],\"notDataActions\":[\"odkadppyibngq\",\"adywrxwhydt\",\"uvvadswzsnu\",\"emlowuowhl\"]},{\"id\":\"nwyrmouv\",\"dataActions\":[\"mo\",\"zkltrfowtdvrfmv\",\"ih\",\"vjdrqcrjidhftuk\"],\"notDataActions\":[\"xlwyoj\",\"fqz\",\"kfnjyixhafrat\"]},{\"id\":\"mbjrou\",\"dataActions\":[\"n\"],\"notDataActions\":[\"qjrhuzgfxonj\"]}]}") .toObject(TableRoleDefinitionResourceProperties.class); - Assertions.assertEquals("kfexlv", model.id()); - Assertions.assertEquals("oakizvoai", model.roleName()); - Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.type()); - Assertions.assertEquals("nuwiguyxlykwph", model.assignableScopes().get(0)); - Assertions.assertEquals("aonwivkcqhrxh", model.permissions().get(0).id()); - Assertions.assertEquals("lccrmmkyupi", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("kfq", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("gmmuteyxey", model.id()); + Assertions.assertEquals("qigijiitnspxlzde", model.roleName()); + Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.type()); + Assertions.assertEquals("jwaiuf", model.assignableScopes().get(0)); + Assertions.assertEquals("fueqfrojs", model.permissions().get(0).id()); + Assertions.assertEquals("rhydkygywez", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("qv", model.permissions().get(0).notDataActions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TableRoleDefinitionResourceProperties model = new TableRoleDefinitionResourceProperties().withId("kfexlv") - .withRoleName("oakizvoai") - .withType(RoleDefinitionType.BUILT_IN_ROLE) - .withAssignableScopes(Arrays.asList("nuwiguyxlykwph", "xzcwxhmpejt")) + TableRoleDefinitionResourceProperties model = new TableRoleDefinitionResourceProperties().withId("gmmuteyxey") + .withRoleName("qigijiitnspxlzde") + .withType(RoleDefinitionType.CUSTOM_ROLE) + .withAssignableScopes(Arrays.asList("jwaiuf", "n")) .withPermissions(Arrays.asList( - new Permission().withId("aonwivkcqhrxh") - .withDataActions(Arrays.asList("lccrmmkyupi", "ubyqj")) - .withNotDataActions(Arrays.asList("kfq", "rke", "yildudxjascow", "f")), - new Permission().withId("kpdxphlk") - .withDataActions(Arrays.asList("mgzvyfi", "dkz", "qnwsithuqolyah", "uqwqulsutrjbhxyk")) - .withNotDataActions(Arrays.asList("qezv")), - new Permission().withId("ugdrftbc") - .withDataActions(Arrays.asList("reuquowtljvf", "hreagk", "yxvrqtvbczsul")) - .withNotDataActions(Arrays.asList("glmep", "pfseykgs", "ngpszngafpg")))); + new Permission().withId("fueqfrojs") + .withDataActions(Arrays.asList("rhydkygywez", "kiecafygzm")) + .withNotDataActions(Arrays.asList("qv", "smaklixqcahy")), + new Permission().withId("alybxawoijpo") + .withDataActions(Arrays.asList("lxp", "kwjdjodqhy", "incnr", "mehllizhceu")) + .withNotDataActions(Arrays.asList("odkadppyibngq", "adywrxwhydt", "uvvadswzsnu", "emlowuowhl")), + new Permission().withId("nwyrmouv") + .withDataActions(Arrays.asList("mo", "zkltrfowtdvrfmv", "ih", "vjdrqcrjidhftuk")) + .withNotDataActions(Arrays.asList("xlwyoj", "fqz", "kfnjyixhafrat")), + new Permission().withId("mbjrou") + .withDataActions(Arrays.asList("n")) + .withNotDataActions(Arrays.asList("qjrhuzgfxonj")))); model = BinaryData.fromObject(model).toObject(TableRoleDefinitionResourceProperties.class); - Assertions.assertEquals("kfexlv", model.id()); - Assertions.assertEquals("oakizvoai", model.roleName()); - Assertions.assertEquals(RoleDefinitionType.BUILT_IN_ROLE, model.type()); - Assertions.assertEquals("nuwiguyxlykwph", model.assignableScopes().get(0)); - Assertions.assertEquals("aonwivkcqhrxh", model.permissions().get(0).id()); - Assertions.assertEquals("lccrmmkyupi", model.permissions().get(0).dataActions().get(0)); - Assertions.assertEquals("kfq", model.permissions().get(0).notDataActions().get(0)); + Assertions.assertEquals("gmmuteyxey", model.id()); + Assertions.assertEquals("qigijiitnspxlzde", model.roleName()); + Assertions.assertEquals(RoleDefinitionType.CUSTOM_ROLE, model.type()); + Assertions.assertEquals("jwaiuf", model.assignableScopes().get(0)); + Assertions.assertEquals("fueqfrojs", model.permissions().get(0).id()); + Assertions.assertEquals("rhydkygywez", model.permissions().get(0).dataActions().get(0)); + Assertions.assertEquals("qv", model.permissions().get(0).notDataActions().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputBucketResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputBucketResourceTests.java new file mode 100644 index 000000000000..18f9000901a3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputBucketResourceTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.ThroughputBucketResource; +import org.junit.jupiter.api.Assertions; + +public final class ThroughputBucketResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThroughputBucketResource model = BinaryData + .fromString("{\"id\":1607001985,\"maxThroughputPercentage\":1011910594,\"isDefaultBucket\":false}") + .toObject(ThroughputBucketResource.class); + Assertions.assertEquals(1607001985, model.id()); + Assertions.assertEquals(1011910594, model.maxThroughputPercentage()); + Assertions.assertFalse(model.isDefaultBucket()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ThroughputBucketResource model = new ThroughputBucketResource().withId(1607001985) + .withMaxThroughputPercentage(1011910594) + .withIsDefaultBucket(false); + model = BinaryData.fromObject(model).toObject(ThroughputBucketResource.class); + Assertions.assertEquals(1607001985, model.id()); + Assertions.assertEquals(1011910594, model.maxThroughputPercentage()); + Assertions.assertFalse(model.isDefaultBucket()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPolicyResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPolicyResourceTests.java index d95b5eb89f78..139279bf124d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPolicyResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPolicyResourceTests.java @@ -11,18 +11,18 @@ public final class ThroughputPolicyResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ThroughputPolicyResource model = BinaryData.fromString("{\"isEnabled\":false,\"incrementPercent\":826622083}") + ThroughputPolicyResource model = BinaryData.fromString("{\"isEnabled\":false,\"incrementPercent\":1956413749}") .toObject(ThroughputPolicyResource.class); Assertions.assertFalse(model.isEnabled()); - Assertions.assertEquals(826622083, model.incrementPercent()); + Assertions.assertEquals(1956413749, model.incrementPercent()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ThroughputPolicyResource model - = new ThroughputPolicyResource().withIsEnabled(false).withIncrementPercent(826622083); + = new ThroughputPolicyResource().withIsEnabled(false).withIncrementPercent(1956413749); model = BinaryData.fromObject(model).toObject(ThroughputPolicyResource.class); Assertions.assertFalse(model.isEnabled()); - Assertions.assertEquals(826622083, model.incrementPercent()); + Assertions.assertEquals(1956413749, model.incrementPercent()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountPropertiesTests.java new file mode 100644 index 000000000000..0110ccd6ef50 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountPropertiesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolAccountProperties; +import org.junit.jupiter.api.Assertions; + +public final class ThroughputPoolAccountPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThroughputPoolAccountProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Initializing\",\"accountResourceIdentifier\":\"qcdol\",\"accountLocation\":\"gu\",\"accountInstanceId\":\"jlbsmndafbncuyj\"}") + .toObject(ThroughputPoolAccountProperties.class); + Assertions.assertEquals("qcdol", model.accountResourceIdentifier()); + Assertions.assertEquals("gu", model.accountLocation()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ThroughputPoolAccountProperties model + = new ThroughputPoolAccountProperties().withAccountResourceIdentifier("qcdol").withAccountLocation("gu"); + model = BinaryData.fromObject(model).toObject(ThroughputPoolAccountProperties.class); + Assertions.assertEquals("qcdol", model.accountResourceIdentifier()); + Assertions.assertEquals("gu", model.accountLocation()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountResourceInnerTests.java new file mode 100644 index 000000000000..cfd6aab01477 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountResourceInnerTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolAccountResourceInner; +import org.junit.jupiter.api.Assertions; + +public final class ThroughputPoolAccountResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThroughputPoolAccountResourceInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Online\",\"accountResourceIdentifier\":\"kmibuydwi\",\"accountLocation\":\"nicupdyt\",\"accountInstanceId\":\"miuvjplosebmhhtu\"},\"id\":\"txynoflqobfixngx\",\"name\":\"bihex\",\"type\":\"nk\"}") + .toObject(ThroughputPoolAccountResourceInner.class); + Assertions.assertEquals("kmibuydwi", model.accountResourceIdentifier()); + Assertions.assertEquals("nicupdyt", model.accountLocation()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ThroughputPoolAccountResourceInner model + = new ThroughputPoolAccountResourceInner().withAccountResourceIdentifier("kmibuydwi") + .withAccountLocation("nicupdyt"); + model = BinaryData.fromObject(model).toObject(ThroughputPoolAccountResourceInner.class); + Assertions.assertEquals("kmibuydwi", model.accountResourceIdentifier()); + Assertions.assertEquals("nicupdyt", model.accountLocation()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountsListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountsListResultTests.java new file mode 100644 index 000000000000..f549662b13d1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolAccountsListResultTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.implementation.models.ThroughputPoolAccountsListResult; +import org.junit.jupiter.api.Assertions; + +public final class ThroughputPoolAccountsListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThroughputPoolAccountsListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"accountResourceIdentifier\":\"pp\",\"accountLocation\":\"hcf\",\"accountInstanceId\":\"jziuucrlnewnuwk\"},\"id\":\"zzetlvhdy\",\"name\":\"zlvwyw\",\"type\":\"v\"},{\"properties\":{\"provisioningState\":\"InternallyReady\",\"accountResourceIdentifier\":\"wwlz\",\"accountLocation\":\"darcb\",\"accountInstanceId\":\"whslxebaja\"},\"id\":\"n\",\"name\":\"stbdoprwkampyh\",\"type\":\"pbldz\"},{\"properties\":{\"provisioningState\":\"Failed\",\"accountResourceIdentifier\":\"cyc\",\"accountLocation\":\"huzymhlhihqk\",\"accountInstanceId\":\"vkmnbzkopaiil\"},\"id\":\"pudkhqux\",\"name\":\"yjofpgvedrobujnj\",\"type\":\"y\"}],\"nextLink\":\"xmqxigidullnjgc\"}") + .toObject(ThroughputPoolAccountsListResult.class); + Assertions.assertEquals("pp", model.value().get(0).accountResourceIdentifier()); + Assertions.assertEquals("hcf", model.value().get(0).accountLocation()); + Assertions.assertEquals("xmqxigidullnjgc", model.nextLink()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolPropertiesTests.java new file mode 100644 index 000000000000..27473840a809 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolPropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolProperties; +import com.azure.resourcemanager.cosmos.models.Status; +import org.junit.jupiter.api.Assertions; + +public final class ThroughputPoolPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThroughputPoolProperties model + = BinaryData.fromString("{\"provisioningState\":\"Creating\",\"maxThroughput\":1781127465}") + .toObject(ThroughputPoolProperties.class); + Assertions.assertEquals(Status.CREATING, model.provisioningState()); + Assertions.assertEquals(1781127465, model.maxThroughput()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ThroughputPoolProperties model + = new ThroughputPoolProperties().withProvisioningState(Status.CREATING).withMaxThroughput(1781127465); + model = BinaryData.fromObject(model).toObject(ThroughputPoolProperties.class); + Assertions.assertEquals(Status.CREATING, model.provisioningState()); + Assertions.assertEquals(1781127465, model.maxThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolResourceInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolResourceInnerTests.java new file mode 100644 index 000000000000..88b443d26de4 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolResourceInnerTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolResourceInner; +import com.azure.resourcemanager.cosmos.models.Status; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ThroughputPoolResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThroughputPoolResourceInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Uninitialized\",\"maxThroughput\":1244333878},\"location\":\"mtistyikjh\",\"tags\":{\"xwtdmbqjtsuhqh\":\"xkpypkennycntrq\",\"qmzxsyaks\":\"oxtdyqavfx\"},\"id\":\"npaami\",\"name\":\"wb\",\"type\":\"hvwt\"}") + .toObject(ThroughputPoolResourceInner.class); + Assertions.assertEquals("mtistyikjh", model.location()); + Assertions.assertEquals("xkpypkennycntrq", model.tags().get("xwtdmbqjtsuhqh")); + Assertions.assertEquals(Status.UNINITIALIZED, model.provisioningState()); + Assertions.assertEquals(1244333878, model.maxThroughput()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ThroughputPoolResourceInner model = new ThroughputPoolResourceInner().withLocation("mtistyikjh") + .withTags(mapOf("xwtdmbqjtsuhqh", "xkpypkennycntrq", "qmzxsyaks", "oxtdyqavfx")) + .withProvisioningState(Status.UNINITIALIZED) + .withMaxThroughput(1244333878); + model = BinaryData.fromObject(model).toObject(ThroughputPoolResourceInner.class); + Assertions.assertEquals("mtistyikjh", model.location()); + Assertions.assertEquals("xkpypkennycntrq", model.tags().get("xwtdmbqjtsuhqh")); + Assertions.assertEquals(Status.UNINITIALIZED, model.provisioningState()); + Assertions.assertEquals(1244333878, model.maxThroughput()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolUpdateTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolUpdateTests.java new file mode 100644 index 000000000000..42f220124dce --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolUpdateTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.models.Status; +import com.azure.resourcemanager.cosmos.models.ThroughputPoolUpdate; +import org.junit.jupiter.api.Assertions; + +public final class ThroughputPoolUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThroughputPoolUpdate model + = BinaryData.fromString("{\"properties\":{\"provisioningState\":\"Deleting\",\"maxThroughput\":303193293}}") + .toObject(ThroughputPoolUpdate.class); + Assertions.assertEquals(Status.DELETING, model.provisioningState()); + Assertions.assertEquals(303193293, model.maxThroughput()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ThroughputPoolUpdate model + = new ThroughputPoolUpdate().withProvisioningState(Status.DELETING).withMaxThroughput(303193293); + model = BinaryData.fromObject(model).toObject(ThroughputPoolUpdate.class); + Assertions.assertEquals(Status.DELETING, model.provisioningState()); + Assertions.assertEquals(303193293, model.maxThroughput()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolsListResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolsListResultTests.java new file mode 100644 index 000000000000..e8ac09e7b03a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputPoolsListResultTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cosmos.implementation.models.ThroughputPoolsListResult; +import com.azure.resourcemanager.cosmos.models.Status; +import org.junit.jupiter.api.Assertions; + +public final class ThroughputPoolsListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThroughputPoolsListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Online\",\"maxThroughput\":642175945},\"location\":\"sqbjsdj\",\"tags\":{\"znzcbivoveomkhfe\":\"eysgwkcffe\",\"ohimgckyc\":\"cooplf\",\"ebznbznxsulout\":\"p\"},\"id\":\"pbmxooqoh\",\"name\":\"pncdmwkhup\",\"type\":\"hsldqd\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"maxThroughput\":1729881157},\"location\":\"ev\",\"tags\":{\"uynfxkcgsfcmvh\":\"dsytcikswhcam\",\"atvyrkljqkqws\":\"drp\",\"bypnkteiidlbov\":\"jtvjkowggxawwd\"},\"id\":\"bclprgeganihk\",\"name\":\"cnerekyjul\",\"type\":\"kwwnq\"},{\"properties\":{\"provisioningState\":\"Online\",\"maxThroughput\":1379378533},\"location\":\"xtvcebavvbvxwv\",\"tags\":{\"elrjkfzcde\":\"nlrjcsmwevguyfln\",\"hyfkdilbwqlqa\":\"owwe\",\"odnjyhzfaxskdv\":\"sfqbirtybcelfjn\",\"modpe\":\"el\"},\"id\":\"qxsorchaz\",\"name\":\"qoxzyhlbeqvhskb\",\"type\":\"pwxslaj\"}],\"nextLink\":\"fzga\"}") + .toObject(ThroughputPoolsListResult.class); + Assertions.assertEquals("sqbjsdj", model.value().get(0).location()); + Assertions.assertEquals("eysgwkcffe", model.value().get(0).tags().get("znzcbivoveomkhfe")); + Assertions.assertEquals(Status.ONLINE, model.value().get(0).provisioningState()); + Assertions.assertEquals(642175945, model.value().get(0).maxThroughput()); + Assertions.assertEquals("fzga", model.nextLink()); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsGetPropertiesResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsGetPropertiesResourceTests.java index bb4c9b5ee6e7..b6e921b54aac 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsGetPropertiesResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsGetPropertiesResourceTests.java @@ -12,12 +12,15 @@ public final class ThroughputSettingsGetPropertiesResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThroughputSettingsGetPropertiesResource model = BinaryData.fromString( - "{\"_rid\":\"hhahhxvrhmzkwpjg\",\"_ts\":69.94035,\"_etag\":\"ughftqsx\",\"throughput\":2032055045,\"autoscaleSettings\":{\"maxThroughput\":184918697,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":true,\"incrementPercent\":1615725858}},\"targetMaxThroughput\":723225967},\"minimumThroughput\":\"rjguufzdmsyqtf\",\"offerReplacePending\":\"whbotzingamv\",\"instantMaximumThroughput\":\"ho\",\"softAllowedMaximumThroughput\":\"qzudphq\"}") + "{\"_rid\":\"olvtnovqfzge\",\"_ts\":74.87414,\"_etag\":\"tul\",\"throughput\":2130158442,\"autoscaleSettings\":{\"maxThroughput\":997568890,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":true,\"incrementPercent\":1206189386}},\"targetMaxThroughput\":574364549},\"minimumThroughput\":\"o\",\"offerReplacePending\":\"jw\",\"instantMaximumThroughput\":\"wqiok\",\"softAllowedMaximumThroughput\":\"sx\",\"throughputBuckets\":[{\"id\":2132194654,\"maxThroughputPercentage\":322017356,\"isDefaultBucket\":false},{\"id\":1534377343,\"maxThroughputPercentage\":750225964,\"isDefaultBucket\":false}]}") .toObject(ThroughputSettingsGetPropertiesResource.class); - Assertions.assertEquals(2032055045, model.throughput()); - Assertions.assertEquals(184918697, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(2130158442, model.throughput()); + Assertions.assertEquals(997568890, model.autoscaleSettings().maxThroughput()); Assertions.assertTrue(model.autoscaleSettings().autoUpgradePolicy().throughputPolicy().isEnabled()); - Assertions.assertEquals(1615725858, + Assertions.assertEquals(1206189386, model.autoscaleSettings().autoUpgradePolicy().throughputPolicy().incrementPercent()); + Assertions.assertEquals(2132194654, model.throughputBuckets().get(0).id()); + Assertions.assertEquals(322017356, model.throughputBuckets().get(0).maxThroughputPercentage()); + Assertions.assertFalse(model.throughputBuckets().get(0).isDefaultBucket()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsGetPropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsGetPropertiesTests.java index a736c5520443..23368500f4aa 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsGetPropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsGetPropertiesTests.java @@ -12,12 +12,15 @@ public final class ThroughputSettingsGetPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThroughputSettingsGetProperties model = BinaryData.fromString( - "{\"resource\":{\"_rid\":\"bt\",\"_ts\":27.504385,\"_etag\":\"sj\",\"throughput\":2144403306,\"autoscaleSettings\":{\"maxThroughput\":402907816,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":true,\"incrementPercent\":1304960075}},\"targetMaxThroughput\":44629525},\"minimumThroughput\":\"ljagrqmqhl\",\"offerReplacePending\":\"riiiojnalghfkv\",\"instantMaximumThroughput\":\"sexso\",\"softAllowedMaximumThroughput\":\"el\"}}") + "{\"resource\":{\"_rid\":\"lbiw\",\"_ts\":79.40843,\"_etag\":\"cyztsfmznbaeqp\",\"throughput\":1138539224,\"autoscaleSettings\":{\"maxThroughput\":1311384548,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":true,\"incrementPercent\":2099945195}},\"targetMaxThroughput\":1644281123},\"minimumThroughput\":\"rykqgaifmvikl\",\"offerReplacePending\":\"dvk\",\"instantMaximumThroughput\":\"ejd\",\"softAllowedMaximumThroughput\":\"xcv\",\"throughputBuckets\":[{\"id\":1552397999,\"maxThroughputPercentage\":986033506,\"isDefaultBucket\":false}]}}") .toObject(ThroughputSettingsGetProperties.class); - Assertions.assertEquals(2144403306, model.resource().throughput()); - Assertions.assertEquals(402907816, model.resource().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(1138539224, model.resource().throughput()); + Assertions.assertEquals(1311384548, model.resource().autoscaleSettings().maxThroughput()); Assertions.assertTrue(model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().isEnabled()); - Assertions.assertEquals(1304960075, + Assertions.assertEquals(2099945195, model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().incrementPercent()); + Assertions.assertEquals(1552397999, model.resource().throughputBuckets().get(0).id()); + Assertions.assertEquals(986033506, model.resource().throughputBuckets().get(0).maxThroughputPercentage()); + Assertions.assertFalse(model.resource().throughputBuckets().get(0).isDefaultBucket()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsGetResultsInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsGetResultsInnerTests.java index 7b207596204b..a5cbe06867a7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsGetResultsInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsGetResultsInnerTests.java @@ -13,15 +13,18 @@ public final class ThroughputSettingsGetResultsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThroughputSettingsGetResultsInner model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"_rid\":\"owx\",\"_ts\":75.40123,\"_etag\":\"jrkvfgbvfvpdbo\",\"throughput\":2095776205,\"autoscaleSettings\":{\"maxThroughput\":1592823352,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":true,\"incrementPercent\":588632763}},\"targetMaxThroughput\":218475539},\"minimumThroughput\":\"bdeibqipqk\",\"offerReplacePending\":\"vxndz\",\"instantMaximumThroughput\":\"krefajpjo\",\"softAllowedMaximumThroughput\":\"kqnyh\"}},\"location\":\"ij\",\"tags\":{\"bsystawfsdjpvk\":\"vfxzsjab\",\"jxbkzbzkdvn\":\"p\",\"zhjjklffhmouwq\":\"jabudurgkakmo\",\"eeyebi\":\"gzrf\"},\"identity\":{\"principalId\":\"ayuhqlbjbsy\",\"tenantId\":\"qwrvtldgmfp\",\"type\":\"None\",\"userAssignedIdentities\":{\"x\":{\"principalId\":\"as\",\"clientId\":\"haq\"},\"kdw\":{\"principalId\":\"mwutwbdsre\",\"clientId\":\"drhneuyow\"},\"cgpik\":{\"principalId\":\"i\",\"clientId\":\"bi\"},\"vrmbzono\":{\"principalId\":\"imejzanl\",\"clientId\":\"xi\"}}},\"id\":\"xrjqcirgzpfrlazs\",\"name\":\"rnwoiindfp\",\"type\":\"pj\"}") + "{\"properties\":{\"resource\":{\"_rid\":\"awnopqgikyzirtxd\",\"_ts\":0.34202933,\"_etag\":\"ejnt\",\"throughput\":1656228092,\"autoscaleSettings\":{\"maxThroughput\":1675293509,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":false,\"incrementPercent\":936029412}},\"targetMaxThroughput\":1776914172},\"minimumThroughput\":\"dxtqmieoxo\",\"offerReplacePending\":\"gufhyaomtbg\",\"instantMaximumThroughput\":\"avgrvkffovjz\",\"softAllowedMaximumThroughput\":\"jbibg\",\"throughputBuckets\":[{\"id\":938334267,\"maxThroughputPercentage\":1758314943,\"isDefaultBucket\":true},{\"id\":1616746030,\"maxThroughputPercentage\":832169195,\"isDefaultBucket\":false}]}},\"location\":\"ovwxnbkfezzxsc\",\"tags\":{\"zbomvzzbtdcqvpni\":\"zdgiruj\",\"n\":\"ujviylwdshfs\",\"rymsgaojfmw\":\"bgye\"},\"identity\":{\"principalId\":\"tmr\",\"tenantId\":\"irctymoxoftpipiw\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"dvlmfwdgzxul\":{\"principalId\":\"a\",\"clientId\":\"qjlihhyuspska\"},\"ytxifqjzgxmrh\":{\"principalId\":\"vpa\",\"clientId\":\"sreuzvxurisjnh\"},\"qhih\":{\"principalId\":\"lw\",\"clientId\":\"esutrgjupauutpw\"},\"xjvfoimwksl\":{\"principalId\":\"qg\",\"clientId\":\"pnfqntcyp\"}}},\"id\":\"cizjxvydfceacvl\",\"name\":\"vygdyft\",\"type\":\"mrtwna\"}") .toObject(ThroughputSettingsGetResultsInner.class); - Assertions.assertEquals("ij", model.location()); - Assertions.assertEquals("vfxzsjab", model.tags().get("bsystawfsdjpvk")); - Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals(2095776205, model.resource().throughput()); - Assertions.assertEquals(1592823352, model.resource().autoscaleSettings().maxThroughput()); - Assertions.assertTrue(model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().isEnabled()); - Assertions.assertEquals(588632763, + Assertions.assertEquals("ovwxnbkfezzxsc", model.location()); + Assertions.assertEquals("zdgiruj", model.tags().get("zbomvzzbtdcqvpni")); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals(1656228092, model.resource().throughput()); + Assertions.assertEquals(1675293509, model.resource().autoscaleSettings().maxThroughput()); + Assertions.assertFalse(model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().isEnabled()); + Assertions.assertEquals(936029412, model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().incrementPercent()); + Assertions.assertEquals(938334267, model.resource().throughputBuckets().get(0).id()); + Assertions.assertEquals(1758314943, model.resource().throughputBuckets().get(0).maxThroughputPercentage()); + Assertions.assertTrue(model.resource().throughputBuckets().get(0).isDefaultBucket()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsResourceTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsResourceTests.java index a60d76534ac4..15157f9d0c7b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsResourceTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsResourceTests.java @@ -7,34 +7,45 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cosmos.models.AutoUpgradePolicyResource; import com.azure.resourcemanager.cosmos.models.AutoscaleSettingsResource; +import com.azure.resourcemanager.cosmos.models.ThroughputBucketResource; import com.azure.resourcemanager.cosmos.models.ThroughputPolicyResource; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ThroughputSettingsResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThroughputSettingsResource model = BinaryData.fromString( - "{\"throughput\":1375292829,\"autoscaleSettings\":{\"maxThroughput\":1460544442,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":true,\"incrementPercent\":1190901652}},\"targetMaxThroughput\":1116936670},\"minimumThroughput\":\"vkay\",\"offerReplacePending\":\"tnvyqiatkzwp\",\"instantMaximumThroughput\":\"p\",\"softAllowedMaximumThroughput\":\"cjaesgvvs\"}") + "{\"throughput\":967300246,\"autoscaleSettings\":{\"maxThroughput\":955806064,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":true,\"incrementPercent\":1842771027}},\"targetMaxThroughput\":136056515},\"minimumThroughput\":\"czheyd\",\"offerReplacePending\":\"dshmkxmaehvbbx\",\"instantMaximumThroughput\":\"iplt\",\"softAllowedMaximumThroughput\":\"htba\",\"throughputBuckets\":[{\"id\":854940072,\"maxThroughputPercentage\":1532025762,\"isDefaultBucket\":false}]}") .toObject(ThroughputSettingsResource.class); - Assertions.assertEquals(1375292829, model.throughput()); - Assertions.assertEquals(1460544442, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(967300246, model.throughput()); + Assertions.assertEquals(955806064, model.autoscaleSettings().maxThroughput()); Assertions.assertTrue(model.autoscaleSettings().autoUpgradePolicy().throughputPolicy().isEnabled()); - Assertions.assertEquals(1190901652, + Assertions.assertEquals(1842771027, model.autoscaleSettings().autoUpgradePolicy().throughputPolicy().incrementPercent()); + Assertions.assertEquals(854940072, model.throughputBuckets().get(0).id()); + Assertions.assertEquals(1532025762, model.throughputBuckets().get(0).maxThroughputPercentage()); + Assertions.assertFalse(model.throughputBuckets().get(0).isDefaultBucket()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ThroughputSettingsResource model = new ThroughputSettingsResource().withThroughput(1375292829) - .withAutoscaleSettings(new AutoscaleSettingsResource().withMaxThroughput(1460544442) + ThroughputSettingsResource model = new ThroughputSettingsResource().withThroughput(967300246) + .withAutoscaleSettings(new AutoscaleSettingsResource().withMaxThroughput(955806064) .withAutoUpgradePolicy(new AutoUpgradePolicyResource().withThroughputPolicy( - new ThroughputPolicyResource().withIsEnabled(true).withIncrementPercent(1190901652)))); + new ThroughputPolicyResource().withIsEnabled(true).withIncrementPercent(1842771027)))) + .withThroughputBuckets(Arrays.asList(new ThroughputBucketResource().withId(854940072) + .withMaxThroughputPercentage(1532025762) + .withIsDefaultBucket(false))); model = BinaryData.fromObject(model).toObject(ThroughputSettingsResource.class); - Assertions.assertEquals(1375292829, model.throughput()); - Assertions.assertEquals(1460544442, model.autoscaleSettings().maxThroughput()); + Assertions.assertEquals(967300246, model.throughput()); + Assertions.assertEquals(955806064, model.autoscaleSettings().maxThroughput()); Assertions.assertTrue(model.autoscaleSettings().autoUpgradePolicy().throughputPolicy().isEnabled()); - Assertions.assertEquals(1190901652, + Assertions.assertEquals(1842771027, model.autoscaleSettings().autoUpgradePolicy().throughputPolicy().incrementPercent()); + Assertions.assertEquals(854940072, model.throughputBuckets().get(0).id()); + Assertions.assertEquals(1532025762, model.throughputBuckets().get(0).maxThroughputPercentage()); + Assertions.assertFalse(model.throughputBuckets().get(0).isDefaultBucket()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsUpdateParametersTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsUpdateParametersTests.java index c54412c5a165..3452dfed2a04 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsUpdateParametersTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsUpdateParametersTests.java @@ -10,9 +10,11 @@ import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentityUserAssignedIdentities; import com.azure.resourcemanager.cosmos.models.ResourceIdentityType; +import com.azure.resourcemanager.cosmos.models.ThroughputBucketResource; import com.azure.resourcemanager.cosmos.models.ThroughputPolicyResource; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; @@ -21,39 +23,57 @@ public final class ThroughputSettingsUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThroughputSettingsUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"resource\":{\"throughput\":361846951,\"autoscaleSettings\":{\"maxThroughput\":10642389,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":false,\"incrementPercent\":252265287}},\"targetMaxThroughput\":372421736},\"minimumThroughput\":\"apfcqdpsq\",\"offerReplacePending\":\"vpsvuoymgcce\",\"instantMaximumThroughput\":\"ezrypql\",\"softAllowedMaximumThroughput\":\"eokerqwkyhkobopg\"}},\"id\":\"dkow\",\"name\":\"bqpc\",\"type\":\"kbwcc\",\"location\":\"jvcdwxlpqekf\",\"tags\":{\"fq\":\"htjsying\"},\"identity\":{\"principalId\":\"tdhtmdvyp\",\"tenantId\":\"kdgszywkbirr\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"nrvgoupmfiibfgg\":{\"principalId\":\"kj\",\"clientId\":\"rvqqaatj\"},\"wjygvjayvblmhvk\":{\"principalId\":\"ool\",\"clientId\":\"wxkvtkkgll\"},\"uvwzfbnh\":{\"principalId\":\"hbxvvyhgsopbyrqu\",\"clientId\":\"g\"}}}}") + "{\"properties\":{\"resource\":{\"throughput\":766813389,\"autoscaleSettings\":{\"maxThroughput\":1707092311,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":true,\"incrementPercent\":1268403965}},\"targetMaxThroughput\":864818876},\"minimumThroughput\":\"dxeclzedqbcvh\",\"offerReplacePending\":\"h\",\"instantMaximumThroughput\":\"odqkdlwwqfb\",\"softAllowedMaximumThroughput\":\"lkxt\",\"throughputBuckets\":[{\"id\":1154415906,\"maxThroughputPercentage\":2076050898,\"isDefaultBucket\":true},{\"id\":2109905275,\"maxThroughputPercentage\":539417397,\"isDefaultBucket\":true},{\"id\":2023709214,\"maxThroughputPercentage\":16168895,\"isDefaultBucket\":true},{\"id\":849596082,\"maxThroughputPercentage\":804071808,\"isDefaultBucket\":false}]}},\"id\":\"wcoezbrhub\",\"name\":\"hud\",\"type\":\"oookkqfq\",\"location\":\"vleo\",\"tags\":{\"bar\":\"luiqtqzfavyvnqq\"},\"identity\":{\"principalId\":\"ayjkqa\",\"tenantId\":\"gzslesjcbhernnti\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"buffkmrqemvvhm\":{\"principalId\":\"bquwrbehw\",\"clientId\":\"o\"}}}}") .toObject(ThroughputSettingsUpdateParameters.class); - Assertions.assertEquals("jvcdwxlpqekf", model.location()); - Assertions.assertEquals("htjsying", model.tags().get("fq")); + Assertions.assertEquals("vleo", model.location()); + Assertions.assertEquals("luiqtqzfavyvnqq", model.tags().get("bar")); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals(361846951, model.resource().throughput()); - Assertions.assertEquals(10642389, model.resource().autoscaleSettings().maxThroughput()); - Assertions.assertFalse(model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().isEnabled()); - Assertions.assertEquals(252265287, + Assertions.assertEquals(766813389, model.resource().throughput()); + Assertions.assertEquals(1707092311, model.resource().autoscaleSettings().maxThroughput()); + Assertions.assertTrue(model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().isEnabled()); + Assertions.assertEquals(1268403965, model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().incrementPercent()); + Assertions.assertEquals(1154415906, model.resource().throughputBuckets().get(0).id()); + Assertions.assertEquals(2076050898, model.resource().throughputBuckets().get(0).maxThroughputPercentage()); + Assertions.assertTrue(model.resource().throughputBuckets().get(0).isDefaultBucket()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ThroughputSettingsUpdateParameters model = new ThroughputSettingsUpdateParameters().withLocation("jvcdwxlpqekf") - .withTags(mapOf("fq", "htjsying")) + ThroughputSettingsUpdateParameters model = new ThroughputSettingsUpdateParameters().withLocation("vleo") + .withTags(mapOf("bar", "luiqtqzfavyvnqq")) .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("nrvgoupmfiibfgg", new ManagedServiceIdentityUserAssignedIdentities(), - "wjygvjayvblmhvk", new ManagedServiceIdentityUserAssignedIdentities(), "uvwzfbnh", - new ManagedServiceIdentityUserAssignedIdentities()))) - .withResource(new ThroughputSettingsResource().withThroughput(361846951) - .withAutoscaleSettings(new AutoscaleSettingsResource().withMaxThroughput(10642389) + .withUserAssignedIdentities( + mapOf("buffkmrqemvvhm", new ManagedServiceIdentityUserAssignedIdentities()))) + .withResource(new ThroughputSettingsResource().withThroughput(766813389) + .withAutoscaleSettings(new AutoscaleSettingsResource().withMaxThroughput(1707092311) .withAutoUpgradePolicy(new AutoUpgradePolicyResource().withThroughputPolicy( - new ThroughputPolicyResource().withIsEnabled(false).withIncrementPercent(252265287))))); + new ThroughputPolicyResource().withIsEnabled(true).withIncrementPercent(1268403965)))) + .withThroughputBuckets(Arrays.asList( + new ThroughputBucketResource().withId(1154415906) + .withMaxThroughputPercentage(2076050898) + .withIsDefaultBucket(true), + new ThroughputBucketResource().withId(2109905275) + .withMaxThroughputPercentage(539417397) + .withIsDefaultBucket(true), + new ThroughputBucketResource().withId(2023709214) + .withMaxThroughputPercentage(16168895) + .withIsDefaultBucket(true), + new ThroughputBucketResource().withId(849596082) + .withMaxThroughputPercentage(804071808) + .withIsDefaultBucket(false)))); model = BinaryData.fromObject(model).toObject(ThroughputSettingsUpdateParameters.class); - Assertions.assertEquals("jvcdwxlpqekf", model.location()); - Assertions.assertEquals("htjsying", model.tags().get("fq")); + Assertions.assertEquals("vleo", model.location()); + Assertions.assertEquals("luiqtqzfavyvnqq", model.tags().get("bar")); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals(361846951, model.resource().throughput()); - Assertions.assertEquals(10642389, model.resource().autoscaleSettings().maxThroughput()); - Assertions.assertFalse(model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().isEnabled()); - Assertions.assertEquals(252265287, + Assertions.assertEquals(766813389, model.resource().throughput()); + Assertions.assertEquals(1707092311, model.resource().autoscaleSettings().maxThroughput()); + Assertions.assertTrue(model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().isEnabled()); + Assertions.assertEquals(1268403965, model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().incrementPercent()); + Assertions.assertEquals(1154415906, model.resource().throughputBuckets().get(0).id()); + Assertions.assertEquals(2076050898, model.resource().throughputBuckets().get(0).maxThroughputPercentage()); + Assertions.assertTrue(model.resource().throughputBuckets().get(0).isDefaultBucket()); } // Use "Map.of" if available diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsUpdatePropertiesTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsUpdatePropertiesTests.java index 414aa6b3b1c1..6b872c7801b6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsUpdatePropertiesTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/ThroughputSettingsUpdatePropertiesTests.java @@ -8,35 +8,50 @@ import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsUpdateProperties; import com.azure.resourcemanager.cosmos.models.AutoUpgradePolicyResource; import com.azure.resourcemanager.cosmos.models.AutoscaleSettingsResource; +import com.azure.resourcemanager.cosmos.models.ThroughputBucketResource; import com.azure.resourcemanager.cosmos.models.ThroughputPolicyResource; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ThroughputSettingsUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThroughputSettingsUpdateProperties model = BinaryData.fromString( - "{\"resource\":{\"throughput\":882366629,\"autoscaleSettings\":{\"maxThroughput\":171252991,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":false,\"incrementPercent\":1116199441}},\"targetMaxThroughput\":845127211},\"minimumThroughput\":\"mhrixkwmyijejve\",\"offerReplacePending\":\"hbpnaixexccbd\",\"instantMaximumThroughput\":\"ax\",\"softAllowedMaximumThroughput\":\"exdrrvqahqkg\"}}") + "{\"resource\":{\"throughput\":851546423,\"autoscaleSettings\":{\"maxThroughput\":526256547,\"autoUpgradePolicy\":{\"throughputPolicy\":{\"isEnabled\":false,\"incrementPercent\":344867697}},\"targetMaxThroughput\":441637569},\"minimumThroughput\":\"vewzcj\",\"offerReplacePending\":\"m\",\"instantMaximumThroughput\":\"pmguaadraufac\",\"softAllowedMaximumThroughput\":\"ahzovajjziuxxp\",\"throughputBuckets\":[{\"id\":1820009051,\"maxThroughputPercentage\":196518772,\"isDefaultBucket\":false},{\"id\":693666625,\"maxThroughputPercentage\":662153855,\"isDefaultBucket\":true}]}}") .toObject(ThroughputSettingsUpdateProperties.class); - Assertions.assertEquals(882366629, model.resource().throughput()); - Assertions.assertEquals(171252991, model.resource().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(851546423, model.resource().throughput()); + Assertions.assertEquals(526256547, model.resource().autoscaleSettings().maxThroughput()); Assertions.assertFalse(model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().isEnabled()); - Assertions.assertEquals(1116199441, + Assertions.assertEquals(344867697, model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().incrementPercent()); + Assertions.assertEquals(1820009051, model.resource().throughputBuckets().get(0).id()); + Assertions.assertEquals(196518772, model.resource().throughputBuckets().get(0).maxThroughputPercentage()); + Assertions.assertFalse(model.resource().throughputBuckets().get(0).isDefaultBucket()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ThroughputSettingsUpdateProperties model = new ThroughputSettingsUpdateProperties() - .withResource(new ThroughputSettingsResource().withThroughput(882366629) - .withAutoscaleSettings(new AutoscaleSettingsResource().withMaxThroughput(171252991) + .withResource(new ThroughputSettingsResource().withThroughput(851546423) + .withAutoscaleSettings(new AutoscaleSettingsResource().withMaxThroughput(526256547) .withAutoUpgradePolicy(new AutoUpgradePolicyResource().withThroughputPolicy( - new ThroughputPolicyResource().withIsEnabled(false).withIncrementPercent(1116199441))))); + new ThroughputPolicyResource().withIsEnabled(false).withIncrementPercent(344867697)))) + .withThroughputBuckets(Arrays.asList( + new ThroughputBucketResource().withId(1820009051) + .withMaxThroughputPercentage(196518772) + .withIsDefaultBucket(false), + new ThroughputBucketResource().withId(693666625) + .withMaxThroughputPercentage(662153855) + .withIsDefaultBucket(true)))); model = BinaryData.fromObject(model).toObject(ThroughputSettingsUpdateProperties.class); - Assertions.assertEquals(882366629, model.resource().throughput()); - Assertions.assertEquals(171252991, model.resource().autoscaleSettings().maxThroughput()); + Assertions.assertEquals(851546423, model.resource().throughput()); + Assertions.assertEquals(526256547, model.resource().autoscaleSettings().maxThroughput()); Assertions.assertFalse(model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().isEnabled()); - Assertions.assertEquals(1116199441, + Assertions.assertEquals(344867697, model.resource().autoscaleSettings().autoUpgradePolicy().throughputPolicy().incrementPercent()); + Assertions.assertEquals(1820009051, model.resource().throughputBuckets().get(0).id()); + Assertions.assertEquals(196518772, model.resource().throughputBuckets().get(0).maxThroughputPercentage()); + Assertions.assertFalse(model.resource().throughputBuckets().get(0).isDefaultBucket()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/UniqueKeyTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/UniqueKeyTests.java index 883261fd22bf..ce52d63c89e7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/UniqueKeyTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/UniqueKeyTests.java @@ -12,15 +12,14 @@ public final class UniqueKeyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UniqueKey model - = BinaryData.fromString("{\"paths\":[\"mvmemfnczd\",\"vvbalx\",\"l\",\"chp\"]}").toObject(UniqueKey.class); - Assertions.assertEquals("mvmemfnczd", model.paths().get(0)); + UniqueKey model = BinaryData.fromString("{\"paths\":[\"nxzhcze\",\"rxzbujr\"]}").toObject(UniqueKey.class); + Assertions.assertEquals("nxzhcze", model.paths().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UniqueKey model = new UniqueKey().withPaths(Arrays.asList("mvmemfnczd", "vvbalx", "l", "chp")); + UniqueKey model = new UniqueKey().withPaths(Arrays.asList("nxzhcze", "rxzbujr")); model = BinaryData.fromObject(model).toObject(UniqueKey.class); - Assertions.assertEquals("mvmemfnczd", model.paths().get(0)); + Assertions.assertEquals("nxzhcze", model.paths().get(0)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/UsageInnerTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/UsageInnerTests.java index 74a9d3fd95e4..b921e641bd17 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/UsageInnerTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/UsageInnerTests.java @@ -11,7 +11,7 @@ public final class UsageInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UsageInner model = BinaryData.fromString( - "{\"unit\":\"BytesPerSecond\",\"name\":{\"value\":\"iftohqkvpu\",\"localizedValue\":\"sgplsakn\"},\"quotaPeriod\":\"fsynljphuop\",\"limit\":4359673283515658098,\"currentValue\":3252607462843621148}") + "{\"unit\":\"BytesPerSecond\",\"name\":{\"value\":\"gwq\",\"localizedValue\":\"nedgfbc\"},\"quotaPeriod\":\"cvqvpkeqdcv\",\"limit\":5404644626428061791,\"currentValue\":4054103831441569061}") .toObject(UsageInner.class); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/UsagesResultTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/UsagesResultTests.java index 9f5022e9e8d8..dfde5b91e4bd 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/UsagesResultTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/UsagesResultTests.java @@ -12,8 +12,8 @@ public final class UsagesResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UsagesResult model = BinaryData.fromString( - "{\"value\":[{\"unit\":\"Seconds\",\"name\":{\"value\":\"pichkoymkcdy\",\"localizedValue\":\"pkkpw\"},\"quotaPeriod\":\"eqnovvqfovl\",\"limit\":7527902783356338105,\"currentValue\":7201540616351679717},{\"unit\":\"Seconds\",\"name\":{\"value\":\"ndsytgadg\",\"localizedValue\":\"aeaeneqnzarrw\"},\"quotaPeriod\":\"uu\",\"limit\":4399358999277003826,\"currentValue\":7831439414407354845}],\"nextLink\":\"wiipfpub\"}") + "{\"value\":[{\"unit\":\"Seconds\",\"name\":{\"value\":\"ebmnzbtbhjpglk\",\"localizedValue\":\"ohdneuel\"},\"quotaPeriod\":\"hsd\",\"limit\":250164414285445387,\"currentValue\":960595332999400866},{\"unit\":\"Percent\",\"name\":{\"value\":\"wq\",\"localizedValue\":\"v\"},\"quotaPeriod\":\"xclvit\",\"limit\":6465268745370114488,\"currentValue\":2144640656240762223},{\"unit\":\"Count\",\"name\":{\"value\":\"hcohfwdsjnk\",\"localizedValue\":\"jutiiswacff\"},\"quotaPeriod\":\"k\",\"limit\":2817316502996814580,\"currentValue\":4896642944442173063},{\"unit\":\"CountPerSecond\",\"name\":{\"value\":\"a\",\"localizedValue\":\"vpnpp\"},\"quotaPeriod\":\"flrwd\",\"limit\":8515210692095487331,\"currentValue\":5459273226490403172}],\"nextLink\":\"xsaga\"}") .toObject(UsagesResult.class); - Assertions.assertEquals("wiipfpub", model.nextLink()); + Assertions.assertEquals("xsaga", model.nextLink()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/VectorEmbeddingPolicyTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/VectorEmbeddingPolicyTests.java index d8d168a5688a..d6d42e895447 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/VectorEmbeddingPolicyTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/VectorEmbeddingPolicyTests.java @@ -16,37 +16,37 @@ public final class VectorEmbeddingPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { VectorEmbeddingPolicy model = BinaryData.fromString( - "{\"vectorEmbeddings\":[{\"path\":\"zb\",\"dataType\":\"int8\",\"distanceFunction\":\"dotproduct\",\"dimensions\":1373073585},{\"path\":\"eivsiykzkdnc\",\"dataType\":\"float16\",\"distanceFunction\":\"dotproduct\",\"dimensions\":1690186599},{\"path\":\"nbzoggcu\",\"dataType\":\"int8\",\"distanceFunction\":\"dotproduct\",\"dimensions\":119467014},{\"path\":\"wyrpgogtqxepnyl\",\"dataType\":\"uint8\",\"distanceFunction\":\"dotproduct\",\"dimensions\":1407382097}]}") + "{\"vectorEmbeddings\":[{\"path\":\"dchxgsrboldfor\",\"dataType\":\"float32\",\"distanceFunction\":\"euclidean\",\"dimensions\":1131661980},{\"path\":\"lvizb\",\"dataType\":\"int8\",\"distanceFunction\":\"euclidean\",\"dimensions\":65114282},{\"path\":\"vvacqpb\",\"dataType\":\"uint8\",\"distanceFunction\":\"euclidean\",\"dimensions\":538516969},{\"path\":\"xesz\",\"dataType\":\"float16\",\"distanceFunction\":\"dotproduct\",\"dimensions\":1654037219}]}") .toObject(VectorEmbeddingPolicy.class); - Assertions.assertEquals("zb", model.vectorEmbeddings().get(0).path()); - Assertions.assertEquals(VectorDataType.INT8, model.vectorEmbeddings().get(0).dataType()); - Assertions.assertEquals(DistanceFunction.DOTPRODUCT, model.vectorEmbeddings().get(0).distanceFunction()); - Assertions.assertEquals(1373073585, model.vectorEmbeddings().get(0).dimensions()); + Assertions.assertEquals("dchxgsrboldfor", model.vectorEmbeddings().get(0).path()); + Assertions.assertEquals(VectorDataType.FLOAT32, model.vectorEmbeddings().get(0).dataType()); + Assertions.assertEquals(DistanceFunction.EUCLIDEAN, model.vectorEmbeddings().get(0).distanceFunction()); + Assertions.assertEquals(1131661980, model.vectorEmbeddings().get(0).dimensions()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { VectorEmbeddingPolicy model = new VectorEmbeddingPolicy().withVectorEmbeddings(Arrays.asList( - new VectorEmbedding().withPath("zb") + new VectorEmbedding().withPath("dchxgsrboldfor") + .withDataType(VectorDataType.FLOAT32) + .withDistanceFunction(DistanceFunction.EUCLIDEAN) + .withDimensions(1131661980), + new VectorEmbedding().withPath("lvizb") .withDataType(VectorDataType.INT8) - .withDistanceFunction(DistanceFunction.DOTPRODUCT) - .withDimensions(1373073585), - new VectorEmbedding().withPath("eivsiykzkdnc") - .withDataType(VectorDataType.FLOAT16) - .withDistanceFunction(DistanceFunction.DOTPRODUCT) - .withDimensions(1690186599), - new VectorEmbedding().withPath("nbzoggcu") - .withDataType(VectorDataType.INT8) - .withDistanceFunction(DistanceFunction.DOTPRODUCT) - .withDimensions(119467014), - new VectorEmbedding().withPath("wyrpgogtqxepnyl") + .withDistanceFunction(DistanceFunction.EUCLIDEAN) + .withDimensions(65114282), + new VectorEmbedding().withPath("vvacqpb") .withDataType(VectorDataType.UINT8) + .withDistanceFunction(DistanceFunction.EUCLIDEAN) + .withDimensions(538516969), + new VectorEmbedding().withPath("xesz") + .withDataType(VectorDataType.FLOAT16) .withDistanceFunction(DistanceFunction.DOTPRODUCT) - .withDimensions(1407382097))); + .withDimensions(1654037219))); model = BinaryData.fromObject(model).toObject(VectorEmbeddingPolicy.class); - Assertions.assertEquals("zb", model.vectorEmbeddings().get(0).path()); - Assertions.assertEquals(VectorDataType.INT8, model.vectorEmbeddings().get(0).dataType()); - Assertions.assertEquals(DistanceFunction.DOTPRODUCT, model.vectorEmbeddings().get(0).distanceFunction()); - Assertions.assertEquals(1373073585, model.vectorEmbeddings().get(0).dimensions()); + Assertions.assertEquals("dchxgsrboldfor", model.vectorEmbeddings().get(0).path()); + Assertions.assertEquals(VectorDataType.FLOAT32, model.vectorEmbeddings().get(0).dataType()); + Assertions.assertEquals(DistanceFunction.EUCLIDEAN, model.vectorEmbeddings().get(0).distanceFunction()); + Assertions.assertEquals(1131661980, model.vectorEmbeddings().get(0).dimensions()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/VectorEmbeddingTests.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/VectorEmbeddingTests.java index e8bb5ce0a819..76390c3d1c48 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/VectorEmbeddingTests.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/generated/VectorEmbeddingTests.java @@ -13,25 +13,26 @@ public final class VectorEmbeddingTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - VectorEmbedding model = BinaryData.fromString( - "{\"path\":\"jlyjtlvofq\",\"dataType\":\"int8\",\"distanceFunction\":\"cosine\",\"dimensions\":1407902982}") + VectorEmbedding model = BinaryData + .fromString( + "{\"path\":\"l\",\"dataType\":\"int8\",\"distanceFunction\":\"euclidean\",\"dimensions\":2077442108}") .toObject(VectorEmbedding.class); - Assertions.assertEquals("jlyjtlvofq", model.path()); + Assertions.assertEquals("l", model.path()); Assertions.assertEquals(VectorDataType.INT8, model.dataType()); - Assertions.assertEquals(DistanceFunction.COSINE, model.distanceFunction()); - Assertions.assertEquals(1407902982, model.dimensions()); + Assertions.assertEquals(DistanceFunction.EUCLIDEAN, model.distanceFunction()); + Assertions.assertEquals(2077442108, model.dimensions()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - VectorEmbedding model = new VectorEmbedding().withPath("jlyjtlvofq") + VectorEmbedding model = new VectorEmbedding().withPath("l") .withDataType(VectorDataType.INT8) - .withDistanceFunction(DistanceFunction.COSINE) - .withDimensions(1407902982); + .withDistanceFunction(DistanceFunction.EUCLIDEAN) + .withDimensions(2077442108); model = BinaryData.fromObject(model).toObject(VectorEmbedding.class); - Assertions.assertEquals("jlyjtlvofq", model.path()); + Assertions.assertEquals("l", model.path()); Assertions.assertEquals(VectorDataType.INT8, model.dataType()); - Assertions.assertEquals(DistanceFunction.COSINE, model.distanceFunction()); - Assertions.assertEquals(1407902982, model.dimensions()); + Assertions.assertEquals(DistanceFunction.EUCLIDEAN, model.distanceFunction()); + Assertions.assertEquals(2077442108, model.dimensions()); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/tsp-location.yaml b/sdk/cosmos/azure-resourcemanager-cosmos/tsp-location.yaml index bfbcd21441e3..491733fb4302 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/tsp-location.yaml +++ b/sdk/cosmos/azure-resourcemanager-cosmos/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB -commit: 050576fbe2e66b311b5f72f30de27c0f04c7881d +commit: 9f5271b1ab4f354780443f12755bd097f148f9bc repo: Azure/azure-rest-api-specs additionalDirectories: