From 63e482848e18a58b2ed8d1d6e888dedbfa052c56 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 15 Apr 2025 04:03:00 +0000 Subject: [PATCH] CodeGen from PR 33751 in Azure/azure-rest-api-specs Merge 52db3e7e856ec61a00e0026a957286fbfb87739c into 9db97082212bc1bb0f428681766d69a9e8a7435d --- .../Sample_CassandraClusterCollection.cs | 12 +- .../Sample_CassandraClusterResource.cs | 142 +-- .../Sample_CassandraDataCenterCollection.cs | 10 +- .../Sample_CassandraDataCenterResource.cs | 6 +- .../Sample_CassandraKeyspaceCollection.cs | 10 +- .../Sample_CassandraKeyspaceResource.cs | 6 +- ...sandraKeyspaceThroughputSettingResource.cs | 8 +- .../Sample_CassandraTableCollection.cs | 11 +- .../Samples/Sample_CassandraTableResource.cs | 7 +- ...CassandraTableThroughputSettingResource.cs | 8 +- .../Sample_CosmosDBAccountCollection.cs | 36 +- .../Samples/Sample_CosmosDBAccountResource.cs | 68 +- .../Sample_CosmosDBLocationCollection.cs | 8 +- .../Sample_CosmosDBLocationResource.cs | 2 +- ...osDBPrivateEndpointConnectionCollection.cs | 10 +- ...smosDBPrivateEndpointConnectionResource.cs | 6 +- .../Sample_CosmosDBPrivateLinkResource.cs | 2 +- ...e_CosmosDBPrivateLinkResourceCollection.cs | 8 +- .../Sample_CosmosDBServiceCollection.cs | 34 +- .../Samples/Sample_CosmosDBServiceResource.cs | 24 +- ...osmosDBSqlClientEncryptionKeyCollection.cs | 12 +- ..._CosmosDBSqlClientEncryptionKeyResource.cs | 6 +- .../Sample_CosmosDBSqlContainerCollection.cs | 132 +-- .../Sample_CosmosDBSqlContainerResource.cs | 157 +-- ...DBSqlContainerThroughputSettingResource.cs | 96 +- .../Sample_CosmosDBSqlDatabaseCollection.cs | 59 +- .../Sample_CosmosDBSqlDatabaseResource.cs | 84 +- ...sDBSqlDatabaseThroughputSettingResource.cs | 94 +- ...ple_CosmosDBSqlRoleAssignmentCollection.cs | 10 +- ...ample_CosmosDBSqlRoleAssignmentResource.cs | 6 +- ...ple_CosmosDBSqlRoleDefinitionCollection.cs | 10 +- ...ample_CosmosDBSqlRoleDefinitionResource.cs | 6 +- ...le_CosmosDBSqlStoredProcedureCollection.cs | 10 +- ...mple_CosmosDBSqlStoredProcedureResource.cs | 6 +- .../Sample_CosmosDBSqlTriggerCollection.cs | 10 +- .../Sample_CosmosDBSqlTriggerResource.cs | 6 +- ...osmosDBSqlUserDefinedFunctionCollection.cs | 10 +- ..._CosmosDBSqlUserDefinedFunctionResource.cs | 6 +- .../Samples/Sample_CosmosDBTableCollection.cs | 10 +- .../Samples/Sample_CosmosDBTableResource.cs | 8 +- ...le_CosmosTableThroughputSettingResource.cs | 8 +- .../Sample_GremlinDatabaseCollection.cs | 10 +- .../Samples/Sample_GremlinDatabaseResource.cs | 6 +- ...remlinDatabaseThroughputSettingResource.cs | 8 +- .../Samples/Sample_GremlinGraphCollection.cs | 10 +- .../Samples/Sample_GremlinGraphResource.cs | 8 +- ...e_GremlinGraphThroughputSettingResource.cs | 8 +- .../Sample_MongoDBCollectionCollection.cs | 61 +- .../Sample_MongoDBCollectionResource.cs | 89 +- ...goDBCollectionThroughputSettingResource.cs | 96 +- .../Sample_MongoDBDatabaseCollection.cs | 59 +- .../Samples/Sample_MongoDBDatabaseResource.cs | 84 +- ...ongoDBDatabaseThroughputSettingResource.cs | 94 +- .../Sample_MongoDBRoleDefinitionCollection.cs | 10 +- .../Sample_MongoDBRoleDefinitionResource.cs | 6 +- .../Sample_MongoDBUserDefinitionCollection.cs | 10 +- .../Sample_MongoDBUserDefinitionResource.cs | 6 +- ...ple_RestorableCosmosDBAccountCollection.cs | 8 +- ...ample_RestorableCosmosDBAccountResource.cs | 24 +- .../Sample_SubscriptionResourceExtensions.cs | 37 +- .../Sample_TenantResourceExtensions.cs | 2 +- .../src/Generated/ArmCosmosDBModelFactory.cs | 893 ++------------ .../Generated/CassandraClusterCollection.cs | 20 +- .../src/Generated/CassandraClusterResource.cs | 415 +------ .../CassandraDataCenterCollection.cs | 20 +- .../Generated/CassandraDataCenterResource.cs | 12 +- .../Generated/CassandraKeyspaceCollection.cs | 20 +- .../CassandraKeyspaceData.Serialization.cs | 33 - .../src/Generated/CassandraKeyspaceData.cs | 7 +- .../Generated/CassandraKeyspaceResource.cs | 97 +- ...sandraKeyspaceThroughputSettingResource.cs | 28 +- .../src/Generated/CassandraTableCollection.cs | 20 +- .../CassandraTableData.Serialization.cs | 33 - .../src/Generated/CassandraTableData.cs | 7 +- .../src/Generated/CassandraTableResource.cs | 24 +- ...CassandraTableThroughputSettingResource.cs | 28 +- .../CassandraViewGetResultCollection.cs | 492 -------- ...assandraViewGetResultData.Serialization.cs | 396 ------- .../Generated/CassandraViewGetResultData.cs | 94 -- ...ndraViewGetResultResource.Serialization.cs | 26 - .../CassandraViewGetResultResource.cs | 715 ----------- ...ThroughputSettingResource.Serialization.cs | 26 - .../CassandraViewThroughputSettingResource.cs | 792 ------------- .../Generated/CosmosDBAccountCollection.cs | 20 +- .../CosmosDBAccountData.Serialization.cs | 239 +--- .../src/Generated/CosmosDBAccountData.cs | 76 +- .../src/Generated/CosmosDBAccountResource.cs | 590 ++-------- ...osmosDBChaosFaultResource.Serialization.cs | 26 - .../Generated/CosmosDBChaosFaultResource.cs | 263 ----- .../CosmosDBChaosFaultResourceCollection.cs | 493 -------- ...sDBChaosFaultResourceData.Serialization.cs | 399 ------- .../CosmosDBChaosFaultResourceData.cs | 96 -- .../Generated/CosmosDBLocationCollection.cs | 16 +- .../src/Generated/CosmosDBLocationResource.cs | 8 +- ...osDBPrivateEndpointConnectionCollection.cs | 20 +- ...smosDBPrivateEndpointConnectionResource.cs | 12 +- .../Generated/CosmosDBPrivateLinkResource.cs | 4 +- .../CosmosDBPrivateLinkResourceCollection.cs | 16 +- .../Generated/CosmosDBServiceCollection.cs | 20 +- .../src/Generated/CosmosDBServiceResource.cs | 12 +- ...osmosDBSqlClientEncryptionKeyCollection.cs | 20 +- .../CosmosDBSqlClientEncryptionKeyResource.cs | 8 +- .../CosmosDBSqlContainerCollection.cs | 20 +- .../CosmosDBSqlContainerData.Serialization.cs | 33 - .../src/Generated/CosmosDBSqlContainerData.cs | 7 +- .../Generated/CosmosDBSqlContainerResource.cs | 132 +-- ...DBSqlContainerThroughputSettingResource.cs | 212 +--- .../CosmosDBSqlDatabaseCollection.cs | 20 +- .../CosmosDBSqlDatabaseData.Serialization.cs | 33 - .../src/Generated/CosmosDBSqlDatabaseData.cs | 7 +- .../Generated/CosmosDBSqlDatabaseResource.cs | 212 +--- ...sDBSqlDatabaseThroughputSettingResource.cs | 212 +--- .../CosmosDBSqlRoleAssignmentCollection.cs | 20 +- .../CosmosDBSqlRoleAssignmentResource.cs | 12 +- .../CosmosDBSqlRoleDefinitionCollection.cs | 20 +- .../CosmosDBSqlRoleDefinitionResource.cs | 12 +- .../CosmosDBSqlStoredProcedureCollection.cs | 20 +- ...sDBSqlStoredProcedureData.Serialization.cs | 33 - .../CosmosDBSqlStoredProcedureData.cs | 7 +- .../CosmosDBSqlStoredProcedureResource.cs | 24 +- .../Generated/CosmosDBSqlTriggerCollection.cs | 20 +- .../CosmosDBSqlTriggerData.Serialization.cs | 33 - .../src/Generated/CosmosDBSqlTriggerData.cs | 7 +- .../Generated/CosmosDBSqlTriggerResource.cs | 24 +- ...osmosDBSqlUserDefinedFunctionCollection.cs | 20 +- ...qlUserDefinedFunctionData.Serialization.cs | 33 - .../CosmosDBSqlUserDefinedFunctionData.cs | 7 +- .../CosmosDBSqlUserDefinedFunctionResource.cs | 24 +- .../src/Generated/CosmosDBTableCollection.cs | 20 +- .../CosmosDBTableData.Serialization.cs | 33 - .../src/Generated/CosmosDBTableData.cs | 7 +- .../src/Generated/CosmosDBTableResource.cs | 28 +- .../CosmosDBTableRoleAssignmentCollection.cs | 491 -------- ...DBTableRoleAssignmentData.Serialization.cs | 355 ------ .../CosmosDBTableRoleAssignmentData.cs | 90 -- ...bleRoleAssignmentResource.Serialization.cs | 26 - .../CosmosDBTableRoleAssignmentResource.cs | 347 ------ .../CosmosDBTableRoleDefinitionCollection.cs | 491 -------- ...DBTableRoleDefinitionData.Serialization.cs | 441 ------- .../CosmosDBTableRoleDefinitionData.cs | 98 -- ...bleRoleDefinitionResource.Serialization.cs | 26 - .../CosmosDBTableRoleDefinitionResource.cs | 347 ------ ...CosmosDBThroughputPoolAccountCollection.cs | 498 -------- ...ThroughputPoolAccountData.Serialization.cs | 356 ------ .../CosmosDBThroughputPoolAccountData.cs | 91 -- ...ughputPoolAccountResource.Serialization.cs | 26 - .../CosmosDBThroughputPoolAccountResource.cs | 347 ------ .../CosmosDBThroughputPoolCollection.cs | 499 -------- ...osmosDBThroughputPoolData.Serialization.cs | 363 ------ .../Generated/CosmosDBThroughputPoolData.cs | 89 -- ...sDBThroughputPoolResource.Serialization.cs | 26 - .../CosmosDBThroughputPoolResource.cs | 417 ------- .../CosmosTableThroughputSettingResource.cs | 28 +- .../DataTransferJobGetResultCollection.cs | 498 -------- ...aTransferJobGetResultData.Serialization.cs | 579 --------- .../Generated/DataTransferJobGetResultData.cs | 142 --- ...nsferJobGetResultResource.Serialization.cs | 26 - .../DataTransferJobGetResultResource.cs | 572 --------- .../Extensions/CosmosDBExtensions.cs | 407 +------ .../Extensions/MockableCosmosDBArmClient.cs | 144 +-- .../MockableCosmosDBResourceGroupResource.cs | 77 +- .../MockableCosmosDBSubscriptionResource.cs | 80 +- .../MockableCosmosDBTenantResource.cs | 4 +- .../GraphResourceGetResultCollection.cs | 492 -------- ...raphResourceGetResultData.Serialization.cs | 402 ------- .../Generated/GraphResourceGetResultData.cs | 107 -- ...ResourceGetResultResource.Serialization.cs | 26 - .../GraphResourceGetResultResource.cs | 707 ----------- .../Generated/GremlinDatabaseCollection.cs | 20 +- .../GremlinDatabaseData.Serialization.cs | 33 - .../src/Generated/GremlinDatabaseData.cs | 7 +- .../src/Generated/GremlinDatabaseResource.cs | 28 +- ...remlinDatabaseThroughputSettingResource.cs | 28 +- .../src/Generated/GremlinGraphCollection.cs | 20 +- .../GremlinGraphData.Serialization.cs | 33 - .../src/Generated/GremlinGraphData.cs | 7 +- .../src/Generated/GremlinGraphResource.cs | 28 +- .../GremlinGraphThroughputSettingResource.cs | 28 +- ...eyspaceThroughputSettingOperationSource.cs | 1 - ...raTableThroughputSettingOperationSource.cs | 1 - .../CassandraViewGetResultOperationSource.cs | 36 - ...draViewThroughputSettingOperationSource.cs | 36 - ...smosDBChaosFaultResourceOperationSource.cs | 36 - ...ntainerThroughputSettingOperationSource.cs | 1 - ...atabaseThroughputSettingOperationSource.cs | 1 - ...mosDBTableRoleAssignmentOperationSource.cs | 36 - ...mosDBTableRoleDefinitionOperationSource.cs | 36 - ...sDBThroughputPoolAccountOperationSource.cs | 36 - .../CosmosDBThroughputPoolOperationSource.cs | 36 - ...osTableThroughputSettingOperationSource.cs | 1 - .../GraphResourceGetResultOperationSource.cs | 36 - ...atabaseThroughputSettingOperationSource.cs | 1 - ...inGraphThroughputSettingOperationSource.cs | 1 - ...lectionThroughputSettingOperationSource.cs | 1 - ...atabaseThroughputSettingOperationSource.cs | 1 - ...ionStorageInfoCollectionOperationSource.cs | 30 - ...tionThroughputInfoResultOperationSource.cs | 30 - .../Models/AccessRule.Serialization.cs | 200 ---- .../src/Generated/Models/AccessRule.cs | 71 -- .../Generated/Models/AccessRuleDirection.cs | 51 - .../AccessRuleProperties.Serialization.cs | 516 -------- .../Generated/Models/AccessRuleProperties.cs | 103 -- ...ataTransferDataSourceSink.Serialization.cs | 201 ---- .../AzureBlobDataTransferDataSourceSink.cs | 51 - ...ataTransferDataSourceSink.Serialization.cs | 183 --- .../BaseCosmosDataTransferDataSourceSink.cs | 40 - .../src/Generated/Models/CapacityMode.cs | 54 - ...ModeChangeTransitionState.Serialization.cs | 326 ----- .../CapacityModeChangeTransitionState.cs | 91 -- .../Models/CapacityModeTransitionStatus.cs | 60 - .../Models/CassandraAutoReplicateForm.cs | 54 - ...ClusterBackupResourceInfo.Serialization.cs | 299 ----- .../CassandraClusterBackupResourceInfo.cs | 86 -- ...ndraClusterBackupSchedule.Serialization.cs | 234 ---- .../Models/CassandraClusterBackupSchedule.cs | 76 -- .../Models/CassandraClusterBackupState.cs | 57 - .../CassandraClusterCommand.Serialization.cs | 477 -------- .../Models/CassandraClusterCommand.cs | 140 --- .../Models/CassandraClusterCommandStatus.cs | 63 - ...ClusterDataCenterNodeItem.Serialization.cs | 32 - .../CassandraClusterDataCenterNodeItem.cs | 7 +- ...assandraClusterProperties.Serialization.cs | 266 ----- .../Models/CassandraClusterProperties.cs | 39 +- .../Generated/Models/CassandraClusterType.cs | 51 - ...paceCreateOrUpdateContent.Serialization.cs | 33 - .../CassandraKeyspaceCreateOrUpdateContent.cs | 7 +- ...ableCreateOrUpdateContent.Serialization.cs | 33 - .../CassandraTableCreateOrUpdateContent.cs | 7 +- ...aViewGetPropertiesOptions.Serialization.cs | 175 --- .../CassandraViewGetPropertiesOptions.cs | 29 - ...ViewGetPropertiesResource.Serialization.cs | 280 ----- .../CassandraViewGetPropertiesResource.cs | 55 - ...sultCreateOrUpdateContent.Serialization.cs | 388 ------ ...andraViewGetResultCreateOrUpdateContent.cs | 95 -- .../CassandraViewListResult.Serialization.cs | 185 --- .../Models/CassandraViewListResult.cs | 66 -- .../CassandraViewResource.Serialization.cs | 198 ---- .../Generated/Models/CassandraViewResource.cs | 84 -- .../Models/ChaosFaultListResponse.cs | 70 -- .../Models/ContinuousModeBackupPolicy.cs | 2 +- .../Models/ContinuousModeProperties.cs | 4 +- ...ataTransferDataSourceSink.Serialization.cs | 231 ---- ...smosCassandraDataTransferDataSourceSink.cs | 55 - ...ountCreateOrUpdateContent.Serialization.cs | 208 +--- .../CosmosDBAccountCreateOrUpdateContent.cs | 67 +- .../Models/CosmosDBAccountLocation.cs | 4 +- .../CosmosDBAccountPatch.Serialization.cs | 102 +- .../Generated/Models/CosmosDBAccountPatch.cs | 57 +- ...BAccountRestoreParameters.Serialization.cs | 37 +- .../CosmosDBAccountRestoreParameters.cs | 7 +- ...ChaosFaultSupportedAction.Serialization.cs | 28 - .../CosmosDBChaosFaultSupportedAction.cs | 18 - .../CosmosDBErrorResult.Serialization.cs | 204 ---- .../Generated/Models/CosmosDBErrorResult.cs | 71 -- .../Models/CosmosDBMinimalTlsVersion.cs | 2 +- ...inerCreateOrUpdateContent.Serialization.cs | 33 - ...smosDBSqlContainerCreateOrUpdateContent.cs | 7 +- ...BSqlContainerResourceInfo.Serialization.cs | 62 +- .../CosmosDBSqlContainerResourceInfo.cs | 13 +- ...baseCreateOrUpdateContent.Serialization.cs | 33 - ...osmosDBSqlDatabaseCreateOrUpdateContent.cs | 7 +- ...dureCreateOrUpdateContent.Serialization.cs | 33 - ...SqlStoredProcedureCreateOrUpdateContent.cs | 7 +- ...ggerCreateOrUpdateContent.Serialization.cs | 33 - ...CosmosDBSqlTriggerCreateOrUpdateContent.cs | 7 +- ...tionCreateOrUpdateContent.Serialization.cs | 33 - ...serDefinedFunctionCreateOrUpdateContent.cs | 7 +- .../src/Generated/Models/CosmosDBStatus.cs | 12 - ...ableCreateOrUpdateContent.Serialization.cs | 33 - .../CosmosDBTableCreateOrUpdateContent.cs | 7 +- ...smosDBTableRolePermission.Serialization.cs | 293 ----- .../Models/CosmosDBTableRolePermission.cs | 78 -- .../CosmosDBThroughputBucket.Serialization.cs | 176 --- .../Models/CosmosDBThroughputBucket.cs | 80 -- ...smosDBThroughputPoolPatch.Serialization.cs | 163 --- .../Models/CosmosDBThroughputPoolPatch.cs | 71 -- ...ataTransferDataSourceSink.Serialization.cs | 231 ---- .../CosmosMongoDataTransferDataSourceSink.cs | 55 - ...ataTransferDataSourceSink.Serialization.cs | 272 ----- ...mosMongoVCoreDataTransferDataSourceSink.cs | 64 - ...ataTransferDataSourceSink.Serialization.cs | 231 ---- .../CosmosSqlDataTransferDataSourceSink.cs | 55 - .../Generated/Models/DataTransferComponent.cs | 60 - ...ataTransferDataSourceSink.Serialization.cs | 153 --- .../Models/DataTransferDataSourceSink.cs | 69 -- ...ataTransferJobFeedResults.Serialization.cs | 219 ---- .../Models/DataTransferJobFeedResults.cs | 70 -- ...sultCreateOrUpdateContent.Serialization.cs | 233 ---- ...ansferJobGetResultCreateOrUpdateContent.cs | 82 -- .../Generated/Models/DataTransferJobMode.cs | 51 - ...DataTransferJobProperties.Serialization.cs | 474 -------- .../Models/DataTransferJobProperties.cs | 153 --- .../Generated/Models/DefaultPriorityLevel.cs | 51 - .../DiagnosticLogSettings.Serialization.cs | 166 --- .../Generated/Models/DiagnosticLogSettings.cs | 66 -- .../EnableFullTextQuery.Serialization.cs | 30 - .../Generated/Models/EnableFullTextQuery.cs | 20 - ...BSqlContainerResourceInfo.Serialization.cs | 52 +- ...xtendedCosmosDBSqlContainerResourceInfo.cs | 4 +- ...ghputSettingsResourceInfo.Serialization.cs | 40 - .../ExtendedThroughputSettingsResourceInfo.cs | 3 +- ...ation.cs => FullTextPath.Serialization.cs} | 118 +- ...oughputInfoResource.cs => FullTextPath.cs} | 44 +- ...ion.cs => FullTextPolicy.Serialization.cs} | 120 +- ...sourcesListResult.cs => FullTextPolicy.cs} | 28 +- ...ourceGetPropertiesOptions.Serialization.cs | 175 --- .../GraphResourceGetPropertiesOptions.cs | 29 - ...sultCreateOrUpdateContent.Serialization.cs | 394 ------- ...hResourceGetResultCreateOrUpdateContent.cs | 108 -- .../GraphResourcesListResult.Serialization.cs | 185 --- ...baseCreateOrUpdateContent.Serialization.cs | 33 - .../GremlinDatabaseCreateOrUpdateContent.cs | 7 +- ...raphCreateOrUpdateContent.Serialization.cs | 33 - .../GremlinGraphCreateOrUpdateContent.cs | 7 +- .../src/Generated/Models/IssueType.cs | 57 - .../Models/ListBackups.Serialization.cs | 185 --- .../src/Generated/Models/ListBackups.cs | 66 -- .../src/Generated/Models/ListCommands.cs | 66 -- ...aterializedViewDefinition.Serialization.cs | 232 ---- .../Models/MaterializedViewDefinition.cs | 89 -- .../Models/MergeParameters.Serialization.cs | 133 --- .../src/Generated/Models/MergeParameters.cs | 66 -- ...tionCreateOrUpdateContent.Serialization.cs | 33 - .../MongoDBCollectionCreateOrUpdateContent.cs | 7 +- ...baseCreateOrUpdateContent.Serialization.cs | 33 - .../MongoDBDatabaseCreateOrUpdateContent.cs | 7 +- .../NetworkSecurityPerimeter.Serialization.cs | 226 ---- .../Models/NetworkSecurityPerimeter.cs | 77 -- ...erConfigurationListResult.Serialization.cs | 215 ---- ...ecurityPerimeterConfigurationListResult.cs | 70 -- ...erConfigurationProperties.Serialization.cs | 311 ----- ...ecurityPerimeterConfigurationProperties.cs | 87 -- ...PerimeterConfigurationProvisioningState.cs | 66 -- .../NetworkSecurityProfile.Serialization.cs | 346 ------ .../Models/NetworkSecurityProfile.cs | 88 -- ...sicalPartitionStorageInfo.Serialization.cs | 200 ---- .../Models/PhysicalPartitionStorageInfo.cs | 71 -- ...tionStorageInfoCollection.Serialization.cs | 185 --- .../PhysicalPartitionStorageInfoCollection.cs | 67 -- ...nThroughputInfoProperties.Serialization.cs | 185 --- ...ysicalPartitionThroughputInfoProperties.cs | 67 -- ...ionThroughputInfoResource.Serialization.cs | 197 ---- ...itionThroughputInfoResult.Serialization.cs | 369 ------ .../PhysicalPartitionThroughputInfoResult.cs | 96 -- ...oResultPropertiesResource.Serialization.cs | 161 --- ...nThroughputInfoResultPropertiesResource.cs | 28 - .../Models/ProvisioningIssue.Serialization.cs | 200 ---- .../src/Generated/Models/ProvisioningIssue.cs | 71 -- ...ovisioningIssueProperties.Serialization.cs | 350 ------ .../Models/ProvisioningIssueProperties.cs | 89 -- ...ibuteThroughputParameters.Serialization.cs | 357 ------ .../RedistributeThroughputParameters.cs | 90 -- ...oughputPropertiesResource.Serialization.cs | 239 ---- ...edistributeThroughputPropertiesResource.cs | 92 -- .../ResourceAssociation.Serialization.cs | 200 ---- .../Generated/Models/ResourceAssociation.cs | 71 -- .../Models/ResourceAssociationAccessMode.cs | 54 - ...opertiesResourceContainer.Serialization.cs | 52 +- ...SqlContainerPropertiesResourceContainer.cs | 4 +- ...rieveThroughputParameters.Serialization.cs | 362 ------ .../Models/RetrieveThroughputParameters.cs | 98 -- ...oughputPropertiesResource.Serialization.cs | 179 --- .../RetrieveThroughputPropertiesResource.cs | 78 -- .../Models/ScheduledEventStrategy.cs | 54 - .../src/Generated/Models/Severity.cs | 51 - ...eRoleAssignmentListResult.Serialization.cs | 219 ---- .../Models/TableRoleAssignmentListResult.cs | 70 -- ...eRoleDefinitionListResult.Serialization.cs | 219 ---- .../Models/TableRoleDefinitionListResult.cs | 70 -- .../Generated/Models/ThroughputPolicyType.cs | 54 - ...putPoolAccountsListResult.Serialization.cs | 219 ---- .../ThroughputPoolAccountsListResult.cs | 70 -- ...ThroughputPoolsListResult.Serialization.cs | 219 ---- .../Models/ThroughputPoolsListResult.cs | 70 -- ...ghputSettingsResourceInfo.Serialization.cs | 50 - .../Models/ThroughputSettingsResourceInfo.cs | 8 +- ...oughputSettingsUpdateData.Serialization.cs | 33 - .../Models/ThroughputSettingsUpdateData.cs | 7 +- ...ataTransferDataSourceSink.Serialization.cs | 140 --- .../UnknownDataTransferDataSourceSink.cs | 29 - .../Generated/MongoDBCollectionCollection.cs | 20 +- .../MongoDBCollectionData.Serialization.cs | 33 - .../src/Generated/MongoDBCollectionData.cs | 7 +- .../Generated/MongoDBCollectionResource.cs | 120 +- ...goDBCollectionThroughputSettingResource.cs | 212 +--- .../Generated/MongoDBDatabaseCollection.cs | 20 +- .../MongoDBDatabaseData.Serialization.cs | 33 - .../src/Generated/MongoDBDatabaseData.cs | 7 +- .../src/Generated/MongoDBDatabaseResource.cs | 120 +- ...ongoDBDatabaseThroughputSettingResource.cs | 212 +--- .../MongoDBRoleDefinitionCollection.cs | 20 +- .../MongoDBRoleDefinitionResource.cs | 12 +- .../MongoDBUserDefinitionCollection.cs | 20 +- .../MongoDBUserDefinitionResource.cs | 12 +- ...ecurityPerimeterConfigurationCollection.cs | 395 ------- ...erimeterConfigurationData.Serialization.cs | 241 ---- ...tworkSecurityPerimeterConfigurationData.cs | 76 -- ...eterConfigurationResource.Serialization.cs | 26 - ...kSecurityPerimeterConfigurationResource.cs | 255 ---- .../CassandraClustersRestOperations.cs | 448 +------ .../CassandraDataCentersRestOperations.cs | 22 +- .../CassandraResourcesRestOperations.cs | 917 +-------------- .../ChaosFaultRestOperations.cs | 421 ------- ...CollectionPartitionRegionRestOperations.cs | 6 +- .../CollectionPartitionRestOperations.cs | 10 +- .../CollectionRegionRestOperations.cs | 6 +- .../CollectionRestOperations.cs | 14 +- .../DataTransferJobsRestOperations.cs | 837 ------------- .../DatabaseAccountRegionRestOperations.cs | 6 +- .../DatabaseAccountsRestOperations.cs | 66 +- .../RestOperations/DatabaseRestOperations.cs | 14 +- .../GraphResourcesRestOperations.cs | 430 ------- .../GremlinResourcesRestOperations.cs | 70 +- .../RestOperations/LocationsRestOperations.cs | 10 +- .../MongoDBResourcesRestOperations.cs | 738 +----------- ...tyPerimeterConfigurationsRestOperations.cs | 413 ------- ...PartitionKeyRangeIdRegionRestOperations.cs | 6 +- .../PartitionKeyRangeIdRestOperations.cs | 6 +- .../PercentileRestOperations.cs | 6 +- .../PercentileSourceTargetRestOperations.cs | 6 +- .../PercentileTargetRestOperations.cs | 6 +- ...rivateEndpointConnectionsRestOperations.cs | 18 +- .../PrivateLinkResourcesRestOperations.cs | 10 +- ...estorableDatabaseAccountsRestOperations.cs | 14 +- ...estorableGremlinDatabasesRestOperations.cs | 6 +- .../RestorableGremlinGraphsRestOperations.cs | 6 +- ...estorableGremlinResourcesRestOperations.cs | 6 +- ...torableMongodbCollectionsRestOperations.cs | 6 +- ...estorableMongodbDatabasesRestOperations.cs | 6 +- ...estorableMongodbResourcesRestOperations.cs | 6 +- .../RestorableSqlContainersRestOperations.cs | 6 +- .../RestorableSqlDatabasesRestOperations.cs | 6 +- .../RestorableSqlResourcesRestOperations.cs | 6 +- .../RestorableTableResourcesRestOperations.cs | 6 +- .../RestorableTablesRestOperations.cs | 6 +- .../RestOperations/ServiceRestOperations.cs | 18 +- .../SqlResourcesRestOperations.cs | 1048 ++++------------- .../TableResourcesRestOperations.cs | 822 +------------ .../ThroughputPoolAccountRestOperations.cs | 334 ------ .../ThroughputPoolAccountsRestOperations.cs | 217 ---- .../ThroughputPoolRestOperations.cs | 403 ------- .../ThroughputPoolsRestOperations.cs | 359 ------ .../RestorableCosmosDBAccountCollection.cs | 16 +- ...orableCosmosDBAccountData.Serialization.cs | 42 +- .../RestorableCosmosDBAccountData.cs | 12 +- .../RestorableCosmosDBAccountResource.cs | 48 +- .../ThroughputSettingData.Serialization.cs | 33 - .../src/Generated/ThroughputSettingData.cs | 7 +- .../src/autorest.md | 2 +- sdk/storage/ci.yml | 2 + 450 files changed, 2191 insertions(+), 47768 deletions(-) delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewGetResultOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewThroughputSettingOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBChaosFaultResourceOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBTableRoleAssignmentOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBTableRoleDefinitionOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionStorageInfoCollectionOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionThroughputInfoResultOperationSource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleDirection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityMode.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeTransitionStatus.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAutoReplicateForm.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupState.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommandStatus.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterType.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ChaosFaultListResponse.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBChaosFaultSupportedAction.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBChaosFaultSupportedAction.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableRolePermission.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableRolePermission.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputBucket.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputBucket.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoVCoreDataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoVCoreDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobMode.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DefaultPriorityLevel.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.cs rename sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/{ListCommands.Serialization.cs => FullTextPath.Serialization.cs} (60%) rename sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/{PhysicalPartitionThroughputInfoResource.cs => FullTextPath.cs} (57%) rename sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/{ChaosFaultListResponse.Serialization.cs => FullTextPolicy.Serialization.cs} (60%) rename sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/{GraphResourcesListResult.cs => FullTextPolicy.cs} (63%) delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IssueType.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociationAccessMode.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ScheduledEventStrategy.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Severity.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleAssignmentListResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleAssignmentListResult.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleDefinitionListResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleDefinitionListResult.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyType.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ChaosFaultRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs index aca0bb177176..0d19f1a7c85c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_CassandraClusterCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBManagedCassandraClusterCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterCreate.json // this example is just showing the usage of "CassandraClusters_CreateUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task CreateOrUpdate_CosmosDBManagedCassandraClusterCreate() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; string resourceGroupName = "cassandra-prod-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -86,7 +86,7 @@ public async Task CreateOrUpdate_CosmosDBManagedCassandraClusterCreate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Get_CosmosDBManagedCassandraClusterGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBManagedCassandraClusterListByResourceGroup() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json // this example is just showing the usage of "CassandraClusters_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -154,7 +154,7 @@ public async Task GetAll_CosmosDBManagedCassandraClusterListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -183,7 +183,7 @@ public async Task Exists_CosmosDBManagedCassandraClusterGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs index 052c1990bd41..b1673771d66d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraClusterResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_CosmosDBManagedCassandraClusterGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBManagedCassandraClusterDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterDelete.json // this example is just showing the usage of "CassandraClusters_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_CosmosDBManagedCassandraClusterDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBManagedCassandraClusterPatch() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterPatch.json // this example is just showing the usage of "CassandraClusters_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task Update_CosmosDBManagedCassandraClusterPatch() [Ignore("Only validating compilation of examples")] public async Task InvokeCommand_CosmosDBManagedCassandraCommand() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommand.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraCommand.json // this example is just showing the usage of "CassandraClusters_InvokeCommand" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -143,143 +143,25 @@ public async Task InvokeCommand_CosmosDBManagedCassandraCommand() // this example assumes you already have this CassandraClusterResource created on azure // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; string resourceGroupName = "cassandra-prod-rg"; string clusterName = "cassandra-prod"; ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); // invoke the operation - CassandraCommandPostBody body = new CassandraCommandPostBody("nodetool", "10.0.1.12") - { - Arguments = -{ -["status"] = "" -}, - }; + CassandraCommandPostBody body = new CassandraCommandPostBody("nodetool status", "10.0.1.12"); ArmOperation lro = await cassandraCluster.InvokeCommandAsync(WaitUntil.Completed, body); CassandraCommandOutput result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetCommand_CosmosDBManagedCassandraListCommand() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraListCommand.json - // this example is just showing the usage of "CassandraClusters_ListCommand" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraClusterResource created on azure - // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "cassandra-prod-rg"; - string clusterName = "cassandra-prod"; - ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); - CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); - - // invoke the operation and iterate over the result - await foreach (CassandraClusterCommand item in cassandraCluster.GetCommandAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetCommandAsync_CosmosDBManagedCassandraCommandResult() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandResult.json - // this example is just showing the usage of "CassandraClusters_GetCommandAsync" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraClusterResource created on azure - // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "cassandra-prod-rg"; - string clusterName = "cassandra-prod"; - ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); - CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); - - // invoke the operation - string commandId = "318653d0-3da5-4814-b8f6-429f2af0b2a4"; - CassandraClusterCommand result = await cassandraCluster.GetCommandAsyncAsync(commandId); - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetBackups_CosmosDBManagedCassandraBackupsList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackupsList.json - // this example is just showing the usage of "CassandraClusters_ListBackups" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraClusterResource created on azure - // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "cassandra-prod-rg"; - string clusterName = "cassandra-prod"; - ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); - CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); - - // invoke the operation and iterate over the result - await foreach (CassandraClusterBackupResourceInfo item in cassandraCluster.GetBackupsAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetBackup_CosmosDBManagedCassandraBackup() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackup.json - // this example is just showing the usage of "CassandraClusters_GetBackup" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraClusterResource created on azure - // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "cassandra-prod-rg"; - string clusterName = "cassandra-prod"; - ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); - CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); - - // invoke the operation - string backupId = "1611250348"; - CassandraClusterBackupResourceInfo result = await cassandraCluster.GetBackupAsync(backupId); - - Console.WriteLine($"Succeeded: {result}"); - } - [Test] [Ignore("Only validating compilation of examples")] public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterDeallocate.json // this example is just showing the usage of "CassandraClusters_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -289,7 +171,7 @@ public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() // this example assumes you already have this CassandraClusterResource created on azure // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; string resourceGroupName = "cassandra-prod-rg"; string clusterName = "cassandra-prod"; ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -305,7 +187,7 @@ public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() [Ignore("Only validating compilation of examples")] public async Task Start_CosmosDBManagedCassandraClusterStart() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterStart.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterStart.json // this example is just showing the usage of "CassandraClusters_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -315,7 +197,7 @@ public async Task Start_CosmosDBManagedCassandraClusterStart() // this example assumes you already have this CassandraClusterResource created on azure // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; string resourceGroupName = "cassandra-prod-rg"; string clusterName = "cassandra-prod"; ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -331,7 +213,7 @@ public async Task Start_CosmosDBManagedCassandraClusterStart() [Ignore("Only validating compilation of examples")] public async Task Status_CosmosDBManagedCassandraStatus() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraStatus.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraStatus.json // this example is just showing the usage of "CassandraClusters_Status" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -341,7 +223,7 @@ public async Task Status_CosmosDBManagedCassandraStatus() // this example assumes you already have this CassandraClusterResource created on azure // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; string resourceGroupName = "cassandra-prod-rg"; string clusterName = "cassandra-prod"; ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs index c9c78d1dd58b..661d23e8aa99 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraDataCenterCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBManagedCassandraDataCenterCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterCreate.json // this example is just showing the usage of "CassandraDataCenters_CreateUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -65,7 +65,7 @@ public async Task CreateOrUpdate_CosmosDBManagedCassandraDataCenterCreate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task Get_CosmosDBManagedCassandraDataCenterGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBManagedCassandraDataCenterList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterList.json // this example is just showing the usage of "CassandraDataCenters_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task GetAll_CosmosDBManagedCassandraDataCenterList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task Exists_CosmosDBManagedCassandraDataCenterGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs index e51603f5a666..98aa77a11d6f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraDataCenterResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBManagedCassandraDataCenterGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBManagedCassandraDataCenterDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterDelete.json // this example is just showing the usage of "CassandraDataCenters_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBManagedCassandraDataCenterDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBManagedCassandraDataCenterUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraDataCenterPatch.json // this example is just showing the usage of "CassandraDataCenters_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs index 77cf29159cb5..3eae708844e0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraKeyspaceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBCassandraKeyspaceGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBCassandraKeyspaceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceList.json // this example is just showing the usage of "CassandraResources_ListCassandraKeyspaces" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task GetAll_CosmosDBCassandraKeyspaceList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Exists_CosmosDBCassandraKeyspaceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs index 8b8f5ea3f719..9577adb7db53 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraKeyspaceResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBCassandraKeyspaceGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBCassandraKeyspaceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceDelete.json // this example is just showing the usage of "CassandraResources_DeleteCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBCassandraKeyspaceDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBCassandraKeyspaceCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs index 3192b1d45a54..08a64f582c9f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraKeyspaceThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraKeyspaceThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspaceThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBCassandraKeyspaceThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json // this example is just showing the usage of "CassandraResources_UpdateCassandraKeyspaceThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateCassandraKeyspaceToAutoscale_CosmosDBCassandraKeyspaceMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json // this example is just showing the usage of "CassandraResources_MigrateCassandraKeyspaceToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task MigrateCassandraKeyspaceToAutoscale_CosmosDBCassandraKeyspaceM [Ignore("Only validating compilation of examples")] public async Task MigrateCassandraKeyspaceToManualThroughput_CosmosDBCassandraKeyspaceMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json // this example is just showing the usage of "CassandraResources_MigrateCassandraKeyspaceToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs index 8c32afefefa5..abad6798c857 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraTableCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBCassandraTableCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,6 @@ public async Task CreateOrUpdate_CosmosDBCassandraTableCreateUpdate() OrderBy = "Asc", }}, }, - AnalyticalStorageTtl = 500, }) { Options = new CosmosDBCreateUpdateConfig(), @@ -82,7 +81,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraTableCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +116,7 @@ public async Task Get_CosmosDBCassandraTableGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBCassandraTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableList.json // this example is just showing the usage of "CassandraResources_ListCassandraTables" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -154,7 +153,7 @@ public async Task GetAll_CosmosDBCassandraTableList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -185,7 +184,7 @@ public async Task Exists_CosmosDBCassandraTableGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs index 5f2cb3d9dddc..2d6e6d4129e4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraTableResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBCassandraTableGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBCassandraTableDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableDelete.json // this example is just showing the usage of "CassandraResources_DeleteCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_CosmosDBCassandraTableDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBCassandraTableCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,6 @@ public async Task Update_CosmosDBCassandraTableCreateUpdate() OrderBy = "Asc", }}, }, - AnalyticalStorageTtl = 500, }) { Options = new CosmosDBCreateUpdateConfig(), diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs index 6738bb6f8a53..1659f724cb97 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraTableThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraTableThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableThroughputGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBCassandraTableThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBCassandraTableThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableThroughputUpdate.json // this example is just showing the usage of "CassandraResources_UpdateCassandraTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraTableThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateCassandraTableToAutoscale_CosmosDBCassandraTableMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json // this example is just showing the usage of "CassandraResources_MigrateCassandraTableToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task MigrateCassandraTableToAutoscale_CosmosDBCassandraTableMigrate [Ignore("Only validating compilation of examples")] public async Task MigrateCassandraTableToManualThroughput_CosmosDBCassandraTableMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json // this example is just showing the usage of "CassandraResources_MigrateCassandraTableToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs index e520b6b522ae..fb7685ce6a48 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_CosmosDBAccountCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMax.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountCreateMax.json // this example is just showing the usage of "DatabaseAccounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,6 +59,13 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() }) { Kind = CosmosDBAccountKind.MongoDB, + Identity = new ManagedServiceIdentity("SystemAssigned,UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity() +}, + }, ConsistencyPolicy = new ConsistencyPolicy(DefaultConsistencyLevel.BoundedStaleness) { MaxStalenessPrefix = 200L, @@ -98,20 +105,9 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() NetworkAclBypass = NetworkAclBypass.AzureServices, NetworkAclBypassResourceIds = { new ResourceIdentifier("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName") }, CapacityTotalThroughputLimit = 2000, - CapacityMode = CapacityMode.Provisioned, - EnableMaterializedViews = false, - EnableBurstCapacity = true, MinimalTlsVersion = CosmosDBMinimalTlsVersion.Tls12, - EnablePriorityBasedExecution = true, - DefaultPriorityLevel = DefaultPriorityLevel.Low, + EnableBurstCapacity = true, EnablePerRegionPerPartitionAutoscale = true, - Identity = new ManagedServiceIdentity("SystemAssigned,UserAssigned") - { - UserAssignedIdentities = -{ -[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity() -}, - }, Tags = { }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, content); @@ -128,7 +124,7 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMin() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMin.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountCreateMin.json // this example is just showing the usage of "DatabaseAccounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +170,7 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMin() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json // this example is just showing the usage of "DatabaseAccounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -231,12 +227,10 @@ public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson( DatabaseName = "db2", CollectionNames = {"collection3", "collection4"}, }}, - SourceBackupLocation = "westus", RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc", RestoreTimestampInUtc = DateTimeOffset.Parse("2021-03-11T22:05:09Z"), IsRestoreWithTtlDisabled = false, }, - EnableMaterializedViews = false, MinimalTlsVersion = CosmosDBMinimalTlsVersion.Tls, Tags = { }, }; @@ -254,7 +248,7 @@ public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson( [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -287,7 +281,7 @@ public async Task Get_CosmosDBDatabaseAccountGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBDatabaseAccountListByResourceGroup() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json // this example is just showing the usage of "DatabaseAccounts_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -322,7 +316,7 @@ public async Task GetAll_CosmosDBDatabaseAccountListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -351,7 +345,7 @@ public async Task Exists_CosmosDBDatabaseAccountGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs index 0243bcfe62af..5454b1308644 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs @@ -21,7 +21,7 @@ public partial class Sample_CosmosDBAccountResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBDatabaseAccountGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBDatabaseAccountDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountDelete.json // this example is just showing the usage of "DatabaseAccounts_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task Delete_CosmosDBDatabaseAccountDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBDatabaseAccountPatch() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountPatch.json // this example is just showing the usage of "DatabaseAccounts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,19 +136,15 @@ public async Task Update_CosmosDBDatabaseAccountPatch() { BackupIntervalInMinutes = 240, BackupRetentionIntervalInHours = 720, - BackupStorageRedundancy = CosmosDBBackupStorageRedundancy.Geo, + BackupStorageRedundancy = CosmosDBBackupStorageRedundancy.Local, }, }, NetworkAclBypass = NetworkAclBypass.AzureServices, NetworkAclBypassResourceIds = { new ResourceIdentifier("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName") }, - DiagnosticLogEnableFullTextQuery = EnableFullTextQuery.True, CapacityTotalThroughputLimit = 2000, - CapacityMode = CapacityMode.Provisioned, EnablePartitionMerge = true, - EnableBurstCapacity = true, MinimalTlsVersion = CosmosDBMinimalTlsVersion.Tls, - EnablePriorityBasedExecution = true, - DefaultPriorityLevel = DefaultPriorityLevel.Low, + EnableBurstCapacity = true, EnablePerRegionPerPartitionAutoscale = true, }; ArmOperation lro = await cosmosDBAccount.UpdateAsync(WaitUntil.Completed, patch); @@ -165,7 +161,7 @@ public async Task Update_CosmosDBDatabaseAccountPatch() [Ignore("Only validating compilation of examples")] public async Task FailoverPriorityChange_CosmosDBDatabaseAccountFailoverPriorityChange() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json // this example is just showing the usage of "DatabaseAccounts_FailoverPriorityChange" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -204,7 +200,7 @@ public async Task FailoverPriorityChange_CosmosDBDatabaseAccountFailoverPriority [Ignore("Only validating compilation of examples")] public async Task GetKeys_CosmosDBDatabaseAccountListKeys() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListKeys.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountListKeys.json // this example is just showing the usage of "DatabaseAccounts_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -230,7 +226,7 @@ public async Task GetKeys_CosmosDBDatabaseAccountListKeys() [Ignore("Only validating compilation of examples")] public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStrings() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json // this example is just showing the usage of "DatabaseAccounts_ListConnectionStrings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -259,7 +255,7 @@ public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStri [Ignore("Only validating compilation of examples")] public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStringsMongo() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json // this example is just showing the usage of "DatabaseAccounts_ListConnectionStrings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -288,7 +284,7 @@ public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStri [Ignore("Only validating compilation of examples")] public async Task OfflineRegion_CosmosDBDatabaseAccountOfflineRegion() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountOfflineRegion.json // this example is just showing the usage of "DatabaseAccounts_OfflineRegion" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -315,7 +311,7 @@ public async Task OfflineRegion_CosmosDBDatabaseAccountOfflineRegion() [Ignore("Only validating compilation of examples")] public async Task OnlineRegion_CosmosDBDatabaseAccountOnlineRegion() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountOnlineRegion.json // this example is just showing the usage of "DatabaseAccounts_OnlineRegion" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -342,7 +338,7 @@ public async Task OnlineRegion_CosmosDBDatabaseAccountOnlineRegion() [Ignore("Only validating compilation of examples")] public async Task GetReadOnlyKeys_CosmosDBDatabaseAccountListReadOnlyKeys() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json // this example is just showing the usage of "DatabaseAccounts_ListReadOnlyKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -368,7 +364,7 @@ public async Task GetReadOnlyKeys_CosmosDBDatabaseAccountListReadOnlyKeys() [Ignore("Only validating compilation of examples")] public async Task RegenerateKey_CosmosDBDatabaseAccountRegenerateKey() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountRegenerateKey.json // this example is just showing the usage of "DatabaseAccounts_RegenerateKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -395,7 +391,7 @@ public async Task RegenerateKey_CosmosDBDatabaseAccountRegenerateKey() [Ignore("Only validating compilation of examples")] public async Task GetMetrics_CosmosDBDatabaseAccountGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountGetMetrics.json // this example is just showing the usage of "DatabaseAccounts_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -425,7 +421,7 @@ public async Task GetMetrics_CosmosDBDatabaseAccountGetMetrics() [Ignore("Only validating compilation of examples")] public async Task GetUsages_CosmosDBDatabaseAccountGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountGetUsages.json // this example is just showing the usage of "DatabaseAccounts_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -455,7 +451,7 @@ public async Task GetUsages_CosmosDBDatabaseAccountGetUsages() [Ignore("Only validating compilation of examples")] public async Task GetMetricDefinitions_CosmosDBDatabaseAccountGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json // this example is just showing the usage of "DatabaseAccounts_ListMetricDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -484,7 +480,7 @@ public async Task GetMetricDefinitions_CosmosDBDatabaseAccountGetMetricDefinitio [Ignore("Only validating compilation of examples")] public async Task GetMetricsDatabases_CosmosDBDatabaseGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseGetMetrics.json // this example is just showing the usage of "Database_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -515,7 +511,7 @@ public async Task GetMetricsDatabases_CosmosDBDatabaseGetMetrics() [Ignore("Only validating compilation of examples")] public async Task GetUsagesDatabases_CosmosDBDatabaseGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseGetUsages.json // this example is just showing the usage of "Database_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -546,7 +542,7 @@ public async Task GetUsagesDatabases_CosmosDBDatabaseGetUsages() [Ignore("Only validating compilation of examples")] public async Task GetMetricDefinitionsDatabases_CosmosDBDatabaseGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseGetMetricDefinitions.json // this example is just showing the usage of "Database_ListMetricDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -576,7 +572,7 @@ public async Task GetMetricDefinitionsDatabases_CosmosDBDatabaseGetMetricDefinit [Ignore("Only validating compilation of examples")] public async Task GetMetricsCollections_CosmosDBCollectionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCollectionGetMetrics.json // this example is just showing the usage of "Collection_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -608,7 +604,7 @@ public async Task GetMetricsCollections_CosmosDBCollectionGetMetrics() [Ignore("Only validating compilation of examples")] public async Task GetUsagesCollections_CosmosDBCollectionGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCollectionGetUsages.json // this example is just showing the usage of "Collection_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -640,7 +636,7 @@ public async Task GetUsagesCollections_CosmosDBCollectionGetUsages() [Ignore("Only validating compilation of examples")] public async Task GetMetricDefinitionsCollections_CosmosDBCollectionGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCollectionGetMetricDefinitions.json // this example is just showing the usage of "Collection_ListMetricDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -671,7 +667,7 @@ public async Task GetMetricDefinitionsCollections_CosmosDBCollectionGetMetricDef [Ignore("Only validating compilation of examples")] public async Task GetMetricsCollectionRegions_CosmosDBRegionCollectionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRegionCollectionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRegionCollectionGetMetrics.json // this example is just showing the usage of "CollectionRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -704,7 +700,7 @@ public async Task GetMetricsCollectionRegions_CosmosDBRegionCollectionGetMetrics [Ignore("Only validating compilation of examples")] public async Task GetMetricsDatabaseAccountRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json // this example is just showing the usage of "DatabaseAccountRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -735,7 +731,7 @@ public async Task GetMetricsDatabaseAccountRegions_CosmosDBDatabaseAccountRegion [Ignore("Only validating compilation of examples")] public async Task GetMetricsPercentileSourceTargets_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json // this example is just showing the usage of "PercentileSourceTarget_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -767,7 +763,7 @@ public async Task GetMetricsPercentileSourceTargets_CosmosDBDatabaseAccountRegio [Ignore("Only validating compilation of examples")] public async Task GetMetricsPercentileTargets_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileTargetGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPercentileTargetGetMetrics.json // this example is just showing the usage of "PercentileTarget_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -798,7 +794,7 @@ public async Task GetMetricsPercentileTargets_CosmosDBDatabaseAccountRegionGetMe [Ignore("Only validating compilation of examples")] public async Task GetMetricsPercentiles_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPercentileGetMetrics.json // this example is just showing the usage of "Percentile_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -828,7 +824,7 @@ public async Task GetMetricsPercentiles_CosmosDBDatabaseAccountRegionGetMetrics( [Ignore("Only validating compilation of examples")] public async Task GetMetricsCollectionPartitionRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json // this example is just showing the usage of "CollectionPartitionRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -861,7 +857,7 @@ public async Task GetMetricsCollectionPartitionRegions_CosmosDBDatabaseAccountRe [Ignore("Only validating compilation of examples")] public async Task GetMetricsCollectionPartitions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCollectionPartitionGetMetrics.json // this example is just showing the usage of "CollectionPartition_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -893,7 +889,7 @@ public async Task GetMetricsCollectionPartitions_CosmosDBDatabaseAccountRegionGe [Ignore("Only validating compilation of examples")] public async Task GetUsagesCollectionPartitions_CosmosDBCollectionGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBCollectionPartitionGetUsages.json // this example is just showing the usage of "CollectionPartition_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -925,7 +921,7 @@ public async Task GetUsagesCollectionPartitions_CosmosDBCollectionGetUsages() [Ignore("Only validating compilation of examples")] public async Task GetMetricsPartitionKeyRangeIds_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPKeyRangeIdGetMetrics.json // this example is just showing the usage of "PartitionKeyRangeId_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -958,7 +954,7 @@ public async Task GetMetricsPartitionKeyRangeIds_CosmosDBDatabaseAccountRegionGe [Ignore("Only validating compilation of examples")] public async Task GetMetricsPartitionKeyRangeIdRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json // this example is just showing the usage of "PartitionKeyRangeIdRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs index c1fa6be93db4..926736deb3f7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBLocationCollection [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBLocationGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBLocationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBLocationList.json // this example is just showing the usage of "Locations_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task GetAll_CosmosDBLocationList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +114,7 @@ public async Task Exists_CosmosDBLocationGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs index 6b959294f24f..b196616cd64d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBLocationResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs index 7c35640e1e25..3ee5f6bb5cb2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAG [Ignore("Only validating compilation of examples")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateEndpointConnectionListGet.json // this example is just showing the usage of "PrivateEndpointConnections_ListByDatabaseAccount" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task GetAll_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs index 936bb1260bd1..2461ba46a03d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletesAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateEndpointConnectionDelete.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeletesAPrivateEndpointConnectionWithAGivenName() [Ignore("Only validating compilation of examples")] public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs index 00d7ef8def32..74fd73304e52 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBPrivateLinkResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs index 52032a900f3b..76a1661afa7d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBPrivateLinkResourceCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceListGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateLinkResourceListGet.json // this example is just showing the usage of "PrivateLinkResources_ListByDatabaseAccount" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs index e094e3ffb363..301b46343f83 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBServiceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataTransferServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDataTransferServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_DataTransferServiceCreate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_GraphAPIComputeServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGraphAPIComputeServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +106,7 @@ public async Task CreateOrUpdate_GraphAPIComputeServiceCreate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_MaterializedViewsBuilderServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +149,7 @@ public async Task CreateOrUpdate_MaterializedViewsBuilderServiceCreate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SqlDedicatedGatewayServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -193,7 +193,7 @@ public async Task CreateOrUpdate_SqlDedicatedGatewayServiceCreate() [Ignore("Only validating compilation of examples")] public async Task Get_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -227,7 +227,7 @@ public async Task Get_DataTransferServiceGet() [Ignore("Only validating compilation of examples")] public async Task Get_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -261,7 +261,7 @@ public async Task Get_GraphAPIComputeServiceGet() [Ignore("Only validating compilation of examples")] public async Task Get_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -295,7 +295,7 @@ public async Task Get_MaterializedViewsBuilderServiceGet() [Ignore("Only validating compilation of examples")] public async Task Get_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -329,7 +329,7 @@ public async Task Get_SqlDedicatedGatewayServiceGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBServicesList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBServicesList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBServicesList.json // this example is just showing the usage of "Service_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -365,7 +365,7 @@ public async Task GetAll_CosmosDBServicesList() [Ignore("Only validating compilation of examples")] public async Task Exists_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -395,7 +395,7 @@ public async Task Exists_DataTransferServiceGet() [Ignore("Only validating compilation of examples")] public async Task Exists_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -425,7 +425,7 @@ public async Task Exists_GraphAPIComputeServiceGet() [Ignore("Only validating compilation of examples")] public async Task Exists_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -455,7 +455,7 @@ public async Task Exists_MaterializedViewsBuilderServiceGet() [Ignore("Only validating compilation of examples")] public async Task Exists_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -485,7 +485,7 @@ public async Task Exists_SqlDedicatedGatewayServiceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -527,7 +527,7 @@ public async Task GetIfExists_DataTransferServiceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -569,7 +569,7 @@ public async Task GetIfExists_GraphAPIComputeServiceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -611,7 +611,7 @@ public async Task GetIfExists_MaterializedViewsBuilderServiceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs index 453e3ce00f60..ea0d6bc6f182 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBServiceResource [Ignore("Only validating compilation of examples")] public async Task Get_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_DataTransferServiceGet() [Ignore("Only validating compilation of examples")] public async Task Get_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GraphAPIComputeServiceGet() [Ignore("Only validating compilation of examples")] public async Task Get_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task Get_MaterializedViewsBuilderServiceGet() [Ignore("Only validating compilation of examples")] public async Task Get_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,7 +144,7 @@ public async Task Get_SqlDedicatedGatewayServiceGet() [Ignore("Only validating compilation of examples")] public async Task Delete_DataTransferServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDataTransferServiceDelete.json // this example is just showing the usage of "Service_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +171,7 @@ public async Task Delete_DataTransferServiceDelete() [Ignore("Only validating compilation of examples")] public async Task Delete_GraphAPIComputeServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGraphAPIComputeServiceDelete.json // this example is just showing the usage of "Service_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -198,7 +198,7 @@ public async Task Delete_GraphAPIComputeServiceDelete() [Ignore("Only validating compilation of examples")] public async Task Delete_MaterializedViewsBuilderServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json // this example is just showing the usage of "Service_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -225,7 +225,7 @@ public async Task Delete_MaterializedViewsBuilderServiceDelete() [Ignore("Only validating compilation of examples")] public async Task Delete_SqlDedicatedGatewayServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json // this example is just showing the usage of "Service_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -252,7 +252,7 @@ public async Task Delete_SqlDedicatedGatewayServiceDelete() [Ignore("Only validating compilation of examples")] public async Task Update_DataTransferServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDataTransferServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -292,7 +292,7 @@ public async Task Update_DataTransferServiceCreate() [Ignore("Only validating compilation of examples")] public async Task Update_GraphAPIComputeServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGraphAPIComputeServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -332,7 +332,7 @@ public async Task Update_GraphAPIComputeServiceCreate() [Ignore("Only validating compilation of examples")] public async Task Update_MaterializedViewsBuilderServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -372,7 +372,7 @@ public async Task Update_MaterializedViewsBuilderServiceCreate() [Ignore("Only validating compilation of examples")] public async Task Update_SqlDedicatedGatewayServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs index 4e6300b82f8e..809609d6657f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_CosmosDBSqlClientEncryptionKeyCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBClientEncryptionKeyCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -47,7 +47,7 @@ public async Task CreateOrUpdate_CosmosDBClientEncryptionKeyCreateUpdate() { Id = "cekName", EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", - WrappedDataEncryptionKey = Encoding.UTF8.GetBytes("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), + WrappedDataEncryptionKey = Encoding.UTF8.GetBytes("U3dhZ2dlciByb2Nrcw=="), KeyWrapMetadata = new CosmosDBKeyWrapMetadata { Name = "customerManagedKey", @@ -70,7 +70,7 @@ public async Task CreateOrUpdate_CosmosDBClientEncryptionKeyCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -105,7 +105,7 @@ public async Task Get_CosmosDBClientEncryptionKeyGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBClientEncryptionKeysList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeysList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlClientEncryptionKeysList.json // this example is just showing the usage of "SqlResources_ListClientEncryptionKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -142,7 +142,7 @@ public async Task GetAll_CosmosDBClientEncryptionKeysList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +173,7 @@ public async Task Exists_CosmosDBClientEncryptionKeyGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs index cd7aa43c9f8f..9ee3c10b1ac2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs @@ -21,7 +21,7 @@ public partial class Sample_CosmosDBSqlClientEncryptionKeyResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBClientEncryptionKeyGet() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBClientEncryptionKeyCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Update_CosmosDBClientEncryptionKeyCreateUpdate() { Id = "cekName", EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", - WrappedDataEncryptionKey = Encoding.UTF8.GetBytes("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), + WrappedDataEncryptionKey = Encoding.UTF8.GetBytes("U3dhZ2dlciByb2Nrcw=="), KeyWrapMetadata = new CosmosDBKeyWrapMetadata { Name = "customerManagedKey", diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs index e44bdb37d697..d112e8c8dfd2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlContainerCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlContainerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,126 +91,20 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerCreateUpdate() Query = "SELECT VALUE LOWER(c.name) FROM c", }}, VectorEmbeddings = { new CosmosDBVectorEmbedding("/vectorPath1", CosmosDBVectorDataType.Float32, VectorDistanceFunction.Euclidean, 400), new CosmosDBVectorEmbedding("/vectorPath2", CosmosDBVectorDataType.Uint8, VectorDistanceFunction.Cosine, 512), new CosmosDBVectorEmbedding("/vectorPath3", CosmosDBVectorDataType.Int8, VectorDistanceFunction.Dotproduct, 512) }, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = { }, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerName, content); - CosmosDBSqlContainerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlContainerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_CosmosDBSqlContainerRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRestore.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseResource created on azure - // for more information of creating CosmosDBSqlDatabaseResource, please refer to the document of CosmosDBSqlDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseResourceId = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseResource cosmosDBSqlDatabase = client.GetCosmosDBSqlDatabaseResource(cosmosDBSqlDatabaseResourceId); - - // get the collection of this CosmosDBSqlContainerResource - CosmosDBSqlContainerCollection collection = cosmosDBSqlDatabase.GetCosmosDBSqlContainers(); - - // invoke the operation - string containerName = "containerName"; - CosmosDBSqlContainerCreateOrUpdateContent content = new CosmosDBSqlContainerCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlContainerResourceInfo("containerName") - { - RestoreParameters = new ResourceRestoreParameters + FullTextPolicy = new FullTextPolicy { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = true, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = { }, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerName, content); - CosmosDBSqlContainerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlContainerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_CosmosDBSqlMaterializedViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseResource created on azure - // for more information of creating CosmosDBSqlDatabaseResource, please refer to the document of CosmosDBSqlDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseResourceId = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseResource cosmosDBSqlDatabase = client.GetCosmosDBSqlDatabaseResource(cosmosDBSqlDatabaseResourceId); - - // get the collection of this CosmosDBSqlContainerResource - CosmosDBSqlContainerCollection collection = cosmosDBSqlDatabase.GetCosmosDBSqlContainers(); - - // invoke the operation - string containerName = "mvContainerName"; - CosmosDBSqlContainerCreateOrUpdateContent content = new CosmosDBSqlContainerCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlContainerResourceInfo("mvContainerName") - { - IndexingPolicy = new CosmosDBIndexingPolicy - { - IsAutomatic = true, - IndexingMode = CosmosDBIndexingMode.Consistent, - IncludedPaths = {new CosmosDBIncludedPath + DefaultLanguage = "1033", + FullTextPaths = {new FullTextPath("/ftPath1") { -Path = "/*", -Indexes = {new CosmosDBPathIndexes +Language = "en-US", +}, new FullTextPath("/ftPath2") { -DataType = CosmosDBDataType.String, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -}, new CosmosDBPathIndexes +Language = "fr-FR", +}, new FullTextPath("/ftPath3") { -DataType = CosmosDBDataType.Number, -Precision = -1, -Kind = CosmosDBIndexKind.Range, +Language = "de-DE", }}, -}}, - ExcludedPaths = { }, - }, - PartitionKey = new CosmosDBContainerPartitionKey - { - Paths = { "/mvpk" }, - Kind = CosmosDBPartitionKind.Hash, }, - MaterializedViewDefinition = new MaterializedViewDefinition("sourceContainerName", "select * from ROOT"), }) { Options = new CosmosDBCreateUpdateConfig(), @@ -230,7 +124,7 @@ public async Task CreateOrUpdate_CosmosDBSqlMaterializedViewCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -265,7 +159,7 @@ public async Task Get_CosmosDBSqlContainerGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlContainerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerList.json // this example is just showing the usage of "SqlResources_ListSqlContainers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -302,7 +196,7 @@ public async Task GetAll_CosmosDBSqlContainerList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -333,7 +227,7 @@ public async Task Exists_CosmosDBSqlContainerGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs index 69d64a9836cd..1b3573976c13 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlContainerResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlContainerGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlContainerDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_CosmosDBSqlContainerDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlContainerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -148,120 +148,20 @@ public async Task Update_CosmosDBSqlContainerCreateUpdate() Query = "SELECT VALUE LOWER(c.name) FROM c", }}, VectorEmbeddings = { new CosmosDBVectorEmbedding("/vectorPath1", CosmosDBVectorDataType.Float32, VectorDistanceFunction.Euclidean, 400), new CosmosDBVectorEmbedding("/vectorPath2", CosmosDBVectorDataType.Uint8, VectorDistanceFunction.Cosine, 512), new CosmosDBVectorEmbedding("/vectorPath3", CosmosDBVectorDataType.Int8, VectorDistanceFunction.Dotproduct, 512) }, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = { }, - }; - ArmOperation lro = await cosmosDBSqlContainer.UpdateAsync(WaitUntil.Completed, content); - CosmosDBSqlContainerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlContainerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Update_CosmosDBSqlContainerRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRestore.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerResource created on azure - // for more information of creating CosmosDBSqlContainerResource, please refer to the document of CosmosDBSqlContainerResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "containerName"; - ResourceIdentifier cosmosDBSqlContainerResourceId = CosmosDBSqlContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerResource cosmosDBSqlContainer = client.GetCosmosDBSqlContainerResource(cosmosDBSqlContainerResourceId); - - // invoke the operation - CosmosDBSqlContainerCreateOrUpdateContent content = new CosmosDBSqlContainerCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlContainerResourceInfo("containerName") - { - RestoreParameters = new ResourceRestoreParameters + FullTextPolicy = new FullTextPolicy { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = true, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = { }, - }; - ArmOperation lro = await cosmosDBSqlContainer.UpdateAsync(WaitUntil.Completed, content); - CosmosDBSqlContainerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlContainerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Update_CosmosDBSqlMaterializedViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerResource created on azure - // for more information of creating CosmosDBSqlContainerResource, please refer to the document of CosmosDBSqlContainerResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "mvContainerName"; - ResourceIdentifier cosmosDBSqlContainerResourceId = CosmosDBSqlContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerResource cosmosDBSqlContainer = client.GetCosmosDBSqlContainerResource(cosmosDBSqlContainerResourceId); - - // invoke the operation - CosmosDBSqlContainerCreateOrUpdateContent content = new CosmosDBSqlContainerCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlContainerResourceInfo("mvContainerName") - { - IndexingPolicy = new CosmosDBIndexingPolicy - { - IsAutomatic = true, - IndexingMode = CosmosDBIndexingMode.Consistent, - IncludedPaths = {new CosmosDBIncludedPath + DefaultLanguage = "1033", + FullTextPaths = {new FullTextPath("/ftPath1") { -Path = "/*", -Indexes = {new CosmosDBPathIndexes +Language = "en-US", +}, new FullTextPath("/ftPath2") { -DataType = CosmosDBDataType.String, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -}, new CosmosDBPathIndexes +Language = "fr-FR", +}, new FullTextPath("/ftPath3") { -DataType = CosmosDBDataType.Number, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -}}, +Language = "de-DE", }}, - ExcludedPaths = { }, }, - PartitionKey = new CosmosDBContainerPartitionKey - { - Paths = { "/mvpk" }, - Kind = CosmosDBPartitionKind.Hash, - }, - MaterializedViewDefinition = new MaterializedViewDefinition("sourceContainerName", "select * from ROOT"), }) { Options = new CosmosDBCreateUpdateConfig(), @@ -277,44 +177,11 @@ public async Task Update_CosmosDBSqlMaterializedViewCreateUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetSqlContainerPartitionMerge_CosmosDBSqlContainerPartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerPartitionMerge.json - // this example is just showing the usage of "SqlResources_ListSqlContainerPartitionMerge" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerResource created on azure - // for more information of creating CosmosDBSqlContainerResource, please refer to the document of CosmosDBSqlContainerResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "containerName"; - ResourceIdentifier cosmosDBSqlContainerResourceId = CosmosDBSqlContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerResource cosmosDBSqlContainer = client.GetCosmosDBSqlContainerResource(cosmosDBSqlContainerResourceId); - - // invoke the operation - MergeParameters mergeParameters = new MergeParameters - { - IsDryRun = false, - }; - ArmOperation lro = await cosmosDBSqlContainer.GetSqlContainerPartitionMergeAsync(WaitUntil.Completed, mergeParameters); - PhysicalPartitionStorageInfoCollection result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - [Test] [Ignore("Only validating compilation of examples")] public async Task RetrieveContinuousBackupInformation_CosmosDBSqlContainerBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerBackupInformation.json // this example is just showing the usage of "SqlResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs index e1dd01f0ac5f..d6491ffdb16d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; using NUnit.Framework; namespace Azure.ResourceManager.CosmosDB.Samples @@ -21,7 +20,7 @@ public partial class Sample_CosmosDBSqlContainerThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlContainerThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerThroughputGet.json // this example is just showing the usage of "SqlResources_GetSqlContainerThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +52,7 @@ public async Task Get_CosmosDBSqlContainerThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlContainerThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerThroughputUpdate.json // this example is just showing the usage of "SqlResources_UpdateSqlContainerThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +92,7 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateSqlContainerToAutoscale_CosmosDBSqlContainerMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerMigrateToAutoscale.json // this example is just showing the usage of "SqlResources_MigrateSqlContainerToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +125,7 @@ public async Task MigrateSqlContainerToAutoscale_CosmosDBSqlContainerMigrateToAu [Ignore("Only validating compilation of examples")] public async Task MigrateSqlContainerToManualThroughput_CosmosDBSqlContainerMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlContainerMigrateToManualThroughput.json // this example is just showing the usage of "SqlResources_MigrateSqlContainerToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -154,92 +153,5 @@ public async Task MigrateSqlContainerToManualThroughput_CosmosDBSqlContainerMigr // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task SqlContainerRetrieveThroughputDistribution_CosmosDBSqlContainerRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json - // this example is just showing the usage of "SqlResources_SqlContainerRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerThroughputSettingResource created on azure - // for more information of creating CosmosDBSqlContainerThroughputSettingResource, please refer to the document of CosmosDBSqlContainerThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "containerName"; - ResourceIdentifier cosmosDBSqlContainerThroughputSettingResourceId = CosmosDBSqlContainerThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerThroughputSettingResource cosmosDBSqlContainerThroughputSetting = client.GetCosmosDBSqlContainerThroughputSettingResource(cosmosDBSqlContainerThroughputSettingResourceId); - - // invoke the operation - RetrieveThroughputParameters retrieveThroughputParameters = new RetrieveThroughputParameters(default, new RetrieveThroughputPropertiesResource(new WritableSubResource[] - { -new WritableSubResource -{ -Id = new ResourceIdentifier("0"), -}, -new WritableSubResource -{ -Id = new ResourceIdentifier("1"), -} - })); - ArmOperation lro = await cosmosDBSqlContainerThroughputSetting.SqlContainerRetrieveThroughputDistributionAsync(WaitUntil.Completed, retrieveThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task SqlContainerRedistributeThroughput_CosmosDBSqlContainerRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json - // this example is just showing the usage of "SqlResources_SqlContainerRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerThroughputSettingResource created on azure - // for more information of creating CosmosDBSqlContainerThroughputSettingResource, please refer to the document of CosmosDBSqlContainerThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "containerName"; - ResourceIdentifier cosmosDBSqlContainerThroughputSettingResourceId = CosmosDBSqlContainerThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerThroughputSettingResource cosmosDBSqlContainerThroughputSetting = client.GetCosmosDBSqlContainerThroughputSettingResource(cosmosDBSqlContainerThroughputSettingResourceId); - - // invoke the operation - RedistributeThroughputParameters redistributeThroughputParameters = new RedistributeThroughputParameters(default, new RedistributeThroughputPropertiesResource(ThroughputPolicyType.Custom, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("0") -{ -Throughput = 5000, -}, -new PhysicalPartitionThroughputInfoResource("1") -{ -Throughput = 5000, -} - }, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("2") -{ -Throughput = 5000, -}, -new PhysicalPartitionThroughputInfoResource("3") - })); - ArmOperation lro = await cosmosDBSqlContainerThroughputSetting.SqlContainerRedistributeThroughputAsync(WaitUntil.Completed, redistributeThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs index 80934d4c576c..81c42f20a146 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlDatabaseCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,60 +56,11 @@ public async Task CreateOrUpdate_CosmosDBSqlDatabaseCreateUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_CosmosDBSqlDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRestore.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this CosmosDBSqlDatabaseResource - CosmosDBSqlDatabaseCollection collection = cosmosDBAccount.GetCosmosDBSqlDatabases(); - - // invoke the operation - string databaseName = "databaseName"; - CosmosDBSqlDatabaseCreateOrUpdateContent content = new CosmosDBSqlDatabaseCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlDatabaseResourceInfo("databaseName") - { - RestoreParameters = new ResourceRestoreParameters - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = true, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = { }, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseName, content); - CosmosDBSqlDatabaseResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlDatabaseData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - [Test] [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -143,7 +94,7 @@ public async Task Get_CosmosDBSqlDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseList.json // this example is just showing the usage of "SqlResources_ListSqlDatabases" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -179,7 +130,7 @@ public async Task GetAll_CosmosDBSqlDatabaseList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -209,7 +160,7 @@ public async Task Exists_CosmosDBSqlDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs index ec70262c1d94..2af86e6651d6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlDatabaseResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBSqlDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBSqlDatabaseDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -110,83 +110,5 @@ public async Task Update_CosmosDBSqlDatabaseCreateUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Update_CosmosDBSqlDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRestore.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseResource created on azure - // for more information of creating CosmosDBSqlDatabaseResource, please refer to the document of CosmosDBSqlDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseResourceId = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseResource cosmosDBSqlDatabase = client.GetCosmosDBSqlDatabaseResource(cosmosDBSqlDatabaseResourceId); - - // invoke the operation - CosmosDBSqlDatabaseCreateOrUpdateContent content = new CosmosDBSqlDatabaseCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlDatabaseResourceInfo("databaseName") - { - RestoreParameters = new ResourceRestoreParameters - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = true, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = { }, - }; - ArmOperation lro = await cosmosDBSqlDatabase.UpdateAsync(WaitUntil.Completed, content); - CosmosDBSqlDatabaseResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlDatabaseData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task SqlDatabasePartitionMerge_CosmosDBSqlDatabasePartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabasePartitionMerge.json - // this example is just showing the usage of "SqlResources_SqlDatabasePartitionMerge" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseResource created on azure - // for more information of creating CosmosDBSqlDatabaseResource, please refer to the document of CosmosDBSqlDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseResourceId = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseResource cosmosDBSqlDatabase = client.GetCosmosDBSqlDatabaseResource(cosmosDBSqlDatabaseResourceId); - - // invoke the operation - MergeParameters mergeParameters = new MergeParameters - { - IsDryRun = false, - }; - ArmOperation lro = await cosmosDBSqlDatabase.SqlDatabasePartitionMergeAsync(WaitUntil.Completed, mergeParameters); - PhysicalPartitionStorageInfoCollection result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs index 4608c0b76459..3fa82d891520 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; using NUnit.Framework; namespace Azure.ResourceManager.CosmosDB.Samples @@ -21,7 +20,7 @@ public partial class Sample_CosmosDBSqlDatabaseThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseThroughputGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +51,7 @@ public async Task Get_CosmosDBSqlDatabaseThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseThroughputUpdate.json // this example is just showing the usage of "SqlResources_UpdateSqlDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +90,7 @@ public async Task CreateOrUpdate_CosmosDBSqlDatabaseThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateSqlDatabaseToAutoscale_CosmosDBSqlDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json // this example is just showing the usage of "SqlResources_MigrateSqlDatabaseToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +122,7 @@ public async Task MigrateSqlDatabaseToAutoscale_CosmosDBSqlDatabaseMigrateToAuto [Ignore("Only validating compilation of examples")] public async Task MigrateSqlDatabaseToManualThroughput_CosmosDBSqlDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json // this example is just showing the usage of "SqlResources_MigrateSqlDatabaseToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -150,90 +149,5 @@ public async Task MigrateSqlDatabaseToManualThroughput_CosmosDBSqlDatabaseMigrat // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task SqlDatabaseRetrieveThroughputDistribution_CosmosDBSqlDatabaseRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json - // this example is just showing the usage of "SqlResources_SqlDatabaseRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseThroughputSettingResource created on azure - // for more information of creating CosmosDBSqlDatabaseThroughputSettingResource, please refer to the document of CosmosDBSqlDatabaseThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseThroughputSettingResourceId = CosmosDBSqlDatabaseThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseThroughputSettingResource cosmosDBSqlDatabaseThroughputSetting = client.GetCosmosDBSqlDatabaseThroughputSettingResource(cosmosDBSqlDatabaseThroughputSettingResourceId); - - // invoke the operation - RetrieveThroughputParameters retrieveThroughputParameters = new RetrieveThroughputParameters(default, new RetrieveThroughputPropertiesResource(new WritableSubResource[] - { -new WritableSubResource -{ -Id = new ResourceIdentifier("0"), -}, -new WritableSubResource -{ -Id = new ResourceIdentifier("1"), -} - })); - ArmOperation lro = await cosmosDBSqlDatabaseThroughputSetting.SqlDatabaseRetrieveThroughputDistributionAsync(WaitUntil.Completed, retrieveThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task SqlDatabaseRedistributeThroughput_CosmosDBSqlDatabaseRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json - // this example is just showing the usage of "SqlResources_SqlDatabaseRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseThroughputSettingResource created on azure - // for more information of creating CosmosDBSqlDatabaseThroughputSettingResource, please refer to the document of CosmosDBSqlDatabaseThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseThroughputSettingResourceId = CosmosDBSqlDatabaseThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseThroughputSettingResource cosmosDBSqlDatabaseThroughputSetting = client.GetCosmosDBSqlDatabaseThroughputSettingResource(cosmosDBSqlDatabaseThroughputSettingResourceId); - - // invoke the operation - RedistributeThroughputParameters redistributeThroughputParameters = new RedistributeThroughputParameters(default, new RedistributeThroughputPropertiesResource(ThroughputPolicyType.Custom, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("0") -{ -Throughput = 5000, -}, -new PhysicalPartitionThroughputInfoResource("1") -{ -Throughput = 5000, -} - }, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("2") -{ -Throughput = 5000, -}, -new PhysicalPartitionThroughputInfoResource("3") - })); - ArmOperation lro = await cosmosDBSqlDatabaseThroughputSetting.SqlDatabaseRedistributeThroughputAsync(WaitUntil.Completed, redistributeThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs index c4066ec1d652..452bdfec01d3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleAssignmentCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlRoleAssignmentCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task CreateOrUpdate_CosmosDBSqlRoleAssignmentCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Get_CosmosDBSqlRoleAssignmentGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlRoleAssignmentList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleAssignmentList.json // this example is just showing the usage of "SqlResources_ListSqlRoleAssignments" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task GetAll_CosmosDBSqlRoleAssignmentList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -161,7 +161,7 @@ public async Task Exists_CosmosDBSqlRoleAssignmentGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs index 34eb19794f2f..d73f4d2cc07f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleAssignmentResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBSqlRoleAssignmentGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlRoleAssignmentDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleAssignmentDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBSqlRoleAssignmentDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlRoleAssignmentCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs index d6020dc363df..15765cabe1fb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleDefinitionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task CreateOrUpdate_CosmosDBSqlRoleDefinitionCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Get_CosmosDBSqlRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlRoleDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleDefinitionList.json // this example is just showing the usage of "SqlResources_ListSqlRoleDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,7 +136,7 @@ public async Task GetAll_CosmosDBSqlRoleDefinitionList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task Exists_CosmosDBSqlRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs index 82c4452341c9..e77f32336e44 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleDefinitionResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBSqlRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlRoleDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleDefinitionDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBSqlRoleDefinitionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs index 33b9e41a4f86..3af14bcd4cad 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlStoredProcedureCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlStoredProcedureCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_CosmosDBSqlStoredProcedureCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Get_CosmosDBSqlStoredProcedureGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlStoredProcedureList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlStoredProcedureList.json // this example is just showing the usage of "SqlResources_ListSqlStoredProcedures" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task GetAll_CosmosDBSqlStoredProcedureList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task Exists_CosmosDBSqlStoredProcedureGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs index d0e29fccc47c..105bef26b5c7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlStoredProcedureResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBSqlStoredProcedureGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlStoredProcedureDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlStoredProcedureDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Delete_CosmosDBSqlStoredProcedureDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlStoredProcedureCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs index 2b44404c1efc..6018e166e498 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlTriggerCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlTriggerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlTriggerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task CreateOrUpdate_CosmosDBSqlTriggerCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Get_CosmosDBSqlTriggerGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlTriggerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlTriggerList.json // this example is just showing the usage of "SqlResources_ListSqlTriggers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +140,7 @@ public async Task GetAll_CosmosDBSqlTriggerList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +172,7 @@ public async Task Exists_CosmosDBSqlTriggerGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs index 2b58fee85029..efb7a7ec0301 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlTriggerResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBSqlTriggerGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlTriggerDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlTriggerDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Delete_CosmosDBSqlTriggerDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlTriggerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlTriggerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs index 604ca11d42a6..33c243a14aeb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlUserDefinedFunctionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlUserDefinedFunctionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_CosmosDBSqlUserDefinedFunctionCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Get_CosmosDBSqlUserDefinedFunctionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlUserDefinedFunctionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlUserDefinedFunctionList.json // this example is just showing the usage of "SqlResources_ListSqlUserDefinedFunctions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task GetAll_CosmosDBSqlUserDefinedFunctionList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task Exists_CosmosDBSqlUserDefinedFunctionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs index a07e69b843cf..72e456484916 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlUserDefinedFunctionResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBSqlUserDefinedFunctionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlUserDefinedFunctionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlUserDefinedFunctionDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Delete_CosmosDBSqlUserDefinedFunctionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlUserDefinedFunctionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs index 1b728fa953d1..18b4daba3a76 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBTableCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBTableReplace() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableCreateUpdate.json // this example is just showing the usage of "TableResources_CreateUpdateTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CosmosDBTableReplace() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBTableGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableList.json // this example is just showing the usage of "TableResources_ListTables" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task GetAll_CosmosDBTableList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Exists_CosmosDBTableGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs index e5949e649c7d..5436c7c4ae65 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBTableResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBTableGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBTableDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableDelete.json // this example is just showing the usage of "TableResources_DeleteTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBTableDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBTableReplace() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableCreateUpdate.json // this example is just showing the usage of "TableResources_CreateUpdateTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task Update_CosmosDBTableReplace() [Ignore("Only validating compilation of examples")] public async Task RetrieveContinuousBackupInformation_CosmosDBTableCollectionBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableBackupInformation.json // this example is just showing the usage of "TableResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs index a0fb1423ca10..f1810afaa67b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosTableThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBTableThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableThroughputGet.json // this example is just showing the usage of "TableResources_GetTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBTableThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBTableThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableThroughputUpdate.json // this example is just showing the usage of "TableResources_UpdateTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task CreateOrUpdate_CosmosDBTableThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateTableToAutoscale_CosmosDBTableMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableMigrateToAutoscale.json // this example is just showing the usage of "TableResources_MigrateTableToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task MigrateTableToAutoscale_CosmosDBTableMigrateToAutoscale() [Ignore("Only validating compilation of examples")] public async Task MigrateTableToManualThroughput_CosmosDBTableMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBTableMigrateToManualThroughput.json // this example is just showing the usage of "TableResources_MigrateTableToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs index bf6dc36a5acb..1ab3487c70fd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinDatabaseCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBGremlinDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinDatabaseCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBGremlinDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBGremlinDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseList.json // this example is just showing the usage of "GremlinResources_ListGremlinDatabases" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task GetAll_CosmosDBGremlinDatabaseList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Exists_CosmosDBGremlinDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs index 461f35873636..3a77ca56db3b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinDatabaseResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBGremlinDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBGremlinDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseDelete.json // this example is just showing the usage of "GremlinResources_DeleteGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBGremlinDatabaseDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBGremlinDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs index 8b42068668db..dfee84240a31 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinDatabaseThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBGremlinDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseThroughputGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBGremlinDatabaseThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBGremlinDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json // this example is just showing the usage of "GremlinResources_UpdateGremlinDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinDatabaseThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateGremlinDatabaseToAutoscale_CosmosDBGremlinDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json // this example is just showing the usage of "GremlinResources_MigrateGremlinDatabaseToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task MigrateGremlinDatabaseToAutoscale_CosmosDBGremlinDatabaseMigra [Ignore("Only validating compilation of examples")] public async Task MigrateGremlinDatabaseToManualThroughput_CosmosDBGremlinDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json // this example is just showing the usage of "GremlinResources_MigrateGremlinDatabaseToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs index dbf30aa4c0d8..2877167b0069 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinGraphCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBGremlinGraphCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinGraphCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task Get_CosmosDBGremlinGraphGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBGremlinGraphList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphList.json // this example is just showing the usage of "GremlinResources_ListGremlinGraphs" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +171,7 @@ public async Task GetAll_CosmosDBGremlinGraphList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -202,7 +202,7 @@ public async Task Exists_CosmosDBGremlinGraphGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs index d143117bd4f6..2c8358a1d586 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinGraphResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBGremlinGraphGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBGremlinGraphDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphDelete.json // this example is just showing the usage of "GremlinResources_DeleteGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_CosmosDBGremlinGraphDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBGremlinGraphCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task Update_CosmosDBGremlinGraphCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task RetrieveContinuousBackupInformation_CosmosDBGremlinGraphBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphBackupInformation.json // this example is just showing the usage of "GremlinResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs index 25dee4b7a9b8..f61778741937 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinGraphThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBGremlinGraphThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphThroughputGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraphThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBGremlinGraphThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBGremlinGraphThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphThroughputUpdate.json // this example is just showing the usage of "GremlinResources_UpdateGremlinGraphThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinGraphThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateGremlinGraphToAutoscale_CosmosDBGremlinGraphMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json // this example is just showing the usage of "GremlinResources_MigrateGremlinGraphToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task MigrateGremlinGraphToAutoscale_CosmosDBGremlinGraphMigrateToAu [Ignore("Only validating compilation of examples")] public async Task MigrateGremlinGraphToManualThroughput_CosmosDBGremlinGraphMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json // this example is just showing the usage of "GremlinResources_MigrateGremlinGraphToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs index 799b5f3704cb..9eda31e5a9bf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBCollectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBCollectionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,57 +60,6 @@ public async Task CreateOrUpdate_CosmosDBMongoDBCollectionCreateUpdate() { Keys = {"_id"}, }}, - AnalyticalStorageTtl = 500, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = { }, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, collectionName, content); - MongoDBCollectionResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MongoDBCollectionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_CosmosDBMongoDBCollectionRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRestore.json - // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseResource created on azure - // for more information of creating MongoDBDatabaseResource, please refer to the document of MongoDBDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseResourceId = MongoDBDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseResource mongoDBDatabase = client.GetMongoDBDatabaseResource(mongoDBDatabaseResourceId); - - // get the collection of this MongoDBCollectionResource - MongoDBCollectionCollection collection = mongoDBDatabase.GetMongoDBCollections(); - - // invoke the operation - string collectionName = "collectionName"; - MongoDBCollectionCreateOrUpdateContent content = new MongoDBCollectionCreateOrUpdateContent(new AzureLocation("West US"), new MongoDBCollectionResourceInfo("collectionName") - { - RestoreParameters = new ResourceRestoreParameters - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = false, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, }) { Options = new CosmosDBCreateUpdateConfig(), @@ -130,7 +79,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBCollectionRestore() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +114,7 @@ public async Task Get_CosmosDBMongoDBCollectionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBMongoDBCollectionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionList.json // this example is just showing the usage of "MongoDBResources_ListMongoDBCollections" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -202,7 +151,7 @@ public async Task GetAll_CosmosDBMongoDBCollectionList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -233,7 +182,7 @@ public async Task Exists_CosmosDBMongoDBCollectionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs index 6400feeb358e..ed0bfd517ca4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBCollectionResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBMongoDBCollectionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBMongoDBCollectionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_CosmosDBMongoDBCollectionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBMongoDBCollectionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,6 @@ public async Task Update_CosmosDBMongoDBCollectionCreateUpdate() { Keys = {"_id"}, }}, - AnalyticalStorageTtl = 500, }) { Options = new CosmosDBCreateUpdateConfig(), @@ -133,91 +132,11 @@ public async Task Update_CosmosDBMongoDBCollectionCreateUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Update_CosmosDBMongoDBCollectionRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRestore.json - // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBCollectionResource created on azure - // for more information of creating MongoDBCollectionResource, please refer to the document of MongoDBCollectionResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string collectionName = "collectionName"; - ResourceIdentifier mongoDBCollectionResourceId = MongoDBCollectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, collectionName); - MongoDBCollectionResource mongoDBCollection = client.GetMongoDBCollectionResource(mongoDBCollectionResourceId); - - // invoke the operation - MongoDBCollectionCreateOrUpdateContent content = new MongoDBCollectionCreateOrUpdateContent(new AzureLocation("West US"), new MongoDBCollectionResourceInfo("collectionName") - { - RestoreParameters = new ResourceRestoreParameters - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = false, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = { }, - }; - ArmOperation lro = await mongoDBCollection.UpdateAsync(WaitUntil.Completed, content); - MongoDBCollectionResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MongoDBCollectionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetMongoDBCollectionPartitionMerge_CosmosDBMongoDBCollectionPartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json - // this example is just showing the usage of "MongoDBResources_ListMongoDBCollectionPartitionMerge" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBCollectionResource created on azure - // for more information of creating MongoDBCollectionResource, please refer to the document of MongoDBCollectionResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string collectionName = "collectionName"; - ResourceIdentifier mongoDBCollectionResourceId = MongoDBCollectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, collectionName); - MongoDBCollectionResource mongoDBCollection = client.GetMongoDBCollectionResource(mongoDBCollectionResourceId); - - // invoke the operation - MergeParameters mergeParameters = new MergeParameters - { - IsDryRun = false, - }; - ArmOperation lro = await mongoDBCollection.GetMongoDBCollectionPartitionMergeAsync(WaitUntil.Completed, mergeParameters); - PhysicalPartitionStorageInfoCollection result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - [Test] [Ignore("Only validating compilation of examples")] public async Task RetrieveContinuousBackupInformation_CosmosDBMongoDBCollectionBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionBackupInformation.json // this example is just showing the usage of "MongoDBResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs index d34a315a59d6..147c05ddca54 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; using NUnit.Framework; namespace Azure.ResourceManager.CosmosDB.Samples @@ -21,7 +20,7 @@ public partial class Sample_MongoDBCollectionThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBCollectionThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionThroughputGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollectionThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +52,7 @@ public async Task Get_CosmosDBMongoDBCollectionThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBCollectionThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json // this example is just showing the usage of "MongoDBResources_UpdateMongoDBCollectionThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,98 +88,11 @@ public async Task CreateOrUpdate_CosmosDBMongoDBCollectionThroughputUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - [Test] - [Ignore("Only validating compilation of examples")] - public async Task MongoDBContainerRetrieveThroughputDistribution_CosmosDBMongoDBCollectionRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json - // this example is just showing the usage of "MongoDBResources_MongoDBContainerRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBCollectionThroughputSettingResource created on azure - // for more information of creating MongoDBCollectionThroughputSettingResource, please refer to the document of MongoDBCollectionThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string collectionName = "collectionName"; - ResourceIdentifier mongoDBCollectionThroughputSettingResourceId = MongoDBCollectionThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, collectionName); - MongoDBCollectionThroughputSettingResource mongoDBCollectionThroughputSetting = client.GetMongoDBCollectionThroughputSettingResource(mongoDBCollectionThroughputSettingResourceId); - - // invoke the operation - RetrieveThroughputParameters retrieveThroughputParameters = new RetrieveThroughputParameters(default, new RetrieveThroughputPropertiesResource(new WritableSubResource[] - { -new WritableSubResource -{ -Id = new ResourceIdentifier("0"), -}, -new WritableSubResource -{ -Id = new ResourceIdentifier("1"), -} - })); - ArmOperation lro = await mongoDBCollectionThroughputSetting.MongoDBContainerRetrieveThroughputDistributionAsync(WaitUntil.Completed, retrieveThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task MongoDBContainerRedistributeThroughput_CosmosDBMongoDBCollectionRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json - // this example is just showing the usage of "MongoDBResources_MongoDBContainerRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBCollectionThroughputSettingResource created on azure - // for more information of creating MongoDBCollectionThroughputSettingResource, please refer to the document of MongoDBCollectionThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string collectionName = "collectionName"; - ResourceIdentifier mongoDBCollectionThroughputSettingResourceId = MongoDBCollectionThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, collectionName); - MongoDBCollectionThroughputSettingResource mongoDBCollectionThroughputSetting = client.GetMongoDBCollectionThroughputSettingResource(mongoDBCollectionThroughputSettingResourceId); - - // invoke the operation - RedistributeThroughputParameters redistributeThroughputParameters = new RedistributeThroughputParameters(default, new RedistributeThroughputPropertiesResource(ThroughputPolicyType.Custom, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("0") -{ -Throughput = 5000, -}, -new PhysicalPartitionThroughputInfoResource("1") -{ -Throughput = 5000, -} - }, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("2") -{ -Throughput = 5000, -}, -new PhysicalPartitionThroughputInfoResource("3") - })); - ArmOperation lro = await mongoDBCollectionThroughputSetting.MongoDBContainerRedistributeThroughputAsync(WaitUntil.Completed, redistributeThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - [Test] [Ignore("Only validating compilation of examples")] public async Task MigrateMongoDBCollectionToAutoscale_CosmosDBMongoDBCollectionMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBCollectionToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -213,7 +125,7 @@ public async Task MigrateMongoDBCollectionToAutoscale_CosmosDBMongoDBCollectionM [Ignore("Only validating compilation of examples")] public async Task MigrateMongoDBCollectionToManualThroughput_CosmosDBMongoDBCollectionMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBCollectionToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs index e2578904fc32..33643490b235 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBDatabaseCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,60 +56,11 @@ public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseCreateUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRestore.json - // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this MongoDBDatabaseResource - MongoDBDatabaseCollection collection = cosmosDBAccount.GetMongoDBDatabases(); - - // invoke the operation - string databaseName = "databaseName"; - MongoDBDatabaseCreateOrUpdateContent content = new MongoDBDatabaseCreateOrUpdateContent(new AzureLocation("West US"), new MongoDBDatabaseResourceInfo("databaseName") - { - RestoreParameters = new ResourceRestoreParameters - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = false, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = { }, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseName, content); - MongoDBDatabaseResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MongoDBDatabaseData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - [Test] [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -143,7 +94,7 @@ public async Task Get_CosmosDBMongoDBDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBMongoDBDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseList.json // this example is just showing the usage of "MongoDBResources_ListMongoDBDatabases" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -179,7 +130,7 @@ public async Task GetAll_CosmosDBMongoDBDatabaseList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -209,7 +160,7 @@ public async Task Exists_CosmosDBMongoDBDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs index 433671f7532f..e82924793e48 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBDatabaseResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBMongoDBDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBMongoDBDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBMongoDBDatabaseDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBMongoDBDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -110,83 +110,5 @@ public async Task Update_CosmosDBMongoDBDatabaseCreateUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Update_CosmosDBMongoDBDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRestore.json - // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseResource created on azure - // for more information of creating MongoDBDatabaseResource, please refer to the document of MongoDBDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseResourceId = MongoDBDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseResource mongoDBDatabase = client.GetMongoDBDatabaseResource(mongoDBDatabaseResourceId); - - // invoke the operation - MongoDBDatabaseCreateOrUpdateContent content = new MongoDBDatabaseCreateOrUpdateContent(new AzureLocation("West US"), new MongoDBDatabaseResourceInfo("databaseName") - { - RestoreParameters = new ResourceRestoreParameters - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = false, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = { }, - }; - ArmOperation lro = await mongoDBDatabase.UpdateAsync(WaitUntil.Completed, content); - MongoDBDatabaseResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MongoDBDatabaseData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task MongoDBDatabasePartitionMerge_CosmosDBMongoDBDatabasePartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json - // this example is just showing the usage of "MongoDBResources_MongoDBDatabasePartitionMerge" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseResource created on azure - // for more information of creating MongoDBDatabaseResource, please refer to the document of MongoDBDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseResourceId = MongoDBDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseResource mongoDBDatabase = client.GetMongoDBDatabaseResource(mongoDBDatabaseResourceId); - - // invoke the operation - MergeParameters mergeParameters = new MergeParameters - { - IsDryRun = false, - }; - ArmOperation lro = await mongoDBDatabase.MongoDBDatabasePartitionMergeAsync(WaitUntil.Completed, mergeParameters); - PhysicalPartitionStorageInfoCollection result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs index 35179d19b259..d488f4cd714a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; using NUnit.Framework; namespace Azure.ResourceManager.CosmosDB.Samples @@ -21,7 +20,7 @@ public partial class Sample_MongoDBDatabaseThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +51,7 @@ public async Task Get_CosmosDBMongoDBDatabaseThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json // this example is just showing the usage of "MongoDBResources_UpdateMongoDBDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +90,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateMongoDBDatabaseToAutoscale_CosmosDBMongoDBDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBDatabaseToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +122,7 @@ public async Task MigrateMongoDBDatabaseToAutoscale_CosmosDBMongoDBDatabaseMigra [Ignore("Only validating compilation of examples")] public async Task MigrateMongoDBDatabaseToManualThroughput_CosmosDBMongoDBDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBDatabaseToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -150,90 +149,5 @@ public async Task MigrateMongoDBDatabaseToManualThroughput_CosmosDBMongoDBDataba // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task MongoDBDatabaseRetrieveThroughputDistribution_CosmosDBMongoDBDatabaseRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json - // this example is just showing the usage of "MongoDBResources_MongoDBDatabaseRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseThroughputSettingResource created on azure - // for more information of creating MongoDBDatabaseThroughputSettingResource, please refer to the document of MongoDBDatabaseThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseThroughputSettingResourceId = MongoDBDatabaseThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseThroughputSettingResource mongoDBDatabaseThroughputSetting = client.GetMongoDBDatabaseThroughputSettingResource(mongoDBDatabaseThroughputSettingResourceId); - - // invoke the operation - RetrieveThroughputParameters retrieveThroughputParameters = new RetrieveThroughputParameters(default, new RetrieveThroughputPropertiesResource(new WritableSubResource[] - { -new WritableSubResource -{ -Id = new ResourceIdentifier("0"), -}, -new WritableSubResource -{ -Id = new ResourceIdentifier("1"), -} - })); - ArmOperation lro = await mongoDBDatabaseThroughputSetting.MongoDBDatabaseRetrieveThroughputDistributionAsync(WaitUntil.Completed, retrieveThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task MongoDBDatabaseRedistributeThroughput_CosmosDBMongoDBDatabaseRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json - // this example is just showing the usage of "MongoDBResources_MongoDBDatabaseRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseThroughputSettingResource created on azure - // for more information of creating MongoDBDatabaseThroughputSettingResource, please refer to the document of MongoDBDatabaseThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseThroughputSettingResourceId = MongoDBDatabaseThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseThroughputSettingResource mongoDBDatabaseThroughputSetting = client.GetMongoDBDatabaseThroughputSettingResource(mongoDBDatabaseThroughputSettingResourceId); - - // invoke the operation - RedistributeThroughputParameters redistributeThroughputParameters = new RedistributeThroughputParameters(default, new RedistributeThroughputPropertiesResource(ThroughputPolicyType.Custom, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("0") -{ -Throughput = 5000, -}, -new PhysicalPartitionThroughputInfoResource("1") -{ -Throughput = 5000, -} - }, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("2") -{ -Throughput = 5000, -}, -new PhysicalPartitionThroughputInfoResource("3") - })); - ArmOperation lro = await mongoDBDatabaseThroughputSetting.MongoDBDatabaseRedistributeThroughputAsync(WaitUntil.Completed, redistributeThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs index 5e4ecb88f2a3..0eb6328ac1ed 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBRoleDefinitionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -74,7 +74,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBRoleDefinitionCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +108,7 @@ public async Task Get_CosmosDBMongoRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBMongoDBRoleDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBRoleDefinitionList.json // this example is just showing the usage of "MongoDBResources_ListMongoRoleDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,7 +144,7 @@ public async Task GetAll_CosmosDBMongoDBRoleDefinitionList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task Exists_CosmosDBMongoRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs index 2a12fe979966..e724f29b3038 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBRoleDefinitionResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBMongoRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBMongoDBRoleDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBRoleDefinitionDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBMongoDBRoleDefinitionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBMongoDBRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs index 2fd33e251d99..bbf377cfefad 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBUserDefinitionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBUserDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBUserDefinitionCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Get_CosmosDBMongoDBUserDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBMongoDBUserDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBUserDefinitionList.json // this example is just showing the usage of "MongoDBResources_ListMongoUserDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task GetAll_CosmosDBMongoDBUserDefinitionList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task Exists_CosmosDBMongoDBUserDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs index 2106616e2805..aa6726a38026 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBUserDefinitionResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBMongoDBUserDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBMongoDBUserDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBUserDefinitionDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBMongoDBUserDefinitionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBMongoDBUserDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs index 9d85c808897b..67ba599ad404 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_RestorableCosmosDBAccountCollection [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBRestorableDatabaseAccountGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBRestorableDatabaseAccountList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableDatabaseAccountList.json // this example is just showing the usage of "RestorableDatabaseAccounts_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task GetAll_CosmosDBRestorableDatabaseAccountList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,7 +116,7 @@ public async Task Exists_CosmosDBRestorableDatabaseAccountGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs index 08ae1235b143..451360dd025a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs @@ -20,7 +20,7 @@ public partial class Sample_RestorableCosmosDBAccountResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_CosmosDBRestorableDatabaseAccountGet() [Ignore("Only validating compilation of examples")] public async Task GetRestorableSqlDatabases_CosmosDBRestorableSqlDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableSqlDatabaseList.json // this example is just showing the usage of "RestorableSqlDatabases_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,7 +79,7 @@ public async Task GetRestorableSqlDatabases_CosmosDBRestorableSqlDatabaseList() [Ignore("Only validating compilation of examples")] public async Task GetRestorableSqlContainers_CosmosDBRestorableSqlContainerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlContainerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableSqlContainerList.json // this example is just showing the usage of "RestorableSqlContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -109,7 +109,7 @@ public async Task GetRestorableSqlContainers_CosmosDBRestorableSqlContainerList( [Ignore("Only validating compilation of examples")] public async Task GetAllRestorableSqlResourceData_CosmosDBRestorableSqlResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableSqlResourceList.json // this example is just showing the usage of "RestorableSqlResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +140,7 @@ public async Task GetAllRestorableSqlResourceData_CosmosDBRestorableSqlResourceL [Ignore("Only validating compilation of examples")] public async Task GetRestorableMongoDBDatabases_CosmosDBRestorableMongodbDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableMongodbDatabaseList.json // this example is just showing the usage of "RestorableMongodbDatabases_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -169,7 +169,7 @@ public async Task GetRestorableMongoDBDatabases_CosmosDBRestorableMongodbDatabas [Ignore("Only validating compilation of examples")] public async Task GetRestorableMongoDBCollections_CosmosDBRestorableMongodbCollectionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbCollectionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableMongodbCollectionList.json // this example is just showing the usage of "RestorableMongodbCollections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -199,7 +199,7 @@ public async Task GetRestorableMongoDBCollections_CosmosDBRestorableMongodbColle [Ignore("Only validating compilation of examples")] public async Task GetAllRestorableMongoDBResourceData_CosmosDBRestorableMongodbResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableMongodbResourceList.json // this example is just showing the usage of "RestorableMongodbResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -230,7 +230,7 @@ public async Task GetAllRestorableMongoDBResourceData_CosmosDBRestorableMongodbR [Ignore("Only validating compilation of examples")] public async Task GetRestorableGremlinDatabases_CosmosDBRestorableGremlinDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableGremlinDatabaseList.json // this example is just showing the usage of "RestorableGremlinDatabases_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -259,7 +259,7 @@ public async Task GetRestorableGremlinDatabases_CosmosDBRestorableGremlinDatabas [Ignore("Only validating compilation of examples")] public async Task GetRestorableGremlinGraphs_CosmosDBRestorableGremlinGraphList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinGraphList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableGremlinGraphList.json // this example is just showing the usage of "RestorableGremlinGraphs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -289,7 +289,7 @@ public async Task GetRestorableGremlinGraphs_CosmosDBRestorableGremlinGraphList( [Ignore("Only validating compilation of examples")] public async Task GetRestorableGremlinResources_CosmosDBRestorableGremlinResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableGremlinResourceList.json // this example is just showing the usage of "RestorableGremlinResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -320,7 +320,7 @@ public async Task GetRestorableGremlinResources_CosmosDBRestorableGremlinResourc [Ignore("Only validating compilation of examples")] public async Task GetRestorableTables_CosmosDBRestorableTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableTableList.json // this example is just showing the usage of "RestorableTables_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -349,7 +349,7 @@ public async Task GetRestorableTables_CosmosDBRestorableTableList() [Ignore("Only validating compilation of examples")] public async Task GetRestorableTableResources_CosmosDBRestorableTableResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableTableResourceList.json // this example is just showing the usage of "RestorableTableResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index b3baf4982356..b6a81c3b6d14 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -20,7 +20,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetCosmosDBAccounts_CosmosDBDatabaseAccountList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountList.json // this example is just showing the usage of "DatabaseAccounts_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task GetCosmosDBAccounts_CosmosDBDatabaseAccountList() [Ignore("Only validating compilation of examples")] public async Task GetCassandraClusters_CosmosDBManagedCassandraClusterListBySubscription() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json // this example is just showing the usage of "CassandraClusters_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task GetCassandraClusters_CosmosDBManagedCassandraClusterListBySubs [Ignore("Only validating compilation of examples")] public async Task GetRestorableCosmosDBAccounts_CosmosDBRestorableDatabaseAccountNoLocationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json // this example is just showing the usage of "RestorableDatabaseAccounts_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,36 +108,5 @@ public async Task GetRestorableCosmosDBAccounts_CosmosDBRestorableDatabaseAccoun Console.WriteLine("Succeeded"); } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetCosmosDBThroughputPools_CosmosDBThroughputPoolList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json - // this example is just showing the usage of "ThroughputPools_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (CosmosDBThroughputPoolResource item in subscriptionResource.GetCosmosDBThroughputPoolsAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_TenantResourceExtensions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_TenantResourceExtensions.cs index 005c85e9a52e..d4dbc3dcf786 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_TenantResourceExtensions.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_TenantResourceExtensions.cs @@ -20,7 +20,7 @@ public partial class Sample_TenantResourceExtensions [Ignore("Only validating compilation of examples")] public async Task CheckNameExistsDatabaseAccount_CosmosDBDatabaseAccountCheckNameExists() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2025-04-15/examples/CosmosDBDatabaseAccountCheckNameExists.json // this example is just showing the usage of "DatabaseAccounts_CheckNameExists" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs index a3e75141e860..c0a98cc863c8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs @@ -10,39 +10,12 @@ using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Models { /// Model factory for models. public static partial class ArmCosmosDBModelFactory { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Indicates whether what action to take for the Chaos Fault. - /// Region of the account where the Chaos Fault is to be enabled/disabled. - /// Database name. - /// Container name. - /// A provisioning state of the Chaos Fault. - /// A new instance for mocking. - public static CosmosDBChaosFaultResourceData CosmosDBChaosFaultResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBChaosFaultSupportedAction? cosmosDBChaosFaultSupportedActions = null, string region = null, string databaseName = null, string containerName = null, string provisioningState = null) - { - return new CosmosDBChaosFaultResourceData( - id, - name, - resourceType, - systemData, - cosmosDBChaosFaultSupportedActions, - region, - databaseName, - containerName, - provisioningState, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -51,7 +24,8 @@ public static CosmosDBChaosFaultResourceData CosmosDBChaosFaultResourceData(Reso /// The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. - /// The provisioning state of the resource. + /// Identity for the resource. + /// The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. /// The connection endpoint for the Cosmos DB database account. /// The offer type for the Cosmos DB database account. Default value: Standard. /// List of IpRules. @@ -87,23 +61,16 @@ public static CosmosDBChaosFaultResourceData CosmosDBChaosFaultResourceData(Reso /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// The object that represents the migration state for the CapacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// The object that represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - /// Identity for the resource. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. /// A new instance for mocking. - public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, string provisioningState = null, string documentEndpoint = null, CosmosDBAccountOfferType? databaseAccountOfferType = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable capabilities = null, IEnumerable writeLocations = null, IEnumerable readLocations = null, IEnumerable locations = null, IEnumerable failoverPolicies = null, IEnumerable virtualNetworkRules = null, IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, Guid? instanceId = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountRestoreParameters restoreParameters = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, CapacityModeChangeTransitionState capacityModeChangeTransitionState = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null, ManagedServiceIdentity identity = null) + public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, ManagedServiceIdentity identity = null, string provisioningState = null, string documentEndpoint = null, CosmosDBAccountOfferType? databaseAccountOfferType = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable capabilities = null, IEnumerable writeLocations = null, IEnumerable readLocations = null, IEnumerable locations = null, IEnumerable failoverPolicies = null, IEnumerable virtualNetworkRules = null, IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, Guid? instanceId = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountRestoreParameters restoreParameters = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, bool? enableBurstCapacity = null, string customerManagedKeyStatus = null, bool? enablePerRegionPerPartitionAutoscale = null) { tags ??= new Dictionary(); ipRules ??= new List(); @@ -125,6 +92,7 @@ public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = nu tags, location, kind, + identity, provisioningState, documentEndpoint, databaseAccountOfferType, @@ -157,21 +125,14 @@ public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = nu cors?.ToList(), networkAclBypass, networkAclBypassResourceIds?.ToList(), - diagnosticLogEnableFullTextQuery != null ? new DiagnosticLogSettings(diagnosticLogEnableFullTextQuery, serializedAdditionalRawData: null) : null, disableLocalAuth, capacityTotalThroughputLimit != null ? new CosmosDBAccountCapacity(capacityTotalThroughputLimit, serializedAdditionalRawData: null) : null, - capacityMode, - capacityModeChangeTransitionState, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, - identity, serializedAdditionalRawData: null); } @@ -179,7 +140,7 @@ public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = nu /// The unique identifier of the region within the database account. Example: <accountName>-<locationName>. /// The name of the region. /// The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/. - /// The provisioning state of the resource. + /// The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. /// The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. /// Flag to indicate whether or not this region is an AvailabilityZone region. /// A new instance for mocking. @@ -239,26 +200,6 @@ public static CosmosDBPrivateLinkServiceConnectionStateProperty CosmosDBPrivateL return new CosmosDBPrivateLinkServiceConnectionStateProperty(status, description, actionsRequired, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The transition status of capacity mode. - /// Indicates the current capacity mode of the account. - /// Indicates the previous capacity mode of the account before successful transition. - /// Begin time in UTC of the capacity mode change. - /// End time in UTC of the capacity mode change. - /// End time in UTC of the last successful capacity mode change. - /// A new instance for mocking. - public static CapacityModeChangeTransitionState CapacityModeChangeTransitionState(CapacityModeTransitionStatus? capacityModeTransitionStatus = null, CapacityMode? currentCapacityMode = null, CapacityMode? previousCapacityMode = null, DateTimeOffset? capacityModeTransitionBeginTimestamp = null, DateTimeOffset? capacityModeTransitionEndTimestamp = null, DateTimeOffset? capacityModeLastSuccessfulTransitionEndTimestamp = null) - { - return new CapacityModeChangeTransitionState( - capacityModeTransitionStatus, - currentCapacityMode, - previousCapacityMode, - capacityModeTransitionBeginTimestamp, - capacityModeTransitionEndTimestamp, - capacityModeLastSuccessfulTransitionEndTimestamp, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The metadata related to the Primary Read-Write Key for the given Cosmos DB database account. /// The metadata related to the Secondary Read-Write Key for the given Cosmos DB database account. @@ -300,21 +241,16 @@ public static DatabaseAccountKeysMetadata DatabaseAccountKeysMetadata(DateTimeOf /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. /// A new instance for mocking. - public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary tags = null, AzureLocation? location = null, ManagedServiceIdentity identity = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null) + public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary tags = null, AzureLocation? location = null, ManagedServiceIdentity identity = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, bool? enableBurstCapacity = null, string customerManagedKeyStatus = null, bool? enablePerRegionPerPartitionAutoscale = null) { tags ??= new Dictionary(); locations ??= new List(); @@ -350,18 +286,13 @@ public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. + /// Identity for the resource. /// The consistency policy for the Cosmos DB account. /// An array that contains the georeplication locations enabled for the Cosmos DB account. /// The offer type for the database. @@ -402,23 +334,17 @@ public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// Parameters to indicate the information about the restore. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// 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. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - /// Identity for the resource. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. /// A new instance for mocking. - public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, CosmosDBAccountOfferType databaseAccountOfferType = default, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null, ManagedServiceIdentity identity = null) + public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, ManagedServiceIdentity identity = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, CosmosDBAccountOfferType databaseAccountOfferType = default, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, bool? disableLocalAuth = null, CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, bool? enableBurstCapacity = null, string customerManagedKeyStatus = null, bool? enablePerRegionPerPartitionAutoscale = null) { tags ??= new Dictionary(); locations ??= new List(); @@ -436,6 +362,7 @@ public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdate tags, location, kind, + identity, consistencyPolicy, locations?.ToList(), databaseAccountOfferType, @@ -460,21 +387,15 @@ public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdate cors?.ToList(), networkAclBypass, networkAclBypassResourceIds?.ToList(), - diagnosticLogEnableFullTextQuery != null ? new DiagnosticLogSettings(diagnosticLogEnableFullTextQuery, serializedAdditionalRawData: null) : null, disableLocalAuth, restoreParameters, capacityTotalThroughputLimit != null ? new CosmosDBAccountCapacity(capacityTotalThroughputLimit, serializedAdditionalRawData: null) : null, - capacityMode, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, - identity, serializedAdditionalRawData: null); } @@ -509,15 +430,6 @@ public static CosmosDBAccountConnectionString CosmosDBAccountConnectionString(st return new CosmosDBAccountConnectionString(connectionString, description, keyKind, keyType, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Error code. - /// Error message indicating why the operation failed. - /// A new instance for mocking. - public static CosmosDBErrorResult CosmosDBErrorResult(string code = null, string message = null) - { - return new CosmosDBErrorResult(code, message, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The start time for the metric (ISO-8601 format). /// The end time for the metric (ISO-8601 format). @@ -720,62 +632,6 @@ public static CosmosDBMetricAvailability CosmosDBMetricAvailability(string timeG return new CosmosDBMetricAvailability(timeGrain, retention, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Gets or sets the resource. - /// - /// Identity for the resource. - /// A new instance for mocking. - public static GraphResourceGetResultData GraphResourceGetResultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceIdentifier resourceId = null, GraphResourceGetPropertiesOptions options = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new GraphResourceGetResultData( - id, - name, - resourceType, - systemData, - tags, - location, - resourceId != null ? ResourceManagerModelFactory.WritableSubResource(resourceId) : null, - options, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a Graph resource. - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. - /// A new instance for mocking. - public static GraphResourceGetResultCreateOrUpdateContent GraphResourceGetResultCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceIdentifier resourceId = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new GraphResourceGetResultCreateOrUpdateContent( - id, - name, - resourceType, - systemData, - tags, - location, - resourceId != null ? ResourceManagerModelFactory.WritableSubResource(resourceId) : null, - options, - identity, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -785,9 +641,8 @@ public static GraphResourceGetResultCreateOrUpdateContent GraphResourceGetResult /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlDatabaseData CosmosDBSqlDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlDatabaseResourceInfo resource = null, CosmosDBSqlDatabasePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlDatabaseData CosmosDBSqlDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlDatabaseResourceInfo resource = null, CosmosDBSqlDatabasePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -800,7 +655,6 @@ public static CosmosDBSqlDatabaseData CosmosDBSqlDatabaseData(ResourceIdentifier location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -837,9 +691,8 @@ public static ExtendedCosmosDBSqlDatabaseResourceInfo ExtendedCosmosDBSqlDatabas /// The location. /// The standard JSON format of a SQL database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -852,7 +705,6 @@ public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreate location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -864,9 +716,8 @@ public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreate /// The tags. /// The location. /// - /// Identity for the resource. /// A new instance for mocking. - public static ThroughputSettingData ThroughputSettingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedThroughputSettingsResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static ThroughputSettingData ThroughputSettingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedThroughputSettingsResourceInfo resource = null) { tags ??= new Dictionary(); @@ -878,7 +729,6 @@ public static ThroughputSettingData ThroughputSettingData(ResourceIdentifier id tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -889,15 +739,12 @@ public static ThroughputSettingData ThroughputSettingData(ResourceIdentifier id /// The throughput replace is pending. /// The offer throughput value to instantly scale up without triggering splits. /// The maximum throughput value or the maximum maxThroughput value (for autoscale) that can be specified. - /// Array of Throughput Bucket limits to be applied to the Cosmos DB container. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. /// A new instance for mocking. - public static ExtendedThroughputSettingsResourceInfo ExtendedThroughputSettingsResourceInfo(int? throughput = null, AutoscaleSettingsResourceInfo autoscaleSettings = null, string minimumThroughput = null, string offerReplacePending = null, string instantMaximumThroughput = null, string softAllowedMaximumThroughput = null, IEnumerable throughputBuckets = null, string rid = null, float? timestamp = null, ETag? etag = null) + public static ExtendedThroughputSettingsResourceInfo ExtendedThroughputSettingsResourceInfo(int? throughput = null, AutoscaleSettingsResourceInfo autoscaleSettings = null, string minimumThroughput = null, string offerReplacePending = null, string instantMaximumThroughput = null, string softAllowedMaximumThroughput = null, string rid = null, float? timestamp = null, ETag? etag = null) { - throughputBuckets ??= new List(); - return new ExtendedThroughputSettingsResourceInfo( throughput, autoscaleSettings, @@ -905,7 +752,6 @@ public static ExtendedThroughputSettingsResourceInfo ExtendedThroughputSettingsR offerReplacePending, instantMaximumThroughput, softAllowedMaximumThroughput, - throughputBuckets?.ToList(), serializedAdditionalRawData: null, rid, timestamp, @@ -919,12 +765,9 @@ public static ExtendedThroughputSettingsResourceInfo ExtendedThroughputSettingsR /// The throughput replace is pending. /// The offer throughput value to instantly scale up without triggering splits. /// The maximum throughput value or the maximum maxThroughput value (for autoscale) that can be specified. - /// Array of Throughput Bucket limits to be applied to the Cosmos DB container. /// A new instance for mocking. - public static ThroughputSettingsResourceInfo ThroughputSettingsResourceInfo(int? throughput = null, AutoscaleSettingsResourceInfo autoscaleSettings = null, string minimumThroughput = null, string offerReplacePending = null, string instantMaximumThroughput = null, string softAllowedMaximumThroughput = null, IEnumerable throughputBuckets = null) + public static ThroughputSettingsResourceInfo ThroughputSettingsResourceInfo(int? throughput = null, AutoscaleSettingsResourceInfo autoscaleSettings = null, string minimumThroughput = null, string offerReplacePending = null, string instantMaximumThroughput = null, string softAllowedMaximumThroughput = null) { - throughputBuckets ??= new List(); - return new ThroughputSettingsResourceInfo( throughput, autoscaleSettings, @@ -932,7 +775,6 @@ public static ThroughputSettingsResourceInfo ThroughputSettingsResourceInfo(int? offerReplacePending, instantMaximumThroughput, softAllowedMaximumThroughput, - throughputBuckets?.ToList(), serializedAdditionalRawData: null); } @@ -954,9 +796,8 @@ public static AutoscaleSettingsResourceInfo AutoscaleSettingsResourceInfo(int ma /// The tags. /// The location. /// The standard JSON format of a resource throughput. - /// Identity for the resource. /// A new instance for mocking. - public static ThroughputSettingsUpdateData ThroughputSettingsUpdateData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ThroughputSettingsResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static ThroughputSettingsUpdateData ThroughputSettingsUpdateData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ThroughputSettingsResourceInfo resource = null) { tags ??= new Dictionary(); @@ -968,50 +809,9 @@ public static ThroughputSettingsUpdateData ThroughputSettingsUpdateData(Resource tags, location, resource, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// A new instance for mocking. - public static CosmosDBSqlClientEncryptionKeyData CosmosDBSqlClientEncryptionKeyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBSqlClientEncryptionKeyProperties resource = null) - { - return new CosmosDBSqlClientEncryptionKeyData( - id, - name, - resourceType, - systemData, - resource, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Name of the ClientEncryptionKey. - /// Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data. - /// Wrapped (encrypted) form of the key represented as a byte array. - /// Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key. - /// A system generated property. A unique identifier. - /// A system generated property that denotes the last updated timestamp of the resource. - /// A system generated property representing the resource etag required for optimistic concurrency control. - /// A new instance for mocking. - public static CosmosDBSqlClientEncryptionKeyProperties CosmosDBSqlClientEncryptionKeyProperties(string id = null, string encryptionAlgorithm = null, byte[] wrappedDataEncryptionKey = null, CosmosDBKeyWrapMetadata keyWrapMetadata = null, string rid = null, float? timestamp = null, ETag? etag = null) - { - return new CosmosDBSqlClientEncryptionKeyProperties( - id, - encryptionAlgorithm, - wrappedDataEncryptionKey, - keyWrapMetadata, - serializedAdditionalRawData: null, - rid, - timestamp, - etag); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -1021,9 +821,8 @@ public static CosmosDBSqlClientEncryptionKeyProperties CosmosDBSqlClientEncrypti /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlContainerResourceInfo resource = null, CosmosDBSqlContainerPropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlContainerResourceInfo resource = null, CosmosDBSqlContainerPropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1036,7 +835,6 @@ public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifi location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1051,14 +849,14 @@ public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifi /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// The vector embedding policy for the container. + /// The FullText policy for the container. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. /// A new instance for mocking. - public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, MaterializedViewDefinition materializedViewDefinition = null, IEnumerable computedProperties = null, IEnumerable vectorEmbeddings = null, string rid = null, float? timestamp = null, ETag? etag = null) + public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, IEnumerable computedProperties = null, IEnumerable vectorEmbeddings = null, FullTextPolicy fullTextPolicy = null, string rid = null, float? timestamp = null, ETag? etag = null) { uniqueKeys ??= new List(); computedProperties ??= new List(); @@ -1075,9 +873,9 @@ public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContai analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties?.ToList(), vectorEmbeddings != null ? new VectorEmbeddingPolicy(vectorEmbeddings?.ToList(), serializedAdditionalRawData: null) : null, + fullTextPolicy, serializedAdditionalRawData: null, rid, timestamp, @@ -1097,16 +895,6 @@ public static CosmosDBContainerPartitionKey CosmosDBContainerPartitionKey(IEnume return new CosmosDBContainerPartitionKey(paths?.ToList(), kind, version, isSystemKey, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// An unique identifier for the source collection. This is a system generated property. - /// The name of the source container on which the Materialized View will be created. - /// 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. - /// A new instance for mocking. - public static MaterializedViewDefinition MaterializedViewDefinition(string sourceCollectionRid = null, string sourceCollectionId = null, string definition = null) - { - return new MaterializedViewDefinition(sourceCollectionRid, sourceCollectionId, definition, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -1116,9 +904,8 @@ public static MaterializedViewDefinition MaterializedViewDefinition(string sourc /// The location. /// The standard JSON format of a container. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlContainerCreateOrUpdateContent CosmosDBSqlContainerCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlContainerResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlContainerCreateOrUpdateContent CosmosDBSqlContainerCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlContainerResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1131,107 +918,47 @@ public static CosmosDBSqlContainerCreateOrUpdateContent CosmosDBSqlContainerCrea location, resource, options, - identity, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// List of physical partitions and their properties. - /// A new instance for mocking. - public static PhysicalPartitionStorageInfoCollection PhysicalPartitionStorageInfoCollection(IEnumerable physicalPartitionStorageInfoCollectionValue = null) - { - physicalPartitionStorageInfoCollectionValue ??= new List(); - - return new PhysicalPartitionStorageInfoCollection(physicalPartitionStorageInfoCollectionValue?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The unique identifier of the partition. - /// The storage in KB for the physical partition. - /// A new instance for mocking. - public static PhysicalPartitionStorageInfo PhysicalPartitionStorageInfo(string id = null, double? storageInKB = null) - { - return new PhysicalPartitionStorageInfo(id, storageInKB, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a resource throughput. - /// Identity for the resource. - /// A new instance for mocking. - public static RetrieveThroughputParameters RetrieveThroughputParameters(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable resourcePhysicalPartitionIds = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - resourcePhysicalPartitionIds ??= new List(); - - return new RetrieveThroughputParameters( - id, - name, - resourceType, - systemData, - tags, - location, - resourcePhysicalPartitionIds != null ? new RetrieveThroughputPropertiesResource(resourcePhysicalPartitionIds?.ToList(), serializedAdditionalRawData: null) : null, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The tags. - /// The location. - /// properties of physical partition throughput info. - /// Identity for the resource. - /// A new instance for mocking. - public static PhysicalPartitionThroughputInfoResult PhysicalPartitionThroughputInfoResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable resourcePhysicalPartitionThroughputInfo = null, ManagedServiceIdentity identity = null) + /// + /// A new instance for mocking. + public static CosmosDBSqlClientEncryptionKeyData CosmosDBSqlClientEncryptionKeyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBSqlClientEncryptionKeyProperties resource = null) { - tags ??= new Dictionary(); - resourcePhysicalPartitionThroughputInfo ??= new List(); - - return new PhysicalPartitionThroughputInfoResult( + return new CosmosDBSqlClientEncryptionKeyData( id, name, resourceType, systemData, - tags, - location, - resourcePhysicalPartitionThroughputInfo != null ? new PhysicalPartitionThroughputInfoResultPropertiesResource(resourcePhysicalPartitionThroughputInfo?.ToList(), serializedAdditionalRawData: null) : null, - identity, + resource, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a resource throughput. - /// Identity for the resource. - /// A new instance for mocking. - public static RedistributeThroughputParameters RedistributeThroughputParameters(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, RedistributeThroughputPropertiesResource resource = null, ManagedServiceIdentity identity = null) + /// Initializes a new instance of . + /// Name of the ClientEncryptionKey. + /// Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data. + /// Wrapped (encrypted) form of the key represented as a byte array. + /// Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key. + /// A system generated property. A unique identifier. + /// A system generated property that denotes the last updated timestamp of the resource. + /// A system generated property representing the resource etag required for optimistic concurrency control. + /// A new instance for mocking. + public static CosmosDBSqlClientEncryptionKeyProperties CosmosDBSqlClientEncryptionKeyProperties(string id = null, string encryptionAlgorithm = null, byte[] wrappedDataEncryptionKey = null, CosmosDBKeyWrapMetadata keyWrapMetadata = null, string rid = null, float? timestamp = null, ETag? etag = null) { - tags ??= new Dictionary(); - - return new RedistributeThroughputParameters( + return new CosmosDBSqlClientEncryptionKeyProperties( id, - name, - resourceType, - systemData, - tags, - location, - resource, - identity, - serializedAdditionalRawData: null); + encryptionAlgorithm, + wrappedDataEncryptionKey, + keyWrapMetadata, + serializedAdditionalRawData: null, + rid, + timestamp, + etag); } /// Initializes a new instance of . @@ -1242,9 +969,8 @@ public static RedistributeThroughputParameters RedistributeThroughputParameters( /// The tags. /// The location. /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlStoredProcedureData CosmosDBSqlStoredProcedureData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlStoredProcedureResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlStoredProcedureData CosmosDBSqlStoredProcedureData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlStoredProcedureResourceInfo resource = null) { tags ??= new Dictionary(); @@ -1256,7 +982,6 @@ public static CosmosDBSqlStoredProcedureData CosmosDBSqlStoredProcedureData(Reso tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -1287,9 +1012,8 @@ public static ExtendedCosmosDBSqlStoredProcedureResourceInfo ExtendedCosmosDBSql /// The location. /// The standard JSON format of a storedProcedure. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredProcedureCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlStoredProcedureResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredProcedureCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlStoredProcedureResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1302,7 +1026,6 @@ public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredP location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1314,9 +1037,8 @@ public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredP /// The tags. /// The location. /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlUserDefinedFunctionData CosmosDBSqlUserDefinedFunctionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlUserDefinedFunctionData CosmosDBSqlUserDefinedFunctionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo resource = null) { tags ??= new Dictionary(); @@ -1328,7 +1050,6 @@ public static CosmosDBSqlUserDefinedFunctionData CosmosDBSqlUserDefinedFunctionD tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -1359,9 +1080,8 @@ public static ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo ExtendedCosmosD /// The location. /// The standard JSON format of a userDefinedFunction. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlUserDefinedFunctionResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlUserDefinedFunctionResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1374,7 +1094,6 @@ public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUse location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1386,9 +1105,8 @@ public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUse /// The tags. /// The location. /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlTriggerData CosmosDBSqlTriggerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlTriggerResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlTriggerData CosmosDBSqlTriggerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlTriggerResourceInfo resource = null) { tags ??= new Dictionary(); @@ -1400,7 +1118,6 @@ public static CosmosDBSqlTriggerData CosmosDBSqlTriggerData(ResourceIdentifier i tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -1435,9 +1152,8 @@ public static ExtendedCosmosDBSqlTriggerResourceInfo ExtendedCosmosDBSqlTriggerR /// The location. /// The standard JSON format of a trigger. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlTriggerResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlTriggerResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1450,7 +1166,6 @@ public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOr location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1463,9 +1178,8 @@ public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOr /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static MongoDBDatabaseData MongoDBDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedMongoDBDatabaseResourceInfo resource = null, MongoDBDatabasePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static MongoDBDatabaseData MongoDBDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedMongoDBDatabaseResourceInfo resource = null, MongoDBDatabasePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1478,7 +1192,6 @@ public static MongoDBDatabaseData MongoDBDatabaseData(ResourceIdentifier id = nu location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1511,9 +1224,8 @@ public static ExtendedMongoDBDatabaseResourceInfo ExtendedMongoDBDatabaseResourc /// The location. /// The standard JSON format of a MongoDB database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoDBDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoDBDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1526,7 +1238,6 @@ public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdate location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1539,9 +1250,8 @@ public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdate /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static MongoDBCollectionData MongoDBCollectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedMongoDBCollectionResourceInfo resource = null, MongoDBCollectionPropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static MongoDBCollectionData MongoDBCollectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedMongoDBCollectionResourceInfo resource = null, MongoDBCollectionPropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1554,7 +1264,6 @@ public static MongoDBCollectionData MongoDBCollectionData(ResourceIdentifier id location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1596,9 +1305,8 @@ public static ExtendedMongoDBCollectionResourceInfo ExtendedMongoDBCollectionRes /// The location. /// The standard JSON format of a MongoDB collection. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoDBCollectionResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoDBCollectionResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1611,7 +1319,6 @@ public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUp location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1624,9 +1331,8 @@ public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUp /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBTableData CosmosDBTableData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBTablePropertiesResource resource = null, CosmosDBTablePropertiesOptions options = null, ManagedServiceIdentity identity = null) + public static CosmosDBTableData CosmosDBTableData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBTablePropertiesResource resource = null, CosmosDBTablePropertiesOptions options = null) { tags ??= new Dictionary(); @@ -1639,7 +1345,6 @@ public static CosmosDBTableData CosmosDBTableData(ResourceIdentifier id = null, location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1672,9 +1377,8 @@ public static CosmosDBTablePropertiesResource CosmosDBTablePropertiesResource(st /// The location. /// The standard JSON format of a Table. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBTableResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBTableResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1687,7 +1391,6 @@ public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateCont location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1700,9 +1403,8 @@ public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateCont /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CassandraKeyspaceData CassandraKeyspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCassandraKeyspaceResourceInfo resource = null, CassandraKeyspacePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static CassandraKeyspaceData CassandraKeyspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCassandraKeyspaceResourceInfo resource = null, CassandraKeyspacePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1715,7 +1417,6 @@ public static CassandraKeyspaceData CassandraKeyspaceData(ResourceIdentifier id location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1739,9 +1440,8 @@ public static ExtendedCassandraKeyspaceResourceInfo ExtendedCassandraKeyspaceRes /// The location. /// The standard JSON format of a Cassandra keyspace. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string resourceKeyspaceName = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string resourceKeyspaceName = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1754,7 +1454,6 @@ public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUp location, resourceKeyspaceName != null ? new CassandraKeyspaceResourceInfo(resourceKeyspaceName, serializedAdditionalRawData: null) : null, options, - identity, serializedAdditionalRawData: null); } @@ -1767,9 +1466,8 @@ public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUp /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CassandraTableData CassandraTableData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCassandraTableResourceInfo resource = null, CassandraTablePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static CassandraTableData CassandraTableData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCassandraTableResourceInfo resource = null, CassandraTablePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1782,7 +1480,6 @@ public static CassandraTableData CassandraTableData(ResourceIdentifier id = null location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1817,9 +1514,8 @@ public static ExtendedCassandraTableResourceInfo ExtendedCassandraTableResourceI /// The location. /// The standard JSON format of a Cassandra table. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CassandraTableResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CassandraTableResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1832,7 +1528,6 @@ public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateCo location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1845,9 +1540,8 @@ public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateCo /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static GremlinDatabaseData GremlinDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedGremlinDatabaseResourceInfo resource = null, GremlinDatabasePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static GremlinDatabaseData GremlinDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedGremlinDatabaseResourceInfo resource = null, GremlinDatabasePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1860,7 +1554,6 @@ public static GremlinDatabaseData GremlinDatabaseData(ResourceIdentifier id = nu location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1893,9 +1586,8 @@ public static ExtendedGremlinDatabaseResourceInfo ExtendedGremlinDatabaseResourc /// The location. /// The standard JSON format of a Gremlin database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GremlinDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GremlinDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1908,7 +1600,6 @@ public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdate location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1921,9 +1612,8 @@ public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdate /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static GremlinGraphData GremlinGraphData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedGremlinGraphResourceInfo resource = null, GremlinGraphPropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static GremlinGraphData GremlinGraphData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedGremlinGraphResourceInfo resource = null, GremlinGraphPropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1936,7 +1626,6 @@ public static GremlinGraphData GremlinGraphData(ResourceIdentifier id = null, st location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1983,9 +1672,8 @@ public static ExtendedGremlinGraphResourceInfo ExtendedGremlinGraphResourceInfo( /// The location. /// The standard JSON format of a Gremlin graph. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GremlinGraphResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GremlinGraphResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1998,7 +1686,6 @@ public static GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateConten location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -2042,182 +1729,6 @@ public static CosmosDBLocationProperties CosmosDBLocationProperties(bool? doesSu serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// - /// - /// Identity for the resource. - /// A new instance for mocking. - public static CassandraViewGetResultData CassandraViewGetResultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CassandraViewGetPropertiesResource resource = null, CassandraViewGetPropertiesOptions options = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new CassandraViewGetResultData( - id, - name, - resourceType, - systemData, - tags, - location, - resource, - options, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// A system generated property. A unique identifier. - /// A system generated property that denotes the last updated timestamp of the resource. - /// A system generated property representing the resource etag required for optimistic concurrency control. - /// A new instance for mocking. - public static CassandraViewGetPropertiesResource CassandraViewGetPropertiesResource(string id = null, string viewDefinition = null, string rid = null, float? timestamp = null, ETag? etag = null) - { - return new CassandraViewGetPropertiesResource( - id, - viewDefinition, - serializedAdditionalRawData: null, - rid, - timestamp, - etag); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a Cassandra view. - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. - /// A new instance for mocking. - public static CassandraViewGetResultCreateOrUpdateContent CassandraViewGetResultCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CassandraViewResource resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new CassandraViewGetResultCreateOrUpdateContent( - id, - name, - resourceType, - systemData, - tags, - location, - resource, - options, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Data Transfer Create Job Properties. - /// A new instance for mocking. - public static DataTransferJobGetResultCreateOrUpdateContent DataTransferJobGetResultCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataTransferJobProperties properties = null) - { - return new DataTransferJobGetResultCreateOrUpdateContent( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Job Name. - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - /// Job Status. - /// Processed Count. - /// Total Count. - /// Last Updated Time (ISO-8601 format). - /// Worker count. - /// Error response for Faulted job. - /// Total Duration of Job. - /// Mode of job execution. - /// A new instance for mocking. - public static DataTransferJobProperties DataTransferJobProperties(string jobName = null, DataTransferDataSourceSink source = null, DataTransferDataSourceSink destination = null, string status = null, long? processedCount = null, long? totalCount = null, DateTimeOffset? lastUpdatedUtcOn = null, int? workerCount = null, CosmosDBErrorResult error = null, TimeSpan? duration = null, DataTransferJobMode? mode = null) - { - return new DataTransferJobProperties( - jobName, - source, - destination, - status, - processedCount, - totalCount, - lastUpdatedUtcOn, - workerCount, - error, - duration, - mode, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Job Name. - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - /// Job Status. - /// Processed Count. - /// Total Count. - /// Last Updated Time (ISO-8601 format). - /// Worker count. - /// Error response for Faulted job. - /// Total Duration of Job. - /// Mode of job execution. - /// A new instance for mocking. - public static DataTransferJobGetResultData DataTransferJobGetResultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string jobName = null, DataTransferDataSourceSink source = null, DataTransferDataSourceSink destination = null, string status = null, long? processedCount = null, long? totalCount = null, DateTimeOffset? lastUpdatedUtcOn = null, int? workerCount = null, CosmosDBErrorResult error = null, TimeSpan? duration = null, DataTransferJobMode? mode = null) - { - return new DataTransferJobGetResultData( - id, - name, - resourceType, - systemData, - jobName, - source, - destination, - status, - processedCount, - totalCount, - lastUpdatedUtcOn, - workerCount, - error, - duration, - mode, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -2254,34 +1765,25 @@ public static CassandraClusterData CassandraClusterData(ResourceIdentifier id = /// Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null on GET. This field only applies when the authenticationMethod field is 'Cassandra'. /// Hostname or IP address where the Prometheus endpoint containing data about the managed Cassandra nodes can be reached. /// Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. - /// The form of AutoReplicate that is being used by this cluster. /// List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more of the public certificates in this property. /// List of TLS certificates used to authorize gossip from unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be verifiable using one of the certificates provided in this property. /// List of TLS certificates that unmanaged nodes must trust for gossip with managed nodes. All managed nodes will present TLS client certificates that are verifiable using one of the certificates provided in this property. /// List of IP addresses of seed nodes in unmanaged data centers. These will be added to the seed node lists of all managed nodes. /// List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. - /// List of the data center names for unmanaged data centers in this cluster to be included in auto-replication. /// (Deprecated) Number of hours to wait between taking a backup of the cluster. /// Whether the cluster and associated data centers has been deallocated. /// Whether Cassandra audit logging is enabled. - /// Type of the cluster. If set to Production, some operations might not be permitted on cluster. /// Error related to resource provisioning. - /// Extensions to be added or updated on cluster. - /// List of backup schedules that define when you want to back up your data. - /// How the nodes in the cluster react to scheduled events. /// How to connect to the azure services needed for running the cluster. - /// If the Connection Method is Vpn, this is the Id of the private link resource that the datacenters need to connect to. + /// If the Connection Method is VPN, this is the Id of the private link resource that the datacenters need to connect to. /// A new instance for mocking. - public static CassandraClusterProperties CassandraClusterProperties(CassandraProvisioningState? provisioningState = null, string restoreFromBackupId = null, ResourceIdentifier delegatedManagementSubnetId = null, string cassandraVersion = null, string clusterNameOverride = null, CassandraAuthenticationMethod? authenticationMethod = null, string initialCassandraAdminPassword = null, string prometheusEndpointIPAddress = null, bool? isRepairEnabled = null, CassandraAutoReplicateForm? autoReplicate = null, IEnumerable clientCertificates = null, IEnumerable externalGossipCertificates = null, IEnumerable gossipCertificates = null, IEnumerable externalSeedNodes = null, IEnumerable seedNodes = null, IEnumerable externalDataCenters = null, int? hoursBetweenBackups = null, bool? isDeallocated = null, bool? isCassandraAuditLoggingEnabled = null, CassandraClusterType? clusterType = null, CassandraError provisionError = null, IEnumerable extensions = null, IEnumerable backupSchedules = null, ScheduledEventStrategy? scheduledEventStrategy = null, ServiceConnectionType? azureConnectionMethod = null, ResourceIdentifier privateLinkResourceId = null) + public static CassandraClusterProperties CassandraClusterProperties(CassandraProvisioningState? provisioningState = null, string restoreFromBackupId = null, ResourceIdentifier delegatedManagementSubnetId = null, string cassandraVersion = null, string clusterNameOverride = null, CassandraAuthenticationMethod? authenticationMethod = null, string initialCassandraAdminPassword = null, string prometheusEndpointIPAddress = null, bool? isRepairEnabled = null, IEnumerable clientCertificates = null, IEnumerable externalGossipCertificates = null, IEnumerable gossipCertificates = null, IEnumerable externalSeedNodes = null, IEnumerable seedNodes = null, int? hoursBetweenBackups = null, bool? isDeallocated = null, bool? isCassandraAuditLoggingEnabled = null, CassandraError provisionError = null, ServiceConnectionType? azureConnectionMethod = null, ResourceIdentifier privateLinkResourceId = null) { clientCertificates ??= new List(); externalGossipCertificates ??= new List(); gossipCertificates ??= new List(); externalSeedNodes ??= new List(); seedNodes ??= new List(); - externalDataCenters ??= new List(); - extensions ??= new List(); - backupSchedules ??= new List(); return new CassandraClusterProperties( provisioningState, @@ -2293,21 +1795,15 @@ public static CassandraClusterProperties CassandraClusterProperties(CassandraPro initialCassandraAdminPassword, prometheusEndpointIPAddress != null ? new CassandraDataCenterSeedNode(prometheusEndpointIPAddress, serializedAdditionalRawData: null) : null, isRepairEnabled, - autoReplicate, clientCertificates?.ToList(), externalGossipCertificates?.ToList(), gossipCertificates?.ToList(), externalSeedNodes?.ToList(), seedNodes?.ToList(), - externalDataCenters?.ToList(), hoursBetweenBackups, isDeallocated, isCassandraAuditLoggingEnabled, - clusterType, provisionError, - extensions?.ToList(), - backupSchedules?.ToList(), - scheduledEventStrategy, azureConnectionMethod, privateLinkResourceId, serializedAdditionalRawData: null); @@ -2341,52 +1837,6 @@ public static CassandraCommandOutput CassandraCommandOutput(string commandOutput return new CassandraCommandOutput(commandOutput, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The command which should be run. - /// The unique id of command. - /// The arguments for the command to be run. - /// IP address of the cassandra host to run the command on. - /// Whether command has admin privileges. - /// If true, stops cassandra before executing the command and then start it again. - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. - /// Result output of the command. - /// Status of the command. - /// The name of the file where the result is written. - /// A new instance for mocking. - public static CassandraClusterCommand CassandraClusterCommand(string command = null, string commandId = null, BinaryData arguments = null, string host = null, bool? isAdmin = null, bool? shouldStopCassandraBeforeStart = null, bool? isReadWrite = null, string result = null, CassandraClusterCommandStatus? status = null, string outputFile = null) - { - return new CassandraClusterCommand( - command, - commandId, - arguments, - host, - isAdmin, - shouldStopCassandraBeforeStart, - isReadWrite, - result, - status, - outputFile, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The unique identifier of backup. - /// The current state of the backup. - /// The time at which the backup process begins. - /// The time at which the backup process ends. - /// The time at which the backup will expire. - /// A new instance for mocking. - public static CassandraClusterBackupResourceInfo CassandraClusterBackupResourceInfo(string backupId = null, CassandraClusterBackupState? backupState = null, DateTimeOffset? backupStartTimestamp = null, DateTimeOffset? backupStopTimestamp = null, DateTimeOffset? backupExpiryTimestamp = null) - { - return new CassandraClusterBackupResourceInfo( - backupId, - backupState, - backupStartTimestamp, - backupStopTimestamp, - backupExpiryTimestamp, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -2531,9 +1981,8 @@ public static CassandraClusterPublicStatusDataCentersItem CassandraClusterPublic /// Unused memory (MemFree and SwapFree in /proc/meminfo), in kB. /// Total installed memory (MemTotal and SwapTotal in /proc/meminfo), in kB. /// A float representing the current system-wide CPU utilization as a percentage. - /// If node has been updated to latest model. /// A new instance for mocking. - public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeItem(string address = null, CassandraNodeState? state = null, string status = null, string cassandraProcessStatus = null, string load = null, IEnumerable tokens = null, int? size = null, Guid? hostId = null, string rack = null, string timestamp = null, long? diskUsedKB = null, long? diskFreeKB = null, long? memoryUsedKB = null, long? memoryBuffersAndCachedKB = null, long? memoryFreeKB = null, long? memoryTotalKB = null, double? cpuUsage = null, bool? isLatestModel = null) + public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeItem(string address = null, CassandraNodeState? state = null, string status = null, string cassandraProcessStatus = null, string load = null, IEnumerable tokens = null, int? size = null, Guid? hostId = null, string rack = null, string timestamp = null, long? diskUsedKB = null, long? diskFreeKB = null, long? memoryUsedKB = null, long? memoryBuffersAndCachedKB = null, long? memoryFreeKB = null, long? memoryTotalKB = null, double? cpuUsage = null) { tokens ??= new List(); @@ -2555,7 +2004,6 @@ public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeI memoryFreeKB, memoryTotalKB, cpuUsage, - isLatestModel, serializedAdditionalRawData: null); } @@ -2618,74 +2066,6 @@ public static MongoDBUserDefinitionData MongoDBUserDefinitionData(ResourceIdenti serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Network security configuration properties. - /// A new instance for mocking. - public static NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NetworkSecurityPerimeterConfigurationProperties properties = null) - { - return new NetworkSecurityPerimeterConfigurationData( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Provisioning state of a network security perimeter configuration that is being created or updated. - /// List of provisioning issues, if any. - /// Information about a network security perimeter (NSP). - /// Information about resource association. - /// Network security perimeter configuration profile. - /// A new instance for mocking. - public static NetworkSecurityPerimeterConfigurationProperties NetworkSecurityPerimeterConfigurationProperties(NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState = null, IEnumerable provisioningIssues = null, NetworkSecurityPerimeter networkSecurityPerimeter = null, ResourceAssociation resourceAssociation = null, NetworkSecurityProfile profile = null) - { - provisioningIssues ??= new List(); - - return new NetworkSecurityPerimeterConfigurationProperties( - provisioningState, - provisioningIssues?.ToList(), - networkSecurityPerimeter, - resourceAssociation, - profile, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Name of the issue. - /// 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. - /// A new instance for mocking. - public static ProvisioningIssue ProvisioningIssue(string name = null, ProvisioningIssueProperties properties = null) - { - return new ProvisioningIssue(name, properties, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Type of issue. - /// Severity of the issue. - /// Description of the issue. - /// Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. - /// Access rules that can be added to the network security profile (NSP) to remediate the issue. - /// A new instance for mocking. - public static ProvisioningIssueProperties ProvisioningIssueProperties(IssueType? issueType = null, Severity? severity = null, string description = null, IEnumerable suggestedResourceIds = null, IEnumerable suggestedAccessRules = null) - { - suggestedResourceIds ??= new List(); - suggestedAccessRules ??= new List(); - - return new ProvisioningIssueProperties( - issueType, - severity, - description, - suggestedResourceIds?.ToList(), - suggestedAccessRules?.ToList(), - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -2768,12 +2148,12 @@ public static CosmosDBSqlRoleAssignmentData CosmosDBSqlRoleAssignmentData(Resour /// The location of the resource group to which the resource belongs. /// The name of the global database account. /// The creation time of the restorable database account (ISO-8601 format). - /// The least recent time at which the database account can be restored to (ISO-8601 format). /// The time at which the restorable database account has been deleted (ISO-8601 format). + /// The least recent time at which the database account can be restored to (ISO-8601 format). /// The API type of the restorable database account. /// List of regions where the of the database account can be restored from. /// A new instance for mocking. - public static RestorableCosmosDBAccountData RestorableCosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, string accountName = null, DateTimeOffset? createdOn = null, DateTimeOffset? oldestRestorableOn = null, DateTimeOffset? deletedOn = null, CosmosDBApiType? apiType = null, IEnumerable restorableLocations = null) + public static RestorableCosmosDBAccountData RestorableCosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, string accountName = null, DateTimeOffset? createdOn = null, DateTimeOffset? deletedOn = null, DateTimeOffset? oldestRestorableOn = null, CosmosDBApiType? apiType = null, IEnumerable restorableLocations = null) { restorableLocations ??= new List(); @@ -2785,8 +2165,8 @@ public static RestorableCosmosDBAccountData RestorableCosmosDBAccountData(Resour location, accountName, createdOn, - oldestRestorableOn, deletedOn, + oldestRestorableOn, apiType, restorableLocations?.ToList(), serializedAdditionalRawData: null); @@ -2932,15 +2312,15 @@ public static ExtendedRestorableSqlContainerResourceInfo ExtendedRestorableSqlCo /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// The vector embedding policy for the container. + /// The FullText policy for the container. /// A system generated property that specifies the addressable path of the container resource. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. /// A new instance for mocking. - public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, MaterializedViewDefinition materializedViewDefinition = null, IEnumerable computedProperties = null, IEnumerable vectorEmbeddings = null, string self = null, string rid = null, float? timestamp = null, ETag? etag = null) + public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, IEnumerable computedProperties = null, IEnumerable vectorEmbeddings = null, FullTextPolicy fullTextPolicy = null, string self = null, string rid = null, float? timestamp = null, ETag? etag = null) { uniqueKeys ??= new List(); computedProperties ??= new List(); @@ -2957,9 +2337,9 @@ public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlCon analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties?.ToList(), vectorEmbeddings != null ? new VectorEmbeddingPolicy(vectorEmbeddings?.ToList(), serializedAdditionalRawData: null) : null, + fullTextPolicy, serializedAdditionalRawData: null, self, rid, @@ -3286,109 +2666,6 @@ public static CosmosDBServiceProperties CosmosDBServiceProperties(DateTimeOffset additionalProperties); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// A provisioning state of the ThroughputPool. - /// Value for throughput to be shared among CosmosDB resources in the pool. - /// A new instance for mocking. - public static CosmosDBThroughputPoolData CosmosDBThroughputPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBStatus? provisioningState = null, int? maxThroughput = null) - { - tags ??= new Dictionary(); - - return new CosmosDBThroughputPoolData( - id, - name, - resourceType, - systemData, - tags, - location, - provisioningState, - maxThroughput, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// A provisioning state of the ThroughputPool Account. - /// The resource identifier of global database account in the throughputPool. - /// The location of global database account in the throughputPool. - /// The instance id of global database account in the throughputPool. - /// A new instance for mocking. - public static CosmosDBThroughputPoolAccountData CosmosDBThroughputPoolAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBStatus? provisioningState = null, ResourceIdentifier accountResourceIdentifier = null, AzureLocation? accountLocation = null, string accountInstanceId = null) - { - return new CosmosDBThroughputPoolAccountData( - id, - name, - resourceType, - systemData, - provisioningState, - accountResourceIdentifier, - accountLocation, - accountInstanceId, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The path id for the Role Definition. - /// A user-friendly name for the Role Definition. Must be unique for the database account. - /// Indicates whether the Role Definition was built-in or user created. - /// A set of fully qualified Scopes at or below which Table Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. - /// The set of operations allowed through this Role Definition. - /// A new instance for mocking. - public static CosmosDBTableRoleDefinitionData CosmosDBTableRoleDefinitionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string pathId = null, string roleName = null, CosmosDBSqlRoleDefinitionType? roleDefinitionType = null, IEnumerable assignableScopes = null, IEnumerable permissions = null) - { - assignableScopes ??= new List(); - permissions ??= new List(); - - return new CosmosDBTableRoleDefinitionData( - id, - name, - resourceType, - systemData, - pathId, - roleName, - roleDefinitionType, - assignableScopes?.ToList(), - permissions?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The unique identifier for the associated Role Definition. - /// The data plane resource path for which access is being granted through this Table Role Assignment. - /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Table Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. - /// Provisioning state of the resource. - /// A new instance for mocking. - public static CosmosDBTableRoleAssignmentData CosmosDBTableRoleAssignmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier roleDefinitionId = null, ResourceIdentifier scope = null, Guid? principalId = null, string provisioningState = null) - { - return new CosmosDBTableRoleAssignmentData( - id, - name, - resourceType, - systemData, - roleDefinitionId, - scope, - principalId, - provisioningState, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// Time of the last state change (ISO-8601 format). /// Instance type for the service. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs index 57fccb23c383..6935b335bf19 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdate /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string cl /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string clusterName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string clusterName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string clusterName, CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs index 149e76ecbdb3..4b93b1eb2950 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs @@ -10,7 +10,6 @@ using System.Globalization; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.CosmosDB.Models; @@ -111,7 +110,7 @@ public virtual CassandraDataCenterCollection GetCassandraDataCenters() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -142,7 +141,7 @@ public virtual async Task> GetCassandraDat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -173,7 +172,7 @@ public virtual Response GetCassandraDataCenter(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -213,7 +212,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +252,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -295,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -337,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -383,7 +382,7 @@ public virtual async Task> UpdateAsync(Wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -429,7 +428,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -475,7 +474,7 @@ public virtual async Task> InvokeCommandAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -508,380 +507,6 @@ public virtual ArmOperation InvokeCommand(WaitUntil wait } } - /// - /// List all commands currently running on ring info - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands - /// - /// - /// Operation Id - /// CassandraClusters_ListCommand - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCommandAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateListCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => CassandraClusterCommand.DeserializeCassandraClusterCommand(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetCommand", "value", null, cancellationToken); - } - - /// - /// List all commands currently running on ring info - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands - /// - /// - /// Operation Id - /// CassandraClusters_ListCommand - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCommand(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateListCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => CassandraClusterCommand.DeserializeCassandraClusterCommand(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetCommand", "value", null, cancellationToken); - } - - /// - /// Get details about a specified command that was run asynchronously. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands/{commandId} - /// - /// - /// Operation Id - /// CassandraClusters_GetCommandAsync - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Managed Cassandra cluster command id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetCommandAsyncAsync(string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.GetCommandAsync"); - scope.Start(); - try - { - var response = await _cassandraClusterRestClient.GetCommandAsyncAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, commandId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get details about a specified command that was run asynchronously. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands/{commandId} - /// - /// - /// Operation Id - /// CassandraClusters_GetCommandAsync - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Managed Cassandra cluster command id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetCommandAsync(string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.GetCommandAsync"); - scope.Start(); - try - { - var response = _cassandraClusterRestClient.GetCommandAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, commandId, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List the backups of this cluster that are available to restore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups - /// - /// - /// Operation Id - /// CassandraClusters_ListBackups - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetBackupsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateListBackupsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetBackups", "value", null, cancellationToken); - } - - /// - /// List the backups of this cluster that are available to restore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups - /// - /// - /// Operation Id - /// CassandraClusters_ListBackups - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetBackups(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateListBackupsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetBackups", "value", null, cancellationToken); - } - - /// - /// Get the properties of an individual backup of this cluster that is available to restore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId} - /// - /// - /// Operation Id - /// CassandraClusters_GetBackup - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Id of a restorable backup of a Cassandra cluster. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetBackupAsync(string backupId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(backupId, nameof(backupId)); - - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.GetBackup"); - scope.Start(); - try - { - var response = await _cassandraClusterRestClient.GetBackupAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, backupId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get the properties of an individual backup of this cluster that is available to restore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId} - /// - /// - /// Operation Id - /// CassandraClusters_GetBackup - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Id of a restorable backup of a Cassandra cluster. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetBackup(string backupId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(backupId, nameof(backupId)); - - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.GetBackup"); - scope.Start(); - try - { - var response = _cassandraClusterRestClient.GetBackup(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, backupId, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// 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. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate - /// - /// - /// Operation Id - /// CassandraClusters_Deallocate - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss. - /// The cancellation token to use. - public virtual async Task DeallocateAsync(WaitUntil waitUntil, string xMsForceDeallocate = null, CancellationToken cancellationToken = default) - { - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.Deallocate"); - scope.Start(); - try - { - var response = await _cassandraClusterRestClient.DeallocateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, xMsForceDeallocate, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cassandraClusterClientDiagnostics, Pipeline, _cassandraClusterRestClient.CreateDeallocateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, xMsForceDeallocate).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// 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. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate - /// - /// - /// Operation Id - /// CassandraClusters_Deallocate - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss. - /// The cancellation token to use. - public virtual ArmOperation Deallocate(WaitUntil waitUntil, string xMsForceDeallocate = null, CancellationToken cancellationToken = default) - { - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.Deallocate"); - scope.Start(); - try - { - var response = _cassandraClusterRestClient.Deallocate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, xMsForceDeallocate, cancellationToken); - var operation = new CosmosDBArmOperation(_cassandraClusterClientDiagnostics, Pipeline, _cassandraClusterRestClient.CreateDeallocateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, xMsForceDeallocate).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// 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. /// @@ -895,7 +520,7 @@ public virtual ArmOperation Deallocate(WaitUntil waitUntil, string xMsForceDeall /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -937,7 +562,7 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -979,7 +604,7 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1017,7 +642,7 @@ public virtual async Task> StatusAsync(Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1055,7 +680,7 @@ public virtual Response Status(CancellationToken c /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1117,7 +742,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1179,7 +804,7 @@ public virtual Response AddTag(string key, string valu /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1236,7 +861,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1293,7 +918,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1353,7 +978,7 @@ public virtual async Task> RemoveTagAsync(str /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs index e8332053ee9e..6101dfb72198 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string dataCenterName, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string dataCenterName, Can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string dataCenterName, CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs index b23ae7e6ec36..3c4db2037af2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs index 90e2f3071a53..9e57d619a73c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string k /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string keyspaceName, Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string keyspaceName, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string keyspaceName, CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs index 9a6e448d8faa..2424db02db9a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -80,7 +74,6 @@ internal static CassandraKeyspaceData DeserializeCassandraKeyspaceData(JsonEleme { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -93,16 +86,6 @@ internal static CassandraKeyspaceData DeserializeCassandraKeyspaceData(JsonEleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -191,7 +174,6 @@ internal static CassandraKeyspaceData DeserializeCassandraKeyspaceData(JsonEleme location, resource, options0, - identity, serializedAdditionalRawData); } @@ -278,21 +260,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.cs index 4645ff58529a..6a387d2c9ab5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.cs @@ -66,13 +66,11 @@ public CassandraKeyspaceData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CassandraKeyspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCassandraKeyspaceResourceInfo resource, CassandraKeyspacePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CassandraKeyspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCassandraKeyspaceResourceInfo resource, CassandraKeyspacePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CassandraKeyspaceData() /// Gets or sets the options. [WirePath("properties.options")] public CassandraKeyspacePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs index 74d0c3e71e20..202ba4e4ed9f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs @@ -117,7 +117,7 @@ public virtual CassandraTableCollection GetCassandraTables() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetCassandraTableAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -166,75 +166,6 @@ public virtual Response GetCassandraTable(string tableNa return GetCassandraTables().Get(tableName, cancellationToken); } - /// Gets a collection of CassandraViewGetResultResources in the CassandraKeyspace. - /// An object representing collection of CassandraViewGetResultResources and their operations over a CassandraViewGetResultResource. - public virtual CassandraViewGetResultCollection GetCassandraViewGetResults() - { - return GetCachedClient(client => new CassandraViewGetResultCollection(client, Id)); - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCassandraViewGetResultAsync(string viewName, CancellationToken cancellationToken = default) - { - return await GetCassandraViewGetResults().GetAsync(viewName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCassandraViewGetResult(string viewName, CancellationToken cancellationToken = default) - { - return GetCassandraViewGetResults().Get(viewName, cancellationToken); - } - /// /// Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. /// @@ -248,7 +179,7 @@ public virtual Response GetCassandraViewGetResul /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -288,7 +219,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -328,7 +259,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -370,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -412,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -458,7 +389,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -504,7 +435,7 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -566,7 +497,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -628,7 +559,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -685,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -742,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -802,7 +733,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs index 7b28e0c15052..13547e3a6bb0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateC /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateC /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs index af26b390f91e..30c7b13c2f66 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string tabl /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string tableName, Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string tableName, Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string tableName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs index cfc6d545c968..d575eb7a9ecd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -80,7 +74,6 @@ internal static CassandraTableData DeserializeCassandraTableData(JsonElement ele { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -93,16 +86,6 @@ internal static CassandraTableData DeserializeCassandraTableData(JsonElement ele Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -191,7 +174,6 @@ internal static CassandraTableData DeserializeCassandraTableData(JsonElement ele location, resource, options0, - identity, serializedAdditionalRawData); } @@ -278,21 +260,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.cs index 1dc8fd135507..efa48515ddcf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.cs @@ -66,13 +66,11 @@ public CassandraTableData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CassandraTableData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCassandraTableResourceInfo resource, CassandraTablePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CassandraTableData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCassandraTableResourceInfo resource, CassandraTablePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CassandraTableData() /// Gets or sets the options. [WirePath("properties.options")] public CassandraTablePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs index 3d488b8433bc..f20dcc4c2a6f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs @@ -111,7 +111,7 @@ public virtual CassandraTableThroughputSettingResource GetCassandraTableThroughp /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(Wait /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -367,7 +367,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -429,7 +429,7 @@ public virtual async Task> AddTagAsync(string k /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -491,7 +491,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -548,7 +548,7 @@ public virtual async Task> SetTagsAsync(IDictio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -605,7 +605,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -665,7 +665,7 @@ public virtual async Task> RemoveTagAsync(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs index 6550546353a3..e3684d8698c5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation MigrateCass /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual ArmOperation MigrateCass /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -506,7 +506,7 @@ public virtual async Task> Add /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -568,7 +568,7 @@ public virtual Response AddTag(string k /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -625,7 +625,7 @@ public virtual async Task> Set /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response SetTags(IDictio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> Rem /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs deleted file mode 100644 index 9fcc2c09d344..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCassandraViewGetResults method from an instance of . - /// - public partial class CassandraViewGetResultCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _cassandraViewGetResultCassandraResourcesClientDiagnostics; - private readonly CassandraResourcesRestOperations _cassandraViewGetResultCassandraResourcesRestClient; - - /// Initializes a new instance of the class for mocking. - protected CassandraViewGetResultCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CassandraViewGetResultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cassandraViewGetResultCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CassandraViewGetResultResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CassandraViewGetResultResource.ResourceType, out string cassandraViewGetResultCassandraResourcesApiVersion); - _cassandraViewGetResultCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraViewGetResultCassandraResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CassandraKeyspaceResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CassandraKeyspaceResource.ResourceType), nameof(id)); - } - - /// - /// Create or update an Azure Cosmos DB Cassandra View - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_CreateUpdateCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB view name. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string viewName, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.CreateUpdateCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, content, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewGetResultOperationSource(Client), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateCreateUpdateCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Cassandra View - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_CreateUpdateCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB view name. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string viewName, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.CreateUpdateCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, content, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewGetResultOperationSource(Client), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateCreateUpdateCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.Get"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.Get"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views - /// - /// - /// Operation Id - /// CassandraResources_ListCassandraViews - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraViewGetResultCassandraResourcesRestClient.CreateListCassandraViewsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CassandraViewGetResultResource(Client, CassandraViewGetResultData.DeserializeCassandraViewGetResultData(e)), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, "CassandraViewGetResultCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views - /// - /// - /// Operation Id - /// CassandraResources_ListCassandraViews - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraViewGetResultCassandraResourcesRestClient.CreateListCassandraViewsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CassandraViewGetResultResource(Client, CassandraViewGetResultData.DeserializeCassandraViewGetResultData(e)), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, "CassandraViewGetResultCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.Exists"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.Exists"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs deleted file mode 100644 index fb893398597d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs +++ /dev/null @@ -1,396 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CassandraViewGetResultData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Resource)) - { - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - } - if (Optional.IsDefined(Options)) - { - writer.WritePropertyName("options"u8); - writer.WriteObjectValue(Options, options); - } - writer.WriteEndObject(); - } - - CassandraViewGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewGetResultData(document.RootElement, options); - } - - internal static CassandraViewGetResultData DeserializeCassandraViewGetResultData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CassandraViewGetPropertiesResource resource = default; - CassandraViewGetPropertiesOptions options0 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resource = CassandraViewGetPropertiesResource.DeserializeCassandraViewGetPropertiesResource(property0.Value, options); - continue; - } - if (property0.NameEquals("options"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - options0 = CassandraViewGetPropertiesOptions.DeserializeCassandraViewGetPropertiesOptions(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewGetResultData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - options0, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Resource), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" options: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Options)) - { - builder.Append(" options: "); - BicepSerializationHelpers.AppendChildObject(builder, Options, options, 4, false, " options: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCassandraViewGetResultData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.cs deleted file mode 100644 index 2539d5967ab1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the CassandraViewGetResult data model. - /// An Azure Cosmos DB Cassandra view. - /// - public partial class CassandraViewGetResultData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public CassandraViewGetResultData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// - /// - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal CassandraViewGetResultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraViewGetPropertiesResource resource, CassandraViewGetPropertiesOptions options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Options = options; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CassandraViewGetResultData() - { - } - - /// Gets or sets the resource. - [WirePath("properties.resource")] - public CassandraViewGetPropertiesResource Resource { get; set; } - /// Gets or sets the options. - [WirePath("properties.options")] - public CassandraViewGetPropertiesOptions Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.Serialization.cs deleted file mode 100644 index e59269939c0f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CassandraViewGetResultResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - CassandraViewGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - CassandraViewGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs deleted file mode 100644 index 62337914de49..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs +++ /dev/null @@ -1,715 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CassandraViewGetResult along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCassandraViewGetResultResource method. - /// Otherwise you can get one from its parent resource using the GetCassandraViewGetResult method. - /// - public partial class CassandraViewGetResultResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The keyspaceName. - /// The viewName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cassandraViewGetResultCassandraResourcesClientDiagnostics; - private readonly CassandraResourcesRestOperations _cassandraViewGetResultCassandraResourcesRestClient; - private readonly CassandraViewGetResultData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views"; - - /// Initializes a new instance of the class for mocking. - protected CassandraViewGetResultResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CassandraViewGetResultResource(ArmClient client, CassandraViewGetResultData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CassandraViewGetResultResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cassandraViewGetResultCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cassandraViewGetResultCassandraResourcesApiVersion); - _cassandraViewGetResultCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraViewGetResultCassandraResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CassandraViewGetResultData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets an object representing a CassandraViewThroughputSettingResource along with the instance operations that can be performed on it in the CassandraViewGetResult. - /// Returns a object. - public virtual CassandraViewThroughputSettingResource GetCassandraViewThroughputSetting() - { - return new CassandraViewThroughputSettingResource(Client, Id.AppendChildResource("throughputSettings", "default")); - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Get"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Get"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Cassandra view. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_DeleteCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Delete"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.DeleteCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateDeleteCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Cassandra view. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_DeleteCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Delete"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.DeleteCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateDeleteCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Cassandra View - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_CreateUpdateCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Update"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.CreateUpdateCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewGetResultOperationSource(Client), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateCreateUpdateCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Cassandra View - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_CreateUpdateCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Update"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.CreateUpdateCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewGetResultOperationSource(Client), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateCreateUpdateCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.Serialization.cs deleted file mode 100644 index 2475f83486ec..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CassandraViewThroughputSettingResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ThroughputSettingData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ThroughputSettingData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs deleted file mode 100644 index 90332502eda7..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs +++ /dev/null @@ -1,792 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CassandraViewThroughputSetting along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCassandraViewThroughputSettingResource method. - /// Otherwise you can get one from its parent resource using the GetCassandraViewThroughputSetting method. - /// - public partial class CassandraViewThroughputSettingResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The keyspaceName. - /// The viewName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics; - private readonly CassandraResourcesRestOperations _cassandraViewThroughputSettingCassandraResourcesRestClient; - private readonly ThroughputSettingData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views/throughputSettings"; - - /// Initializes a new instance of the class for mocking. - protected CassandraViewThroughputSettingResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CassandraViewThroughputSettingResource(ArmClient client, ThroughputSettingData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CassandraViewThroughputSettingResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cassandraViewThroughputSettingCassandraResourcesApiVersion); - _cassandraViewThroughputSettingCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraViewThroughputSettingCassandraResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual ThroughputSettingData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.Get"); - scope.Start(); - try - { - var response = await _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.Get"); - scope.Start(); - try - { - var response = _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update RUs per second of an Azure Cosmos DB Cassandra view - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_UpdateCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The RUs per second of the parameters to provide for the current Cassandra view. - /// The cancellation token to use. - /// is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, ThroughputSettingsUpdateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cassandraViewThroughputSettingCassandraResourcesRestClient.UpdateCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateUpdateCassandraViewThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update RUs per second of an Azure Cosmos DB Cassandra view - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_UpdateCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The RUs per second of the parameters to provide for the current Cassandra view. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, ThroughputSettingsUpdateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cassandraViewThroughputSettingCassandraResourcesRestClient.UpdateCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateUpdateCassandraViewThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale - /// - /// - /// Operation Id - /// CassandraResources_MigrateCassandraViewToAutoscale - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task> MigrateCassandraViewToAutoscaleAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.MigrateCassandraViewToAutoscale"); - scope.Start(); - try - { - var response = await _cassandraViewThroughputSettingCassandraResourcesRestClient.MigrateCassandraViewToAutoscaleAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateMigrateCassandraViewToAutoscaleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale - /// - /// - /// Operation Id - /// CassandraResources_MigrateCassandraViewToAutoscale - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation MigrateCassandraViewToAutoscale(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.MigrateCassandraViewToAutoscale"); - scope.Start(); - try - { - var response = _cassandraViewThroughputSettingCassandraResourcesRestClient.MigrateCassandraViewToAutoscale(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateMigrateCassandraViewToAutoscaleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput - /// - /// - /// Operation Id - /// CassandraResources_MigrateCassandraViewToManualThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task> MigrateCassandraViewToManualThroughputAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.MigrateCassandraViewToManualThroughput"); - scope.Start(); - try - { - var response = await _cassandraViewThroughputSettingCassandraResourcesRestClient.MigrateCassandraViewToManualThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateMigrateCassandraViewToManualThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput - /// - /// - /// Operation Id - /// CassandraResources_MigrateCassandraViewToManualThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation MigrateCassandraViewToManualThroughput(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.MigrateCassandraViewToManualThroughput"); - scope.Start(); - try - { - var response = _cassandraViewThroughputSettingCassandraResourcesRestClient.MigrateCassandraViewToManualThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateMigrateCassandraViewToManualThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await CreateOrUpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = CreateOrUpdate(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = await CreateOrUpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = CreateOrUpdate(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await CreateOrUpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = CreateOrUpdate(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs index a510ac87716c..dba2c7613a53 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -164,7 +164,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string acc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string accountName, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string accountName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string accountName, CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs index 7e56326f9502..7c96108ffc8b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs @@ -267,11 +267,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } - if (Optional.IsDefined(DiagnosticLogSettings)) - { - writer.WritePropertyName("diagnosticLogSettings"u8); - writer.WriteObjectValue(DiagnosticLogSettings, options); - } if (Optional.IsDefined(DisableLocalAuth)) { writer.WritePropertyName("disableLocalAuth"u8); @@ -282,21 +277,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("capacity"u8); writer.WriteObjectValue(Capacity, options); } - if (Optional.IsDefined(CapacityMode)) - { - writer.WritePropertyName("capacityMode"u8); - writer.WriteStringValue(CapacityMode.Value.ToString()); - } - if (Optional.IsDefined(CapacityModeChangeTransitionState)) - { - writer.WritePropertyName("capacityModeChangeTransitionState"u8); - writer.WriteObjectValue(CapacityModeChangeTransitionState, options); - } - if (Optional.IsDefined(EnableMaterializedViews)) - { - writer.WritePropertyName("enableMaterializedViews"u8); - writer.WriteBooleanValue(EnableMaterializedViews.Value); - } if (options.Format != "W" && Optional.IsDefined(KeysMetadata)) { writer.WritePropertyName("keysMetadata"u8); @@ -307,31 +287,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("enablePartitionMerge"u8); writer.WriteBooleanValue(EnablePartitionMerge.Value); } - if (Optional.IsDefined(EnableBurstCapacity)) - { - writer.WritePropertyName("enableBurstCapacity"u8); - writer.WriteBooleanValue(EnableBurstCapacity.Value); - } if (Optional.IsDefined(MinimalTlsVersion)) { writer.WritePropertyName("minimalTlsVersion"u8); writer.WriteStringValue(MinimalTlsVersion.Value.ToString()); } + if (Optional.IsDefined(EnableBurstCapacity)) + { + writer.WritePropertyName("enableBurstCapacity"u8); + writer.WriteBooleanValue(EnableBurstCapacity.Value); + } if (Optional.IsDefined(CustomerManagedKeyStatus)) { writer.WritePropertyName("customerManagedKeyStatus"u8); writer.WriteStringValue(CustomerManagedKeyStatus); } - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - writer.WritePropertyName("enablePriorityBasedExecution"u8); - writer.WriteBooleanValue(EnablePriorityBasedExecution.Value); - } - if (Optional.IsDefined(DefaultPriorityLevel)) - { - writer.WritePropertyName("defaultPriorityLevel"u8); - writer.WriteStringValue(DefaultPriorityLevel.Value.ToString()); - } if (Optional.IsDefined(EnablePerRegionPerPartitionAutoscale)) { writer.WritePropertyName("enablePerRegionPerPartitionAutoscale"u8); @@ -400,19 +370,13 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e IList cors = default; NetworkAclBypass? networkAclBypass = default; IList networkAclBypassResourceIds = default; - DiagnosticLogSettings diagnosticLogSettings = default; bool? disableLocalAuth = default; CosmosDBAccountCapacity capacity = default; - CapacityMode? capacityMode = default; - CapacityModeChangeTransitionState capacityModeChangeTransitionState = default; - bool? enableMaterializedViews = default; DatabaseAccountKeysMetadata keysMetadata = default; bool? enablePartitionMerge = default; - bool? enableBurstCapacity = default; CosmosDBMinimalTlsVersion? minimalTlsVersion = default; + bool? enableBurstCapacity = default; string customerManagedKeyStatus = default; - bool? enablePriorityBasedExecution = default; - DefaultPriorityLevel? defaultPriorityLevel = default; bool? enablePerRegionPerPartitionAutoscale = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -822,15 +786,6 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e networkAclBypassResourceIds = array; continue; } - if (property0.NameEquals("diagnosticLogSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diagnosticLogSettings = DiagnosticLogSettings.DeserializeDiagnosticLogSettings(property0.Value, options); - continue; - } if (property0.NameEquals("disableLocalAuth"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -849,33 +804,6 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e capacity = CosmosDBAccountCapacity.DeserializeCosmosDBAccountCapacity(property0.Value, options); continue; } - if (property0.NameEquals("capacityMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityMode = new CapacityMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("capacityModeChangeTransitionState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeChangeTransitionState = CapacityModeChangeTransitionState.DeserializeCapacityModeChangeTransitionState(property0.Value, options); - continue; - } - if (property0.NameEquals("enableMaterializedViews"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableMaterializedViews = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("keysMetadata"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -894,15 +822,6 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e enablePartitionMerge = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enableBurstCapacity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableBurstCapacity = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("minimalTlsVersion"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -912,27 +831,18 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e minimalTlsVersion = new CosmosDBMinimalTlsVersion(property0.Value.GetString()); continue; } - if (property0.NameEquals("customerManagedKeyStatus"u8)) - { - customerManagedKeyStatus = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enablePriorityBasedExecution"u8)) + if (property0.NameEquals("enableBurstCapacity"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - enablePriorityBasedExecution = property0.Value.GetBoolean(); + enableBurstCapacity = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("defaultPriorityLevel"u8)) + if (property0.NameEquals("customerManagedKeyStatus"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defaultPriorityLevel = new DefaultPriorityLevel(property0.Value.GetString()); + customerManagedKeyStatus = property0.Value.GetString(); continue; } if (property0.NameEquals("enablePerRegionPerPartitionAutoscale"u8)) @@ -961,6 +871,7 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e tags ?? new ChangeTrackingDictionary(), location, kind, + identity, provisioningState, documentEndpoint, databaseAccountOfferType, @@ -993,21 +904,14 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e cors ?? new ChangeTrackingList(), networkAclBypass, networkAclBypassResourceIds ?? new ChangeTrackingList(), - diagnosticLogSettings, disableLocalAuth, capacity, - capacityMode, - capacityModeChangeTransitionState, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, - identity, serializedAdditionalRawData); } @@ -1762,26 +1666,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DiagnosticLogEnableFullTextQuery", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" diagnosticLogSettings: "); - builder.AppendLine("{"); - builder.AppendLine(" diagnosticLogSettings: {"); - builder.Append(" enableFullTextQuery: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(DiagnosticLogSettings)) - { - builder.Append(" diagnosticLogSettings: "); - BicepSerializationHelpers.AppendChildObject(builder, DiagnosticLogSettings, options, 4, false, " diagnosticLogSettings: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisableLocalAuth), out propertyOverride); if (hasPropertyOverride) { @@ -1818,52 +1702,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityMode)) - { - builder.Append(" capacityMode: "); - builder.AppendLine($"'{CapacityMode.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeChangeTransitionState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeChangeTransitionState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeChangeTransitionState)) - { - builder.Append(" capacityModeChangeTransitionState: "); - BicepSerializationHelpers.AppendChildObject(builder, CapacityModeChangeTransitionState, options, 4, false, " capacityModeChangeTransitionState: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableMaterializedViews), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enableMaterializedViews: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnableMaterializedViews)) - { - builder.Append(" enableMaterializedViews: "); - var boolValue = EnableMaterializedViews.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeysMetadata), out propertyOverride); if (hasPropertyOverride) { @@ -1895,34 +1733,34 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableBurstCapacity), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimalTlsVersion), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" enableBurstCapacity: "); + builder.Append(" minimalTlsVersion: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(EnableBurstCapacity)) + if (Optional.IsDefined(MinimalTlsVersion)) { - builder.Append(" enableBurstCapacity: "); - var boolValue = EnableBurstCapacity.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); + builder.Append(" minimalTlsVersion: "); + builder.AppendLine($"'{MinimalTlsVersion.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimalTlsVersion), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableBurstCapacity), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" minimalTlsVersion: "); + builder.Append(" enableBurstCapacity: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(MinimalTlsVersion)) + if (Optional.IsDefined(EnableBurstCapacity)) { - builder.Append(" minimalTlsVersion: "); - builder.AppendLine($"'{MinimalTlsVersion.Value.ToString()}'"); + builder.Append(" enableBurstCapacity: "); + var boolValue = EnableBurstCapacity.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); } } @@ -1949,37 +1787,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePriorityBasedExecution), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enablePriorityBasedExecution: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - builder.Append(" enablePriorityBasedExecution: "); - var boolValue = EnablePriorityBasedExecution.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DefaultPriorityLevel), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" defaultPriorityLevel: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DefaultPriorityLevel)) - { - builder.Append(" defaultPriorityLevel: "); - builder.AppendLine($"'{DefaultPriorityLevel.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePerRegionPerPartitionAutoscale), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs index 349d2b3b0892..0e8a7ba8458e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs @@ -75,7 +75,8 @@ public CosmosDBAccountData(AzureLocation location) : base(location) /// The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. - /// The provisioning state of the resource. + /// Identity for the resource. + /// The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. /// The connection endpoint for the Cosmos DB database account. /// The offer type for the Cosmos DB database account. Default value: Standard. /// List of IpRules. @@ -111,25 +112,19 @@ public CosmosDBAccountData(AzureLocation location) : base(location) /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// The object that represents the migration state for the CapacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// The object that represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - /// Identity for the resource. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. /// Keeps track of any properties unknown to the library. - internal CosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, string provisioningState, string documentEndpoint, CosmosDBAccountOfferType? databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, ConsistencyPolicy consistencyPolicy, IList capabilities, IReadOnlyList writeLocations, IReadOnlyList readLocations, IReadOnlyList locations, IReadOnlyList failoverPolicies, IList virtualNetworkRules, IReadOnlyList privateEndpointConnections, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, Guid? instanceId, CosmosDBAccountCreateMode? createMode, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, CapacityModeChangeTransitionState capacityModeChangeTransitionState, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, ManagedServiceIdentity identity, string provisioningState, string documentEndpoint, CosmosDBAccountOfferType? databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, ConsistencyPolicy consistencyPolicy, IList capabilities, IReadOnlyList writeLocations, IReadOnlyList readLocations, IReadOnlyList locations, IReadOnlyList failoverPolicies, IList virtualNetworkRules, IReadOnlyList privateEndpointConnections, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, Guid? instanceId, CosmosDBAccountCreateMode? createMode, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, CosmosDBMinimalTlsVersion? minimalTlsVersion, bool? enableBurstCapacity, string customerManagedKeyStatus, bool? enablePerRegionPerPartitionAutoscale, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Kind = kind; + Identity = identity; ProvisioningState = provisioningState; DocumentEndpoint = documentEndpoint; DatabaseAccountOfferType = databaseAccountOfferType; @@ -162,21 +157,14 @@ internal CosmosDBAccountData(ResourceIdentifier id, string name, ResourceType re Cors = cors; NetworkAclBypass = networkAclBypass; NetworkAclBypassResourceIds = networkAclBypassResourceIds; - DiagnosticLogSettings = diagnosticLogSettings; DisableLocalAuth = disableLocalAuth; Capacity = capacity; - CapacityMode = capacityMode; - CapacityModeChangeTransitionState = capacityModeChangeTransitionState; - EnableMaterializedViews = enableMaterializedViews; KeysMetadata = keysMetadata; EnablePartitionMerge = enablePartitionMerge; - EnableBurstCapacity = enableBurstCapacity; MinimalTlsVersion = minimalTlsVersion; + EnableBurstCapacity = enableBurstCapacity; CustomerManagedKeyStatus = customerManagedKeyStatus; - EnablePriorityBasedExecution = enablePriorityBasedExecution; - DefaultPriorityLevel = defaultPriorityLevel; EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -188,7 +176,10 @@ internal CosmosDBAccountData() /// Indicates the type of database account. This can only be set at database account creation. [WirePath("kind")] public CosmosDBAccountKind? Kind { get; set; } - /// The provisioning state of the resource. + /// Identity for the resource. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } + /// The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. [WirePath("properties.provisioningState")] public string ProvisioningState { get; } /// The connection endpoint for the Cosmos DB database account. @@ -312,21 +303,6 @@ public AnalyticalStorageSchemaType? AnalyticalStorageSchemaType /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. [WirePath("properties.networkAclBypassResourceIds")] public IList NetworkAclBypassResourceIds { get; } - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. - internal DiagnosticLogSettings DiagnosticLogSettings { get; set; } - /// Describe the level of detail with which queries are to be logged. - [WirePath("properties.diagnosticLogSettings.enableFullTextQuery")] - public EnableFullTextQuery? DiagnosticLogEnableFullTextQuery - { - get => DiagnosticLogSettings is null ? default : DiagnosticLogSettings.EnableFullTextQuery; - set - { - if (DiagnosticLogSettings is null) - DiagnosticLogSettings = new DiagnosticLogSettings(); - DiagnosticLogSettings.EnableFullTextQuery = value; - } - } - /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. [WirePath("properties.disableLocalAuth")] public bool? DisableLocalAuth { get; set; } @@ -345,41 +321,23 @@ public int? CapacityTotalThroughputLimit } } - /// Indicates the capacityMode of the Cosmos DB account. - [WirePath("properties.capacityMode")] - public CapacityMode? CapacityMode { get; set; } - /// The object that represents the migration state for the CapacityMode of the Cosmos DB account. - [WirePath("properties.capacityModeChangeTransitionState")] - public CapacityModeChangeTransitionState CapacityModeChangeTransitionState { get; set; } - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. - [WirePath("properties.enableMaterializedViews")] - public bool? EnableMaterializedViews { get; set; } /// The object that represents the metadata for the Account Keys of the Cosmos DB account. [WirePath("properties.keysMetadata")] public DatabaseAccountKeysMetadata KeysMetadata { get; } /// Flag to indicate enabling/disabling of Partition Merge feature on the account. [WirePath("properties.enablePartitionMerge")] public bool? EnablePartitionMerge { get; set; } - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - [WirePath("properties.enableBurstCapacity")] - public bool? EnableBurstCapacity { get; set; } - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. [WirePath("properties.minimalTlsVersion")] public CosmosDBMinimalTlsVersion? MinimalTlsVersion { get; set; } + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. + [WirePath("properties.enableBurstCapacity")] + public bool? EnableBurstCapacity { get; set; } /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. [WirePath("properties.customerManagedKeyStatus")] public string CustomerManagedKeyStatus { get; set; } - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - [WirePath("properties.enablePriorityBasedExecution")] - public bool? EnablePriorityBasedExecution { get; set; } - /// Enum to indicate default Priority Level of request for Priority Based Execution. - [WirePath("properties.defaultPriorityLevel")] - public DefaultPriorityLevel? DefaultPriorityLevel { get; set; } - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. [WirePath("properties.enablePerRegionPerPartitionAutoscale")] public bool? EnablePerRegionPerPartitionAutoscale { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs index 742c80d997e3..5ca6d8065932 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs @@ -135,144 +135,6 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } - /// Gets a collection of CosmosDBChaosFaultResources in the CosmosDBAccount. - /// An object representing collection of CosmosDBChaosFaultResources and their operations over a CosmosDBChaosFaultResource. - public virtual CosmosDBChaosFaultResourceCollection GetCosmosDBChaosFaultResources() - { - return GetCachedClient(client => new CosmosDBChaosFaultResourceCollection(client, Id)); - } - - /// - /// Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the ChaosFault. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCosmosDBChaosFaultResourceAsync(string chaosFault, CancellationToken cancellationToken = default) - { - return await GetCosmosDBChaosFaultResources().GetAsync(chaosFault, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the ChaosFault. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCosmosDBChaosFaultResource(string chaosFault, CancellationToken cancellationToken = default) - { - return GetCosmosDBChaosFaultResources().Get(chaosFault, cancellationToken); - } - - /// Gets a collection of GraphResourceGetResultResources in the CosmosDBAccount. - /// An object representing collection of GraphResourceGetResultResources and their operations over a GraphResourceGetResultResource. - public virtual GraphResourceGetResultCollection GetGraphResourceGetResults() - { - return GetCachedClient(client => new GraphResourceGetResultCollection(client, Id)); - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetGraphResourceGetResultAsync(string graphName, CancellationToken cancellationToken = default) - { - return await GetGraphResourceGetResults().GetAsync(graphName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetGraphResourceGetResult(string graphName, CancellationToken cancellationToken = default) - { - return GetGraphResourceGetResults().Get(graphName, cancellationToken); - } - /// Gets a collection of CosmosDBSqlDatabaseResources in the CosmosDBAccount. /// An object representing collection of CosmosDBSqlDatabaseResources and their operations over a CosmosDBSqlDatabaseResource. public virtual CosmosDBSqlDatabaseCollection GetCosmosDBSqlDatabases() @@ -293,7 +155,7 @@ public virtual CosmosDBSqlDatabaseCollection GetCosmosDBSqlDatabases() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -324,7 +186,7 @@ public virtual async Task> GetCosmosDBSqlD /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -362,7 +224,7 @@ public virtual CosmosDBSqlRoleDefinitionCollection GetCosmosDBSqlRoleDefinitions /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -393,7 +255,7 @@ public virtual async Task> GetCosmos /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -431,7 +293,7 @@ public virtual CosmosDBSqlRoleAssignmentCollection GetCosmosDBSqlRoleAssignments /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -462,7 +324,7 @@ public virtual async Task> GetCosmos /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -500,7 +362,7 @@ public virtual MongoDBDatabaseCollection GetMongoDBDatabases() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -531,7 +393,7 @@ public virtual async Task> GetMongoDBDatabaseA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -569,7 +431,7 @@ public virtual MongoDBRoleDefinitionCollection GetMongoDBRoleDefinitions() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -600,7 +462,7 @@ public virtual async Task> GetMongoDBRol /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -638,7 +500,7 @@ public virtual MongoDBUserDefinitionCollection GetMongoDBUserDefinitions() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -669,7 +531,7 @@ public virtual async Task> GetMongoDBUse /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -707,7 +569,7 @@ public virtual CosmosDBTableCollection GetCosmosDBTables() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -738,7 +600,7 @@ public virtual async Task> GetCosmosDBTableAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -756,144 +618,6 @@ public virtual Response GetCosmosDBTable(string tableName return GetCosmosDBTables().Get(tableName, cancellationToken); } - /// Gets a collection of CosmosDBTableRoleDefinitionResources in the CosmosDBAccount. - /// An object representing collection of CosmosDBTableRoleDefinitionResources and their operations over a CosmosDBTableRoleDefinitionResource. - public virtual CosmosDBTableRoleDefinitionCollection GetCosmosDBTableRoleDefinitions() - { - return GetCachedClient(client => new CosmosDBTableRoleDefinitionCollection(client, Id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Definition. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCosmosDBTableRoleDefinitionAsync(string roleDefinitionId, CancellationToken cancellationToken = default) - { - return await GetCosmosDBTableRoleDefinitions().GetAsync(roleDefinitionId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Definition. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCosmosDBTableRoleDefinition(string roleDefinitionId, CancellationToken cancellationToken = default) - { - return GetCosmosDBTableRoleDefinitions().Get(roleDefinitionId, cancellationToken); - } - - /// Gets a collection of CosmosDBTableRoleAssignmentResources in the CosmosDBAccount. - /// An object representing collection of CosmosDBTableRoleAssignmentResources and their operations over a CosmosDBTableRoleAssignmentResource. - public virtual CosmosDBTableRoleAssignmentCollection GetCosmosDBTableRoleAssignments() - { - return GetCachedClient(client => new CosmosDBTableRoleAssignmentCollection(client, Id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Assignment. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCosmosDBTableRoleAssignmentAsync(string roleAssignmentId, CancellationToken cancellationToken = default) - { - return await GetCosmosDBTableRoleAssignments().GetAsync(roleAssignmentId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Assignment. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCosmosDBTableRoleAssignment(string roleAssignmentId, CancellationToken cancellationToken = default) - { - return GetCosmosDBTableRoleAssignments().Get(roleAssignmentId, cancellationToken); - } - /// Gets a collection of CassandraKeyspaceResources in the CosmosDBAccount. /// An object representing collection of CassandraKeyspaceResources and their operations over a CassandraKeyspaceResource. public virtual CassandraKeyspaceCollection GetCassandraKeyspaces() @@ -914,7 +638,7 @@ public virtual CassandraKeyspaceCollection GetCassandraKeyspaces() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -945,7 +669,7 @@ public virtual async Task> GetCassandraKeysp /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -983,7 +707,7 @@ public virtual GremlinDatabaseCollection GetGremlinDatabases() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1014,7 +738,7 @@ public virtual async Task> GetGremlinDatabaseA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1032,144 +756,6 @@ public virtual Response GetGremlinDatabase(string datab return GetGremlinDatabases().Get(databaseName, cancellationToken); } - /// Gets a collection of DataTransferJobGetResultResources in the CosmosDBAccount. - /// An object representing collection of DataTransferJobGetResultResources and their operations over a DataTransferJobGetResultResource. - public virtual DataTransferJobGetResultCollection GetDataTransferJobGetResults() - { - return GetCachedClient(client => new DataTransferJobGetResultCollection(client, Id)); - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetDataTransferJobGetResultAsync(string jobName, CancellationToken cancellationToken = default) - { - return await GetDataTransferJobGetResults().GetAsync(jobName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetDataTransferJobGetResult(string jobName, CancellationToken cancellationToken = default) - { - return GetDataTransferJobGetResults().Get(jobName, cancellationToken); - } - - /// Gets a collection of NetworkSecurityPerimeterConfigurationResources in the CosmosDBAccount. - /// An object representing collection of NetworkSecurityPerimeterConfigurationResources and their operations over a NetworkSecurityPerimeterConfigurationResource. - public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurityPerimeterConfigurations() - { - return GetCachedClient(client => new NetworkSecurityPerimeterConfigurationCollection(client, Id)); - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetNetworkSecurityPerimeterConfigurationAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - return await GetNetworkSecurityPerimeterConfigurations().GetAsync(networkSecurityPerimeterConfigurationName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetNetworkSecurityPerimeterConfiguration(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - return GetNetworkSecurityPerimeterConfigurations().Get(networkSecurityPerimeterConfigurationName, cancellationToken); - } - /// Gets a collection of CosmosDBPrivateEndpointConnectionResources in the CosmosDBAccount. /// An object representing collection of CosmosDBPrivateEndpointConnectionResources and their operations over a CosmosDBPrivateEndpointConnectionResource. public virtual CosmosDBPrivateEndpointConnectionCollection GetCosmosDBPrivateEndpointConnections() @@ -1190,7 +776,7 @@ public virtual CosmosDBPrivateEndpointConnectionCollection GetCosmosDBPrivateEnd /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1221,7 +807,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1259,7 +845,7 @@ public virtual CosmosDBPrivateLinkResourceCollection GetCosmosDBPrivateLinkResou /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1290,7 +876,7 @@ public virtual async Task> GetCosmosDBPriv /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1328,7 +914,7 @@ public virtual CosmosDBServiceCollection GetCosmosDBServices() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1359,7 +945,7 @@ public virtual async Task> GetCosmosDBServiceA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1390,7 +976,7 @@ public virtual Response GetCosmosDBService(string servi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1430,7 +1016,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1470,7 +1056,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1512,7 +1098,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1554,7 +1140,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1600,7 +1186,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1646,7 +1232,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1692,7 +1278,7 @@ public virtual async Task FailoverPriorityChangeAsync(WaitUntil wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1738,7 +1324,7 @@ public virtual ArmOperation FailoverPriorityChange(WaitUntil waitUntil, CosmosDB /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1776,7 +1362,7 @@ public virtual async Task> GetKeysAsync(Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1814,7 +1400,7 @@ public virtual Response GetKeys(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1843,7 +1429,7 @@ public virtual AsyncPageable GetConnectionStrin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1872,7 +1458,7 @@ public virtual Pageable GetConnectionStrings(Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1918,7 +1504,7 @@ public virtual async Task OfflineRegionAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1964,7 +1550,7 @@ public virtual ArmOperation OfflineRegion(WaitUntil waitUntil, RegionForOnlineOf /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -2010,7 +1596,7 @@ public virtual async Task OnlineRegionAsync(WaitUntil waitUntil, R /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -2056,7 +1642,7 @@ public virtual ArmOperation OnlineRegion(WaitUntil waitUntil, RegionForOnlineOff /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -2094,7 +1680,7 @@ public virtual async Task> GetReadOnlyK /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -2132,7 +1718,7 @@ public virtual Response GetReadOnlyKeys(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -2178,7 +1764,7 @@ public virtual async Task RegenerateKeyAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -2224,7 +1810,7 @@ public virtual ArmOperation RegenerateKey(WaitUntil waitUntil, CosmosDBAccountRe /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -2257,7 +1843,7 @@ public virtual AsyncPageable GetMetricsAsync(string filter, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -2290,7 +1876,7 @@ public virtual Pageable GetMetrics(string filter, Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -2320,7 +1906,7 @@ public virtual AsyncPageable GetUsagesAsync(string filter = n /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -2350,7 +1936,7 @@ public virtual Pageable GetUsages(string filter = null, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -2379,7 +1965,7 @@ public virtual AsyncPageable GetMetricDefinitionsAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -2408,7 +1994,7 @@ public virtual Pageable GetMetricDefinitions(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2440,7 +2026,7 @@ public virtual AsyncPageable GetMetricsDatabasesAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2472,7 +2058,7 @@ public virtual Pageable GetMetricsDatabases(string databaseR /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2503,7 +2089,7 @@ public virtual AsyncPageable GetUsagesDatabasesAsync(string d /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2534,7 +2120,7 @@ public virtual Pageable GetUsagesDatabases(string databaseRid /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2564,7 +2150,7 @@ public virtual AsyncPageable GetMetricDefinitionsDatab /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2594,7 +2180,7 @@ public virtual Pageable GetMetricDefinitionsDatabases( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2628,7 +2214,7 @@ public virtual AsyncPageable GetMetricsCollectionsAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2662,7 +2248,7 @@ public virtual Pageable GetMetricsCollections(string databas /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2695,7 +2281,7 @@ public virtual AsyncPageable GetUsagesCollectionsAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2728,7 +2314,7 @@ public virtual Pageable GetUsagesCollections(string databaseR /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2760,7 +2346,7 @@ public virtual AsyncPageable GetMetricDefinitionsColle /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2792,7 +2378,7 @@ public virtual Pageable GetMetricDefinitionsCollection /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2828,7 +2414,7 @@ public virtual AsyncPageable GetMetricsCollectionRegionsAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2864,7 +2450,7 @@ public virtual Pageable GetMetricsCollectionRegions(string r /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2896,7 +2482,7 @@ public virtual AsyncPageable GetMetricsDatabaseAccountRegion /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2928,7 +2514,7 @@ public virtual Pageable GetMetricsDatabaseAccountRegions(str /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2962,7 +2548,7 @@ public virtual AsyncPageable GetMetricsPercentileSourc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -2996,7 +2582,7 @@ public virtual Pageable GetMetricsPercentileSourceTarg /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3028,7 +2614,7 @@ public virtual AsyncPageable GetMetricsPercentileTarge /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3060,7 +2646,7 @@ public virtual Pageable GetMetricsPercentileTargets(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3089,7 +2675,7 @@ public virtual AsyncPageable GetMetricsPercentilesAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3118,7 +2704,7 @@ public virtual Pageable GetMetricsPercentiles(string f /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3154,7 +2740,7 @@ public virtual AsyncPageable GetMetricsCollectionPartitionRegio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3190,7 +2776,7 @@ public virtual Pageable GetMetricsCollectionPartitionRegions(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3224,7 +2810,7 @@ public virtual AsyncPageable GetMetricsCollectionPartitionsAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3258,7 +2844,7 @@ public virtual Pageable GetMetricsCollectionPartitions(string d /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3291,7 +2877,7 @@ public virtual AsyncPageable GetUsagesCollectionPartitionsAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3324,7 +2910,7 @@ public virtual Pageable GetUsagesCollectionPartitions(string dat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3360,7 +2946,7 @@ public virtual AsyncPageable GetMetricsPartitionKeyRangeIdsAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3396,7 +2982,7 @@ public virtual Pageable GetMetricsPartitionKeyRangeIds(string d /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3434,7 +3020,7 @@ public virtual AsyncPageable GetMetricsPartitionKeyRangeIdRegio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -3472,7 +3058,7 @@ public virtual Pageable GetMetricsPartitionKeyRangeIdRegions(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -3534,7 +3120,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -3596,7 +3182,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -3653,7 +3239,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -3710,7 +3296,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -3770,7 +3356,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResource.Serialization.cs deleted file mode 100644 index cca1a650423b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBChaosFaultResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - CosmosDBChaosFaultResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - CosmosDBChaosFaultResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResource.cs deleted file mode 100644 index a169f17faca0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResource.cs +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CosmosDBChaosFaultResource along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCosmosDBChaosFaultResource method. - /// Otherwise you can get one from its parent resource using the GetCosmosDBChaosFaultResource method. - /// - public partial class CosmosDBChaosFaultResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The chaosFault. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string chaosFault) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics; - private readonly ChaosFaultRestOperations _cosmosDBChaosFaultResourceChaosFaultRestClient; - private readonly CosmosDBChaosFaultResourceData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/chaosFaults"; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBChaosFaultResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CosmosDBChaosFaultResource(ArmClient client, CosmosDBChaosFaultResourceData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CosmosDBChaosFaultResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cosmosDBChaosFaultResourceChaosFaultApiVersion); - _cosmosDBChaosFaultResourceChaosFaultRestClient = new ChaosFaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBChaosFaultResourceChaosFaultApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CosmosDBChaosFaultResourceData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics.CreateScope("CosmosDBChaosFaultResource.Get"); - scope.Start(); - try - { - var response = await _cosmosDBChaosFaultResourceChaosFaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBChaosFaultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics.CreateScope("CosmosDBChaosFaultResource.Get"); - scope.Start(); - try - { - var response = _cosmosDBChaosFaultResourceChaosFaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBChaosFaultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Enable, disable Chaos Fault in a CosmosDB account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_EnableDisable - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// A request object to enable/disable the chaos fault. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CosmosDBChaosFaultResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics.CreateScope("CosmosDBChaosFaultResource.Update"); - scope.Start(); - try - { - var response = await _cosmosDBChaosFaultResourceChaosFaultRestClient.EnableDisableAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBChaosFaultResourceOperationSource(Client), _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics, Pipeline, _cosmosDBChaosFaultResourceChaosFaultRestClient.CreateEnableDisableRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Enable, disable Chaos Fault in a CosmosDB account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_EnableDisable - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// A request object to enable/disable the chaos fault. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CosmosDBChaosFaultResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics.CreateScope("CosmosDBChaosFaultResource.Update"); - scope.Start(); - try - { - var response = _cosmosDBChaosFaultResourceChaosFaultRestClient.EnableDisable(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBChaosFaultResourceOperationSource(Client), _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics, Pipeline, _cosmosDBChaosFaultResourceChaosFaultRestClient.CreateEnableDisableRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceCollection.cs deleted file mode 100644 index ec5dc1bdb601..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceCollection.cs +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCosmosDBChaosFaultResources method from an instance of . - /// - public partial class CosmosDBChaosFaultResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics; - private readonly ChaosFaultRestOperations _cosmosDBChaosFaultResourceChaosFaultRestClient; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBChaosFaultResourceCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CosmosDBChaosFaultResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBChaosFaultResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBChaosFaultResource.ResourceType, out string cosmosDBChaosFaultResourceChaosFaultApiVersion); - _cosmosDBChaosFaultResourceChaosFaultRestClient = new ChaosFaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBChaosFaultResourceChaosFaultApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); - } - - /// - /// Enable, disable Chaos Fault in a CosmosDB account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_EnableDisable - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the ChaosFault. - /// A request object to enable/disable the chaos fault. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string chaosFault, CosmosDBChaosFaultResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(chaosFault, nameof(chaosFault)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics.CreateScope("CosmosDBChaosFaultResourceCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cosmosDBChaosFaultResourceChaosFaultRestClient.EnableDisableAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, chaosFault, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBChaosFaultResourceOperationSource(Client), _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics, Pipeline, _cosmosDBChaosFaultResourceChaosFaultRestClient.CreateEnableDisableRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, chaosFault, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Enable, disable Chaos Fault in a CosmosDB account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_EnableDisable - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the ChaosFault. - /// A request object to enable/disable the chaos fault. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string chaosFault, CosmosDBChaosFaultResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(chaosFault, nameof(chaosFault)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics.CreateScope("CosmosDBChaosFaultResourceCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cosmosDBChaosFaultResourceChaosFaultRestClient.EnableDisable(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, chaosFault, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBChaosFaultResourceOperationSource(Client), _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics, Pipeline, _cosmosDBChaosFaultResourceChaosFaultRestClient.CreateEnableDisableRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, chaosFault, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the ChaosFault. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string chaosFault, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(chaosFault, nameof(chaosFault)); - - using var scope = _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics.CreateScope("CosmosDBChaosFaultResourceCollection.Get"); - scope.Start(); - try - { - var response = await _cosmosDBChaosFaultResourceChaosFaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, chaosFault, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBChaosFaultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the ChaosFault. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string chaosFault, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(chaosFault, nameof(chaosFault)); - - using var scope = _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics.CreateScope("CosmosDBChaosFaultResourceCollection.Get"); - scope.Start(); - try - { - var response = _cosmosDBChaosFaultResourceChaosFaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, chaosFault, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBChaosFaultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List Chaos Faults for CosmosDB account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults - /// - /// - /// Operation Id - /// ChaosFault_List - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBChaosFaultResourceChaosFaultRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBChaosFaultResourceChaosFaultRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBChaosFaultResource(Client, CosmosDBChaosFaultResourceData.DeserializeCosmosDBChaosFaultResourceData(e)), _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics, Pipeline, "CosmosDBChaosFaultResourceCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List Chaos Faults for CosmosDB account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults - /// - /// - /// Operation Id - /// ChaosFault_List - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBChaosFaultResourceChaosFaultRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBChaosFaultResourceChaosFaultRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBChaosFaultResource(Client, CosmosDBChaosFaultResourceData.DeserializeCosmosDBChaosFaultResourceData(e)), _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics, Pipeline, "CosmosDBChaosFaultResourceCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the ChaosFault. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string chaosFault, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(chaosFault, nameof(chaosFault)); - - using var scope = _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics.CreateScope("CosmosDBChaosFaultResourceCollection.Exists"); - scope.Start(); - try - { - var response = await _cosmosDBChaosFaultResourceChaosFaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, chaosFault, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the ChaosFault. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string chaosFault, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(chaosFault, nameof(chaosFault)); - - using var scope = _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics.CreateScope("CosmosDBChaosFaultResourceCollection.Exists"); - scope.Start(); - try - { - var response = _cosmosDBChaosFaultResourceChaosFaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, chaosFault, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the ChaosFault. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string chaosFault, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(chaosFault, nameof(chaosFault)); - - using var scope = _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics.CreateScope("CosmosDBChaosFaultResourceCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _cosmosDBChaosFaultResourceChaosFaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, chaosFault, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBChaosFaultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault} - /// - /// - /// Operation Id - /// ChaosFault_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the ChaosFault. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string chaosFault, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(chaosFault, nameof(chaosFault)); - - using var scope = _cosmosDBChaosFaultResourceChaosFaultClientDiagnostics.CreateScope("CosmosDBChaosFaultResourceCollection.GetIfExists"); - scope.Start(); - try - { - var response = _cosmosDBChaosFaultResourceChaosFaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, chaosFault, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBChaosFaultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceData.Serialization.cs deleted file mode 100644 index 976b626f4d53..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceData.Serialization.cs +++ /dev/null @@ -1,399 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBChaosFaultResourceData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBChaosFaultResourceData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(CosmosDBChaosFaultSupportedActions)) - { - writer.WritePropertyName("action"u8); - writer.WriteStringValue(CosmosDBChaosFaultSupportedActions.Value.ToSerialString()); - } - if (Optional.IsDefined(Region)) - { - writer.WritePropertyName("region"u8); - writer.WriteStringValue(Region); - } - if (Optional.IsDefined(DatabaseName)) - { - writer.WritePropertyName("databaseName"u8); - writer.WriteStringValue(DatabaseName); - } - if (Optional.IsDefined(ContainerName)) - { - writer.WritePropertyName("containerName"u8); - writer.WriteStringValue(ContainerName); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - writer.WriteEndObject(); - } - - CosmosDBChaosFaultResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBChaosFaultResourceData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBChaosFaultResourceData(document.RootElement, options); - } - - internal static CosmosDBChaosFaultResourceData DeserializeCosmosDBChaosFaultResourceData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CosmosDBChaosFaultSupportedAction? action = default; - string region = default; - string databaseName = default; - string containerName = default; - string provisioningState = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("action"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - action = property0.Value.GetString().ToCosmosDBChaosFaultSupportedAction(); - continue; - } - if (property0.NameEquals("region"u8)) - { - region = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("databaseName"u8)) - { - databaseName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("containerName"u8)) - { - containerName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - provisioningState = property0.Value.GetString(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBChaosFaultResourceData( - id, - name, - type, - systemData, - action, - region, - databaseName, - containerName, - provisioningState, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CosmosDBChaosFaultSupportedActions), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" action: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CosmosDBChaosFaultSupportedActions)) - { - builder.Append(" action: "); - builder.AppendLine($"'{CosmosDBChaosFaultSupportedActions.Value.ToSerialString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Region), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" region: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Region)) - { - builder.Append(" region: "); - if (Region.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Region}'''"); - } - else - { - builder.AppendLine($"'{Region}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" databaseName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DatabaseName)) - { - builder.Append(" databaseName: "); - if (DatabaseName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{DatabaseName}'''"); - } - else - { - builder.AppendLine($"'{DatabaseName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" containerName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ContainerName)) - { - builder.Append(" containerName: "); - if (ContainerName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ContainerName}'''"); - } - else - { - builder.AppendLine($"'{ContainerName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - if (ProvisioningState.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ProvisioningState}'''"); - } - else - { - builder.AppendLine($"'{ProvisioningState}'"); - } - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBChaosFaultResourceData)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBChaosFaultResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosDBChaosFaultResourceData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBChaosFaultResourceData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceData.cs deleted file mode 100644 index 033414efdc2e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceData.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the CosmosDBChaosFaultResource data model. - /// A request object to enable/disable the chaos fault - /// - public partial class CosmosDBChaosFaultResourceData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CosmosDBChaosFaultResourceData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Indicates whether what action to take for the Chaos Fault. - /// Region of the account where the Chaos Fault is to be enabled/disabled. - /// Database name. - /// Container name. - /// A provisioning state of the Chaos Fault. - /// Keeps track of any properties unknown to the library. - internal CosmosDBChaosFaultResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CosmosDBChaosFaultSupportedAction? cosmosDBChaosFaultSupportedActions, string region, string databaseName, string containerName, string provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - CosmosDBChaosFaultSupportedActions = cosmosDBChaosFaultSupportedActions; - Region = region; - DatabaseName = databaseName; - ContainerName = containerName; - ProvisioningState = provisioningState; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Indicates whether what action to take for the Chaos Fault. - [WirePath("properties.action")] - public CosmosDBChaosFaultSupportedAction? CosmosDBChaosFaultSupportedActions { get; set; } - /// Region of the account where the Chaos Fault is to be enabled/disabled. - [WirePath("properties.region")] - public string Region { get; set; } - /// Database name. - [WirePath("properties.databaseName")] - public string DatabaseName { get; set; } - /// Container name. - [WirePath("properties.containerName")] - public string ContainerName { get; set; } - /// A provisioning state of the Chaos Fault. - [WirePath("properties.provisioningState")] - public string ProvisioningState { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs index c5470f6fa38b..ec40f1e4a8ae 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -106,7 +106,7 @@ public virtual async Task> GetAsync(AzureLoca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -147,7 +147,7 @@ public virtual Response Get(AzureLocation location, Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -176,7 +176,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -205,7 +205,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -244,7 +244,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual Response Exists(AzureLocation location, CancellationToken c /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -324,7 +324,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs index 7a739802d1bb..596e58f5abbf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs @@ -107,7 +107,7 @@ public virtual RestorableCosmosDBAccountCollection GetRestorableCosmosDBAccounts /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -136,7 +136,7 @@ public virtual async Task> GetRestor /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -165,7 +165,7 @@ public virtual Response GetRestorableCosmosDB /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -205,7 +205,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs index 0d597a913830..3e060862d956 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string pr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs index d85590992d29..2a9de98433b7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs index 87134520dfee..f0f07f6b57bf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs index 24f2f2f31e77..a8bcb92dfd20 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string groupName, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual async Task> ExistsAsync(string groupName, Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -298,7 +298,7 @@ public virtual Response Exists(string groupName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs index 220cef718c42..636aed6606b1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string ser /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string serviceName, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string serviceName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string serviceName, CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs index 998e15d2d9eb..49eb6685dcf0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs index 47203e58cf51..911db8b16df3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string clien /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string clientEncryptionKey /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string clientEncryptionKeyName, Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs index 14bd6b328520..e097e88d9c8a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs index 8fc95a0360d9..88cae54956f7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUp /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string containerName, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string containerName, Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string containerName, CancellationToken can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs index de8ef36f55e2..bf20a84b1261 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -80,7 +74,6 @@ internal static CosmosDBSqlContainerData DeserializeCosmosDBSqlContainerData(Jso { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -93,16 +86,6 @@ internal static CosmosDBSqlContainerData DeserializeCosmosDBSqlContainerData(Jso Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -191,7 +174,6 @@ internal static CosmosDBSqlContainerData DeserializeCosmosDBSqlContainerData(Jso location, resource, options0, - identity, serializedAdditionalRawData); } @@ -278,21 +260,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.cs index 25491f81dcb4..e10bf6bc3d9f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.cs @@ -66,13 +66,11 @@ public CosmosDBSqlContainerData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlContainerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlContainerResourceInfo resource, CosmosDBSqlContainerPropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlContainerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlContainerResourceInfo resource, CosmosDBSqlContainerPropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CosmosDBSqlContainerData() /// Gets or sets the options. [WirePath("properties.options")] public CosmosDBSqlContainerPropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs index 7440bad38844..bd7bb65b4b7f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs @@ -118,7 +118,7 @@ public virtual CosmosDBSqlStoredProcedureCollection GetCosmosDBSqlStoredProcedur /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -149,7 +149,7 @@ public virtual async Task> GetCosmo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -187,7 +187,7 @@ public virtual CosmosDBSqlUserDefinedFunctionCollection GetCosmosDBSqlUserDefine /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual CosmosDBSqlTriggerCollection GetCosmosDBSqlTriggers() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual async Task> GetCosmosDBSqlTr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Response GetCosmosDBSqlTrigger(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -440,7 +440,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -482,7 +482,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -528,7 +528,7 @@ public virtual async Task> UpdateAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -561,98 +561,6 @@ public virtual ArmOperation Update(WaitUntil waitU } } - /// - /// Merges the partitions of a SQL Container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge - /// - /// - /// Operation Id - /// SqlResources_ListSqlContainerPartitionMerge - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> GetSqlContainerPartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _cosmosDBSqlContainerSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerResource.GetSqlContainerPartitionMerge"); - scope.Start(); - try - { - var response = await _cosmosDBSqlContainerSqlResourcesRestClient.ListSqlContainerPartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlContainerSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerSqlResourcesRestClient.CreateListSqlContainerPartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Merges the partitions of a SQL Container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge - /// - /// - /// Operation Id - /// SqlResources_ListSqlContainerPartitionMerge - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation GetSqlContainerPartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _cosmosDBSqlContainerSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerResource.GetSqlContainerPartitionMerge"); - scope.Start(); - try - { - var response = _cosmosDBSqlContainerSqlResourcesRestClient.ListSqlContainerPartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlContainerSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerSqlResourcesRestClient.CreateListSqlContainerPartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Retrieves continuous backup information for a container resource. /// @@ -666,7 +574,7 @@ public virtual ArmOperation GetSqlContai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -712,7 +620,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -758,7 +666,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -820,7 +728,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -882,7 +790,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -939,7 +847,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -996,7 +904,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1056,7 +964,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs index 1d2ea77ab6ed..41463147a30d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation Creat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Migra /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -431,190 +431,6 @@ public virtual ArmOperation Migra } } - /// - /// Retrieve throughput distribution for an Azure Cosmos DB SQL container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// SqlResources_SqlContainerRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current SQL container. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlContainerRetrieveThroughputDistributionAsync(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerThroughputSettingResource.SqlContainerRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = await _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.SqlContainerRetrieveThroughputDistributionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.CreateSqlContainerRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieve throughput distribution for an Azure Cosmos DB SQL container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// SqlResources_SqlContainerRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current SQL container. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlContainerRetrieveThroughputDistribution(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerThroughputSettingResource.SqlContainerRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.SqlContainerRetrieveThroughputDistribution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.CreateSqlContainerRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB SQL container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// SqlResources_SqlContainerRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current SQL container. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlContainerRedistributeThroughputAsync(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerThroughputSettingResource.SqlContainerRedistributeThroughput"); - scope.Start(); - try - { - var response = await _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.SqlContainerRedistributeThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.CreateSqlContainerRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB SQL container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// SqlResources_SqlContainerRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current SQL container. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlContainerRedistributeThroughput(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerThroughputSettingResource.SqlContainerRedistributeThroughput"); - scope.Start(); - try - { - var response = _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.SqlContainerRedistributeThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.CreateSqlContainerRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -628,7 +444,7 @@ public virtual ArmOperation SqlContainerR /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -690,7 +506,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -752,7 +568,7 @@ public virtual Response AddTag(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -809,7 +625,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -866,7 +682,7 @@ public virtual Response SetTags(I /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -926,7 +742,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs index fcb3d2b5f4e3..b159e5195772 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs index a939fd7098b2..97993dbd8d4f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -80,7 +74,6 @@ internal static CosmosDBSqlDatabaseData DeserializeCosmosDBSqlDatabaseData(JsonE { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -93,16 +86,6 @@ internal static CosmosDBSqlDatabaseData DeserializeCosmosDBSqlDatabaseData(JsonE Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -191,7 +174,6 @@ internal static CosmosDBSqlDatabaseData DeserializeCosmosDBSqlDatabaseData(JsonE location, resource, options0, - identity, serializedAdditionalRawData); } @@ -278,21 +260,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.cs index b4475cc9243d..ba0ffb8b0c4c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.cs @@ -66,13 +66,11 @@ public CosmosDBSqlDatabaseData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlDatabaseResourceInfo resource, CosmosDBSqlDatabasePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlDatabaseResourceInfo resource, CosmosDBSqlDatabasePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CosmosDBSqlDatabaseData() /// Gets or sets the options. [WirePath("properties.options")] public CosmosDBSqlDatabasePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs index 5a6467888e47..fd52488390d6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs @@ -97,142 +97,142 @@ public virtual CosmosDBSqlDatabaseThroughputSettingResource GetCosmosDBSqlDataba return new CosmosDBSqlDatabaseThroughputSettingResource(Client, Id.AppendChildResource("throughputSettings", "default")); } - /// Gets a collection of CosmosDBSqlClientEncryptionKeyResources in the CosmosDBSqlDatabase. - /// An object representing collection of CosmosDBSqlClientEncryptionKeyResources and their operations over a CosmosDBSqlClientEncryptionKeyResource. - public virtual CosmosDBSqlClientEncryptionKeyCollection GetCosmosDBSqlClientEncryptionKeys() + /// Gets a collection of CosmosDBSqlContainerResources in the CosmosDBSqlDatabase. + /// An object representing collection of CosmosDBSqlContainerResources and their operations over a CosmosDBSqlContainerResource. + public virtual CosmosDBSqlContainerCollection GetCosmosDBSqlContainers() { - return GetCachedClient(client => new CosmosDBSqlClientEncryptionKeyCollection(client, Id)); + return GetCachedClient(client => new CosmosDBSqlContainerCollection(client, Id)); } /// - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + /// Gets the SQL container under an existing Azure Cosmos DB database account. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName} /// /// /// Operation Id - /// SqlResources_GetClientEncryptionKey + /// SqlResources_GetSqlContainer /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource - /// + /// /// /// /// - /// Cosmos DB ClientEncryptionKey name. + /// Cosmos DB container name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetCosmosDBSqlClientEncryptionKeyAsync(string clientEncryptionKeyName, CancellationToken cancellationToken = default) + public virtual async Task> GetCosmosDBSqlContainerAsync(string containerName, CancellationToken cancellationToken = default) { - return await GetCosmosDBSqlClientEncryptionKeys().GetAsync(clientEncryptionKeyName, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBSqlContainers().GetAsync(containerName, cancellationToken).ConfigureAwait(false); } /// - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + /// Gets the SQL container under an existing Azure Cosmos DB database account. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName} /// /// /// Operation Id - /// SqlResources_GetClientEncryptionKey + /// SqlResources_GetSqlContainer /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource - /// + /// /// /// /// - /// Cosmos DB ClientEncryptionKey name. + /// Cosmos DB container name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetCosmosDBSqlClientEncryptionKey(string clientEncryptionKeyName, CancellationToken cancellationToken = default) + public virtual Response GetCosmosDBSqlContainer(string containerName, CancellationToken cancellationToken = default) { - return GetCosmosDBSqlClientEncryptionKeys().Get(clientEncryptionKeyName, cancellationToken); + return GetCosmosDBSqlContainers().Get(containerName, cancellationToken); } - /// Gets a collection of CosmosDBSqlContainerResources in the CosmosDBSqlDatabase. - /// An object representing collection of CosmosDBSqlContainerResources and their operations over a CosmosDBSqlContainerResource. - public virtual CosmosDBSqlContainerCollection GetCosmosDBSqlContainers() + /// Gets a collection of CosmosDBSqlClientEncryptionKeyResources in the CosmosDBSqlDatabase. + /// An object representing collection of CosmosDBSqlClientEncryptionKeyResources and their operations over a CosmosDBSqlClientEncryptionKeyResource. + public virtual CosmosDBSqlClientEncryptionKeyCollection GetCosmosDBSqlClientEncryptionKeys() { - return GetCachedClient(client => new CosmosDBSqlContainerCollection(client, Id)); + return GetCachedClient(client => new CosmosDBSqlClientEncryptionKeyCollection(client, Id)); } /// - /// Gets the SQL container under an existing Azure Cosmos DB database account. + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName} /// /// /// Operation Id - /// SqlResources_GetSqlContainer + /// SqlResources_GetClientEncryptionKey /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource - /// + /// /// /// /// - /// Cosmos DB container name. + /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetCosmosDBSqlContainerAsync(string containerName, CancellationToken cancellationToken = default) + public virtual async Task> GetCosmosDBSqlClientEncryptionKeyAsync(string clientEncryptionKeyName, CancellationToken cancellationToken = default) { - return await GetCosmosDBSqlContainers().GetAsync(containerName, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBSqlClientEncryptionKeys().GetAsync(clientEncryptionKeyName, cancellationToken).ConfigureAwait(false); } /// - /// Gets the SQL container under an existing Azure Cosmos DB database account. + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName} /// /// /// Operation Id - /// SqlResources_GetSqlContainer + /// SqlResources_GetClientEncryptionKey /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource - /// + /// /// /// /// - /// Cosmos DB container name. + /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetCosmosDBSqlContainer(string containerName, CancellationToken cancellationToken = default) + public virtual Response GetCosmosDBSqlClientEncryptionKey(string clientEncryptionKeyName, CancellationToken cancellationToken = default) { - return GetCosmosDBSqlContainers().Get(containerName, cancellationToken); + return GetCosmosDBSqlClientEncryptionKeys().Get(clientEncryptionKeyName, cancellationToken); } /// @@ -248,7 +248,7 @@ public virtual Response GetCosmosDBSqlContainer(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -288,7 +288,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -328,7 +328,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -370,7 +370,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -412,7 +412,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -491,98 +491,6 @@ public virtual ArmOperation Update(WaitUntil waitUn } } - /// - /// Merges the partitions of a SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge - /// - /// - /// Operation Id - /// SqlResources_SqlDatabasePartitionMerge - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlDatabasePartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseResource.SqlDatabasePartitionMerge"); - scope.Start(); - try - { - var response = await _cosmosDBSqlDatabaseSqlResourcesRestClient.SqlDatabasePartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseSqlResourcesRestClient.CreateSqlDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Merges the partitions of a SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge - /// - /// - /// Operation Id - /// SqlResources_SqlDatabasePartitionMerge - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlDatabasePartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseResource.SqlDatabasePartitionMerge"); - scope.Start(); - try - { - var response = _cosmosDBSqlDatabaseSqlResourcesRestClient.SqlDatabasePartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseSqlResourcesRestClient.CreateSqlDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -596,7 +504,7 @@ public virtual ArmOperation SqlDatabaseP /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -658,7 +566,7 @@ public virtual async Task> AddTagAsync(str /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -720,7 +628,7 @@ public virtual Response AddTag(string key, string v /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -777,7 +685,7 @@ public virtual async Task> SetTagsAsync(ID /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -834,7 +742,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -894,7 +802,7 @@ public virtual async Task> RemoveTagAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs index 2d6d4022fe4d..ce6b024eea32 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Create /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Migrat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -430,190 +430,6 @@ public virtual ArmOperation Migrat } } - /// - /// Retrieve throughput distribution for an Azure Cosmos DB SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// SqlResources_SqlDatabaseRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current SQL database. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlDatabaseRetrieveThroughputDistributionAsync(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseThroughputSettingResource.SqlDatabaseRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = await _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.SqlDatabaseRetrieveThroughputDistributionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.CreateSqlDatabaseRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieve throughput distribution for an Azure Cosmos DB SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// SqlResources_SqlDatabaseRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current SQL database. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlDatabaseRetrieveThroughputDistribution(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseThroughputSettingResource.SqlDatabaseRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.SqlDatabaseRetrieveThroughputDistribution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.CreateSqlDatabaseRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// SqlResources_SqlDatabaseRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current SQL database. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlDatabaseRedistributeThroughputAsync(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseThroughputSettingResource.SqlDatabaseRedistributeThroughput"); - scope.Start(); - try - { - var response = await _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.SqlDatabaseRedistributeThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.CreateSqlDatabaseRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// SqlResources_SqlDatabaseRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current SQL database. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlDatabaseRedistributeThroughput(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseThroughputSettingResource.SqlDatabaseRedistributeThroughput"); - scope.Start(); - try - { - var response = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.SqlDatabaseRedistributeThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.CreateSqlDatabaseRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -627,7 +443,7 @@ public virtual ArmOperation SqlDatabaseRe /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -689,7 +505,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -751,7 +567,7 @@ public virtual Response AddTag(str /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -808,7 +624,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -865,7 +681,7 @@ public virtual Response SetTags(ID /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -925,7 +741,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs index 5f0e557b23c4..201ee489933d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string roleAssign /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string roleAssignmentId, C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string roleAssignmentId, CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs index faad885d0a57..900675fd416b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs index c11de872ca63..63d3b93e3a7c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string roleDefini /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string roleDefinitionId, C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string roleDefinitionId, CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs index b8af8f9ff8f4..d3cda04e14aa 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs index 23d785d37b27..95a2b60b5dcd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string storedPro /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string storedProcedureName /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string storedProcedureName, CancellationTok /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs index 77c7c0b16c2e..083d4ab62f06 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -75,7 +69,6 @@ internal static CosmosDBSqlStoredProcedureData DeserializeCosmosDBSqlStoredProce { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -87,16 +80,6 @@ internal static CosmosDBSqlStoredProcedureData DeserializeCosmosDBSqlStoredProce Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -175,7 +158,6 @@ internal static CosmosDBSqlStoredProcedureData DeserializeCosmosDBSqlStoredProce tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -262,21 +244,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.cs index c9914ab0c153..d62143b2a1ea 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.cs @@ -65,12 +65,10 @@ public CosmosDBSqlStoredProcedureData(AzureLocation location) : base(location) /// The tags. /// The location. /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlStoredProcedureData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlStoredProcedureResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlStoredProcedureData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlStoredProcedureResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,8 +80,5 @@ internal CosmosDBSqlStoredProcedureData() /// Gets or sets the resource. [WirePath("properties.resource")] public ExtendedCosmosDBSqlStoredProcedureResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs index 83b15644508d..61ef5fd05349 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, s /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary< /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs index a9ffe73aa77a..9fdb13eb22ce 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string triggerName, Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string triggerName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string triggerName, CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs index bc580b9e565d..f7290d9f06f7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -75,7 +69,6 @@ internal static CosmosDBSqlTriggerData DeserializeCosmosDBSqlTriggerData(JsonEle { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -87,16 +80,6 @@ internal static CosmosDBSqlTriggerData DeserializeCosmosDBSqlTriggerData(JsonEle Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -175,7 +158,6 @@ internal static CosmosDBSqlTriggerData DeserializeCosmosDBSqlTriggerData(JsonEle tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -262,21 +244,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.cs index 8b79d3227fcd..79829f99bd3d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.cs @@ -65,12 +65,10 @@ public CosmosDBSqlTriggerData(AzureLocation location) : base(location) /// The tags. /// The location. /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlTriggerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlTriggerResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlTriggerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlTriggerResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,8 +80,5 @@ internal CosmosDBSqlTriggerData() /// Gets or sets the resource. [WirePath("properties.resource")] public ExtendedCosmosDBSqlTriggerResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs index 680f8c9bfd7d..5f62ecc180bc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, string va /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs index 44fd5a8e5e01..a94a5dec854c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string userD /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string userDefinedFunction /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string userDefinedFunctionName, Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs index a3aabb19fda0..4bc13d845e3c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -75,7 +69,6 @@ internal static CosmosDBSqlUserDefinedFunctionData DeserializeCosmosDBSqlUserDef { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -87,16 +80,6 @@ internal static CosmosDBSqlUserDefinedFunctionData DeserializeCosmosDBSqlUserDef Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -175,7 +158,6 @@ internal static CosmosDBSqlUserDefinedFunctionData DeserializeCosmosDBSqlUserDef tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -262,21 +244,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.cs index 91c5bba499a2..4f863d7e6e67 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.cs @@ -65,12 +65,10 @@ public CosmosDBSqlUserDefinedFunctionData(AzureLocation location) : base(locatio /// The tags. /// The location. /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlUserDefinedFunctionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlUserDefinedFunctionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,8 +80,5 @@ internal CosmosDBSqlUserDefinedFunctionData() /// Gets or sets the resource. [WirePath("properties.resource")] public ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs index 28453c58f7ba..d5ad1484476e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs index d7da39faacfd..d5742bd402ac 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string table /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string tableName, Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToke /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string tableName, Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string tableName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs index 81dae17822ad..d48055229beb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -80,7 +74,6 @@ internal static CosmosDBTableData DeserializeCosmosDBTableData(JsonElement eleme { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -93,16 +86,6 @@ internal static CosmosDBTableData DeserializeCosmosDBTableData(JsonElement eleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -191,7 +174,6 @@ internal static CosmosDBTableData DeserializeCosmosDBTableData(JsonElement eleme location, resource, options0, - identity, serializedAdditionalRawData); } @@ -278,21 +260,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.cs index baf0259d5f46..4f7efaaf2389 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.cs @@ -66,13 +66,11 @@ public CosmosDBTableData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBTableData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBTablePropertiesResource resource, CosmosDBTablePropertiesOptions options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBTableData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBTablePropertiesResource resource, CosmosDBTablePropertiesOptions options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CosmosDBTableData() /// Gets or sets the options. [WirePath("properties.options")] public CosmosDBTablePropertiesOptions Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs index 4cc46fc01292..e3d1c85f515c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs @@ -110,7 +110,7 @@ public virtual CosmosTableThroughputSettingResource GetCosmosTableThroughputSett /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -150,7 +150,7 @@ public virtual async Task> GetAsync(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -190,7 +190,7 @@ public virtual Response Get(CancellationToken cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -232,7 +232,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -274,7 +274,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -320,7 +320,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -366,7 +366,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -412,7 +412,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -520,7 +520,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -582,7 +582,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -639,7 +639,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -696,7 +696,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -756,7 +756,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentCollection.cs deleted file mode 100644 index 77cb74248b2d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentCollection.cs +++ /dev/null @@ -1,491 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCosmosDBTableRoleAssignments method from an instance of . - /// - public partial class CosmosDBTableRoleAssignmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics; - private readonly TableResourcesRestOperations _cosmosDBTableRoleAssignmentTableResourcesRestClient; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBTableRoleAssignmentCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CosmosDBTableRoleAssignmentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBTableRoleAssignmentResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBTableRoleAssignmentResource.ResourceType, out string cosmosDBTableRoleAssignmentTableResourcesApiVersion); - _cosmosDBTableRoleAssignmentTableResourcesRestClient = new TableResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBTableRoleAssignmentTableResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates an Azure Cosmos DB Table Role Assignment. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_CreateUpdateTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The GUID for the Role Assignment. - /// The properties required to create or update a Role Assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string roleAssignmentId, CosmosDBTableRoleAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateUpdateTableRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBTableRoleAssignmentOperationSource(Client), _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateCreateUpdateTableRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB Table Role Assignment. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_CreateUpdateTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The GUID for the Role Assignment. - /// The properties required to create or update a Role Assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string roleAssignmentId, CosmosDBTableRoleAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateUpdateTableRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBTableRoleAssignmentOperationSource(Client), _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateCreateUpdateTableRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string roleAssignmentId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentCollection.Get"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleAssignmentTableResourcesRestClient.GetTableRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBTableRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string roleAssignmentId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentCollection.Get"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleAssignmentTableResourcesRestClient.GetTableRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBTableRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments - /// - /// - /// Operation Id - /// TableResources_ListTableRoleAssignments - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateListTableRoleAssignmentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CosmosDBTableRoleAssignmentResource(Client, CosmosDBTableRoleAssignmentData.DeserializeCosmosDBTableRoleAssignmentData(e)), _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics, Pipeline, "CosmosDBTableRoleAssignmentCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments - /// - /// - /// Operation Id - /// TableResources_ListTableRoleAssignments - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateListTableRoleAssignmentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CosmosDBTableRoleAssignmentResource(Client, CosmosDBTableRoleAssignmentData.DeserializeCosmosDBTableRoleAssignmentData(e)), _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics, Pipeline, "CosmosDBTableRoleAssignmentCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string roleAssignmentId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentCollection.Exists"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleAssignmentTableResourcesRestClient.GetTableRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string roleAssignmentId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentCollection.Exists"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleAssignmentTableResourcesRestClient.GetTableRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string roleAssignmentId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleAssignmentTableResourcesRestClient.GetTableRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBTableRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string roleAssignmentId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentCollection.GetIfExists"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleAssignmentTableResourcesRestClient.GetTableRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBTableRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentData.Serialization.cs deleted file mode 100644 index b6197edac21b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentData.Serialization.cs +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBTableRoleAssignmentData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBTableRoleAssignmentData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(RoleDefinitionId)) - { - writer.WritePropertyName("roleDefinitionId"u8); - writer.WriteStringValue(RoleDefinitionId); - } - if (Optional.IsDefined(Scope)) - { - writer.WritePropertyName("scope"u8); - writer.WriteStringValue(Scope); - } - if (Optional.IsDefined(PrincipalId)) - { - writer.WritePropertyName("principalId"u8); - writer.WriteStringValue(PrincipalId.Value); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - writer.WriteEndObject(); - } - - CosmosDBTableRoleAssignmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBTableRoleAssignmentData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBTableRoleAssignmentData(document.RootElement, options); - } - - internal static CosmosDBTableRoleAssignmentData DeserializeCosmosDBTableRoleAssignmentData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - ResourceIdentifier roleDefinitionId = default; - ResourceIdentifier scope = default; - Guid? principalId = default; - string provisioningState = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("roleDefinitionId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - roleDefinitionId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("scope"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scope = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("principalId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - principalId = property0.Value.GetGuid(); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - provisioningState = property0.Value.GetString(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBTableRoleAssignmentData( - id, - name, - type, - systemData, - roleDefinitionId, - scope, - principalId, - provisioningState, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RoleDefinitionId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" roleDefinitionId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RoleDefinitionId)) - { - builder.Append(" roleDefinitionId: "); - builder.AppendLine($"'{RoleDefinitionId.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Scope), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" scope: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Scope)) - { - builder.Append(" scope: "); - builder.AppendLine($"'{Scope.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrincipalId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" principalId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(PrincipalId)) - { - builder.Append(" principalId: "); - builder.AppendLine($"'{PrincipalId.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - if (ProvisioningState.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ProvisioningState}'''"); - } - else - { - builder.AppendLine($"'{ProvisioningState}'"); - } - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBTableRoleAssignmentData)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBTableRoleAssignmentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosDBTableRoleAssignmentData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBTableRoleAssignmentData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentData.cs deleted file mode 100644 index 6604ad372480..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentData.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the CosmosDBTableRoleAssignment data model. - /// Parameters to create and update an Azure Cosmos DB Table Role Assignment. - /// - public partial class CosmosDBTableRoleAssignmentData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CosmosDBTableRoleAssignmentData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The unique identifier for the associated Role Definition. - /// The data plane resource path for which access is being granted through this Table Role Assignment. - /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Table Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. - /// Provisioning state of the resource. - /// Keeps track of any properties unknown to the library. - internal CosmosDBTableRoleAssignmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier roleDefinitionId, ResourceIdentifier scope, Guid? principalId, string provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - RoleDefinitionId = roleDefinitionId; - Scope = scope; - PrincipalId = principalId; - ProvisioningState = provisioningState; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The unique identifier for the associated Role Definition. - [WirePath("properties.roleDefinitionId")] - public ResourceIdentifier RoleDefinitionId { get; set; } - /// The data plane resource path for which access is being granted through this Table Role Assignment. - [WirePath("properties.scope")] - public ResourceIdentifier Scope { get; set; } - /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Table Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. - [WirePath("properties.principalId")] - public Guid? PrincipalId { get; set; } - /// Provisioning state of the resource. - [WirePath("properties.provisioningState")] - public string ProvisioningState { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.Serialization.cs deleted file mode 100644 index 697ce6b56e0b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBTableRoleAssignmentResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - CosmosDBTableRoleAssignmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - CosmosDBTableRoleAssignmentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs deleted file mode 100644 index 94984c40b218..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CosmosDBTableRoleAssignment along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCosmosDBTableRoleAssignmentResource method. - /// Otherwise you can get one from its parent resource using the GetCosmosDBTableRoleAssignment method. - /// - public partial class CosmosDBTableRoleAssignmentResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The roleAssignmentId. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics; - private readonly TableResourcesRestOperations _cosmosDBTableRoleAssignmentTableResourcesRestClient; - private readonly CosmosDBTableRoleAssignmentData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/tableRoleAssignments"; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBTableRoleAssignmentResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CosmosDBTableRoleAssignmentResource(ArmClient client, CosmosDBTableRoleAssignmentData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CosmosDBTableRoleAssignmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cosmosDBTableRoleAssignmentTableResourcesApiVersion); - _cosmosDBTableRoleAssignmentTableResourcesRestClient = new TableResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBTableRoleAssignmentTableResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CosmosDBTableRoleAssignmentData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentResource.Get"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleAssignmentTableResourcesRestClient.GetTableRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBTableRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentResource.Get"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleAssignmentTableResourcesRestClient.GetTableRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBTableRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Table Role Assignment. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_DeleteTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentResource.Delete"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleAssignmentTableResourcesRestClient.DeleteTableRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateDeleteTableRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Table Role Assignment. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_DeleteTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentResource.Delete"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleAssignmentTableResourcesRestClient.DeleteTableRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateDeleteTableRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB Table Role Assignment. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_CreateUpdateTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The properties required to create or update a Role Assignment. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CosmosDBTableRoleAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentResource.Update"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateUpdateTableRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBTableRoleAssignmentOperationSource(Client), _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateCreateUpdateTableRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB Table Role Assignment. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId} - /// - /// - /// Operation Id - /// TableResources_CreateUpdateTableRoleAssignment - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The properties required to create or update a Role Assignment. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CosmosDBTableRoleAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleAssignmentResource.Update"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateUpdateTableRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBTableRoleAssignmentOperationSource(Client), _cosmosDBTableRoleAssignmentTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleAssignmentTableResourcesRestClient.CreateCreateUpdateTableRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionCollection.cs deleted file mode 100644 index 2117a5172fde..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionCollection.cs +++ /dev/null @@ -1,491 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCosmosDBTableRoleDefinitions method from an instance of . - /// - public partial class CosmosDBTableRoleDefinitionCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics; - private readonly TableResourcesRestOperations _cosmosDBTableRoleDefinitionTableResourcesRestClient; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBTableRoleDefinitionCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CosmosDBTableRoleDefinitionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBTableRoleDefinitionResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBTableRoleDefinitionResource.ResourceType, out string cosmosDBTableRoleDefinitionTableResourcesApiVersion); - _cosmosDBTableRoleDefinitionTableResourcesRestClient = new TableResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBTableRoleDefinitionTableResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_CreateUpdateTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The GUID for the Role Definition. - /// The properties required to create or update a Role Definition. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string roleDefinitionId, CosmosDBTableRoleDefinitionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleDefinitionTableResourcesRestClient.CreateUpdateTableRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBTableRoleDefinitionOperationSource(Client), _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleDefinitionTableResourcesRestClient.CreateCreateUpdateTableRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_CreateUpdateTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The GUID for the Role Definition. - /// The properties required to create or update a Role Definition. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string roleDefinitionId, CosmosDBTableRoleDefinitionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleDefinitionTableResourcesRestClient.CreateUpdateTableRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBTableRoleDefinitionOperationSource(Client), _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleDefinitionTableResourcesRestClient.CreateCreateUpdateTableRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Definition. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string roleDefinitionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionCollection.Get"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleDefinitionTableResourcesRestClient.GetTableRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBTableRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Definition. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string roleDefinitionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionCollection.Get"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleDefinitionTableResourcesRestClient.GetTableRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBTableRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions - /// - /// - /// Operation Id - /// TableResources_ListTableRoleDefinitions - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBTableRoleDefinitionTableResourcesRestClient.CreateListTableRoleDefinitionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CosmosDBTableRoleDefinitionResource(Client, CosmosDBTableRoleDefinitionData.DeserializeCosmosDBTableRoleDefinitionData(e)), _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics, Pipeline, "CosmosDBTableRoleDefinitionCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions - /// - /// - /// Operation Id - /// TableResources_ListTableRoleDefinitions - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBTableRoleDefinitionTableResourcesRestClient.CreateListTableRoleDefinitionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CosmosDBTableRoleDefinitionResource(Client, CosmosDBTableRoleDefinitionData.DeserializeCosmosDBTableRoleDefinitionData(e)), _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics, Pipeline, "CosmosDBTableRoleDefinitionCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Definition. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string roleDefinitionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionCollection.Exists"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleDefinitionTableResourcesRestClient.GetTableRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Definition. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string roleDefinitionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionCollection.Exists"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleDefinitionTableResourcesRestClient.GetTableRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Definition. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string roleDefinitionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleDefinitionTableResourcesRestClient.GetTableRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBTableRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The GUID for the Role Definition. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string roleDefinitionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionCollection.GetIfExists"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleDefinitionTableResourcesRestClient.GetTableRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBTableRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionData.Serialization.cs deleted file mode 100644 index e8269acf2947..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionData.Serialization.cs +++ /dev/null @@ -1,441 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBTableRoleDefinitionData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBTableRoleDefinitionData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(PathId)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(PathId); - } - if (Optional.IsDefined(RoleName)) - { - writer.WritePropertyName("roleName"u8); - writer.WriteStringValue(RoleName); - } - if (Optional.IsDefined(RoleDefinitionType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(RoleDefinitionType.Value.ToSerialString()); - } - if (Optional.IsCollectionDefined(AssignableScopes)) - { - writer.WritePropertyName("assignableScopes"u8); - writer.WriteStartArray(); - foreach (var item in AssignableScopes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Permissions)) - { - writer.WritePropertyName("permissions"u8); - writer.WriteStartArray(); - foreach (var item in Permissions) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - CosmosDBTableRoleDefinitionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBTableRoleDefinitionData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBTableRoleDefinitionData(document.RootElement, options); - } - - internal static CosmosDBTableRoleDefinitionData DeserializeCosmosDBTableRoleDefinitionData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - string id0 = default; - string roleName = default; - CosmosDBSqlRoleDefinitionType? type0 = default; - IList assignableScopes = default; - IList permissions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("id"u8)) - { - id0 = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("roleName"u8)) - { - roleName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("type"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type0 = property0.Value.GetString().ToCosmosDBSqlRoleDefinitionType(); - continue; - } - if (property0.NameEquals("assignableScopes"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - assignableScopes = array; - continue; - } - if (property0.NameEquals("permissions"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(CosmosDBTableRolePermission.DeserializeCosmosDBTableRolePermission(item, options)); - } - permissions = array; - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBTableRoleDefinitionData( - id, - name, - type, - systemData, - id0, - roleName, - type0, - assignableScopes ?? new ChangeTrackingList(), - permissions ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PathId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(PathId)) - { - builder.Append(" id: "); - if (PathId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{PathId}'''"); - } - else - { - builder.AppendLine($"'{PathId}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RoleName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" roleName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RoleName)) - { - builder.Append(" roleName: "); - if (RoleName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RoleName}'''"); - } - else - { - builder.AppendLine($"'{RoleName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RoleDefinitionType), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" type: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RoleDefinitionType)) - { - builder.Append(" type: "); - builder.AppendLine($"'{RoleDefinitionType.Value.ToSerialString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AssignableScopes), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" assignableScopes: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(AssignableScopes)) - { - if (AssignableScopes.Any()) - { - builder.Append(" assignableScopes: "); - builder.AppendLine("["); - foreach (var item in AssignableScopes) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Permissions), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" permissions: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Permissions)) - { - if (Permissions.Any()) - { - builder.Append(" permissions: "); - builder.AppendLine("["); - foreach (var item in Permissions) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " permissions: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBTableRoleDefinitionData)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBTableRoleDefinitionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosDBTableRoleDefinitionData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBTableRoleDefinitionData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionData.cs deleted file mode 100644 index 7431168ec748..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionData.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the CosmosDBTableRoleDefinition data model. - /// Parameters to create and update an Azure Cosmos DB Table Role Definition. - /// - public partial class CosmosDBTableRoleDefinitionData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CosmosDBTableRoleDefinitionData() - { - AssignableScopes = new ChangeTrackingList(); - Permissions = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The path id for the Role Definition. - /// A user-friendly name for the Role Definition. Must be unique for the database account. - /// Indicates whether the Role Definition was built-in or user created. - /// A set of fully qualified Scopes at or below which Table Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. - /// The set of operations allowed through this Role Definition. - /// Keeps track of any properties unknown to the library. - internal CosmosDBTableRoleDefinitionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string pathId, string roleName, CosmosDBSqlRoleDefinitionType? roleDefinitionType, IList assignableScopes, IList permissions, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - PathId = pathId; - RoleName = roleName; - RoleDefinitionType = roleDefinitionType; - AssignableScopes = assignableScopes; - Permissions = permissions; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The path id for the Role Definition. - [WirePath("properties.id")] - public string PathId { get; set; } - /// A user-friendly name for the Role Definition. Must be unique for the database account. - [WirePath("properties.roleName")] - public string RoleName { get; set; } - /// Indicates whether the Role Definition was built-in or user created. - [WirePath("properties.type")] - public CosmosDBSqlRoleDefinitionType? RoleDefinitionType { get; set; } - /// A set of fully qualified Scopes at or below which Table Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. - [WirePath("properties.assignableScopes")] - public IList AssignableScopes { get; } - /// The set of operations allowed through this Role Definition. - [WirePath("properties.permissions")] - public IList Permissions { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionResource.Serialization.cs deleted file mode 100644 index b967a9f327cb..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBTableRoleDefinitionResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - CosmosDBTableRoleDefinitionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - CosmosDBTableRoleDefinitionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionResource.cs deleted file mode 100644 index 51ed93561a6b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionResource.cs +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CosmosDBTableRoleDefinition along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCosmosDBTableRoleDefinitionResource method. - /// Otherwise you can get one from its parent resource using the GetCosmosDBTableRoleDefinition method. - /// - public partial class CosmosDBTableRoleDefinitionResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The roleDefinitionId. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics; - private readonly TableResourcesRestOperations _cosmosDBTableRoleDefinitionTableResourcesRestClient; - private readonly CosmosDBTableRoleDefinitionData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/tableRoleDefinitions"; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBTableRoleDefinitionResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CosmosDBTableRoleDefinitionResource(ArmClient client, CosmosDBTableRoleDefinitionData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CosmosDBTableRoleDefinitionResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cosmosDBTableRoleDefinitionTableResourcesApiVersion); - _cosmosDBTableRoleDefinitionTableResourcesRestClient = new TableResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBTableRoleDefinitionTableResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CosmosDBTableRoleDefinitionData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionResource.Get"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleDefinitionTableResourcesRestClient.GetTableRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBTableRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_GetTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionResource.Get"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleDefinitionTableResourcesRestClient.GetTableRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBTableRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Table Role Definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_DeleteTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionResource.Delete"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleDefinitionTableResourcesRestClient.DeleteTableRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleDefinitionTableResourcesRestClient.CreateDeleteTableRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Table Role Definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_DeleteTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionResource.Delete"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleDefinitionTableResourcesRestClient.DeleteTableRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleDefinitionTableResourcesRestClient.CreateDeleteTableRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_CreateUpdateTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The properties required to create or update a Role Definition. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CosmosDBTableRoleDefinitionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionResource.Update"); - scope.Start(); - try - { - var response = await _cosmosDBTableRoleDefinitionTableResourcesRestClient.CreateUpdateTableRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBTableRoleDefinitionOperationSource(Client), _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleDefinitionTableResourcesRestClient.CreateCreateUpdateTableRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId} - /// - /// - /// Operation Id - /// TableResources_CreateUpdateTableRoleDefinition - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The properties required to create or update a Role Definition. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CosmosDBTableRoleDefinitionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics.CreateScope("CosmosDBTableRoleDefinitionResource.Update"); - scope.Start(); - try - { - var response = _cosmosDBTableRoleDefinitionTableResourcesRestClient.CreateUpdateTableRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBTableRoleDefinitionOperationSource(Client), _cosmosDBTableRoleDefinitionTableResourcesClientDiagnostics, Pipeline, _cosmosDBTableRoleDefinitionTableResourcesRestClient.CreateCreateUpdateTableRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs deleted file mode 100644 index 36540aa2faac..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs +++ /dev/null @@ -1,498 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCosmosDBThroughputPoolAccounts method from an instance of . - /// - public partial class CosmosDBThroughputPoolAccountCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics; - private readonly ThroughputPoolAccountRestOperations _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient; - private readonly ClientDiagnostics _cosmosDBThroughputPoolAccountThroughputPoolAccountsClientDiagnostics; - private readonly ThroughputPoolAccountsRestOperations _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBThroughputPoolAccountCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CosmosDBThroughputPoolAccountCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolAccountResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBThroughputPoolAccountResource.ResourceType, out string cosmosDBThroughputPoolAccountThroughputPoolAccountApiVersion); - _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient = new ThroughputPoolAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolAccountThroughputPoolAccountApiVersion); - _cosmosDBThroughputPoolAccountThroughputPoolAccountsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolAccountResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBThroughputPoolAccountResource.ResourceType, out string cosmosDBThroughputPoolAccountThroughputPoolAccountsApiVersion); - _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient = new ThroughputPoolAccountsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolAccountThroughputPoolAccountsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBThroughputPoolResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBThroughputPoolResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Create - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB global database account in a Throughput Pool. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolAccountOperationSource(Client), _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Create - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB global database account in a Throughput Pool. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolAccountOperationSource(Client), _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.Get"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.Get"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts - /// - /// - /// Operation Id - /// ThroughputPoolAccounts_List - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolAccountResource(Client, CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(e)), _cosmosDBThroughputPoolAccountThroughputPoolAccountsClientDiagnostics, Pipeline, "CosmosDBThroughputPoolAccountCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts - /// - /// - /// Operation Id - /// ThroughputPoolAccounts_List - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolAccountResource(Client, CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(e)), _cosmosDBThroughputPoolAccountThroughputPoolAccountsClientDiagnostics, Pipeline, "CosmosDBThroughputPoolAccountCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.Exists"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.Exists"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.GetIfExists"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs deleted file mode 100644 index 8e522751a0a5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBThroughputPoolAccountData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsDefined(AccountResourceIdentifier)) - { - writer.WritePropertyName("accountResourceIdentifier"u8); - writer.WriteStringValue(AccountResourceIdentifier); - } - if (Optional.IsDefined(AccountLocation)) - { - writer.WritePropertyName("accountLocation"u8); - writer.WriteStringValue(AccountLocation.Value); - } - if (options.Format != "W" && Optional.IsDefined(AccountInstanceId)) - { - writer.WritePropertyName("accountInstanceId"u8); - writer.WriteStringValue(AccountInstanceId); - } - writer.WriteEndObject(); - } - - CosmosDBThroughputPoolAccountData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBThroughputPoolAccountData(document.RootElement, options); - } - - internal static CosmosDBThroughputPoolAccountData DeserializeCosmosDBThroughputPoolAccountData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CosmosDBStatus? provisioningState = default; - ResourceIdentifier accountResourceIdentifier = default; - AzureLocation? accountLocation = default; - string accountInstanceId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new CosmosDBStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accountResourceIdentifier"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accountResourceIdentifier = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accountLocation"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accountLocation = new AzureLocation(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accountInstanceId"u8)) - { - accountInstanceId = property0.Value.GetString(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBThroughputPoolAccountData( - id, - name, - type, - systemData, - provisioningState, - accountResourceIdentifier, - accountLocation, - accountInstanceId, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountResourceIdentifier), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accountResourceIdentifier: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccountResourceIdentifier)) - { - builder.Append(" accountResourceIdentifier: "); - builder.AppendLine($"'{AccountResourceIdentifier.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountLocation), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accountLocation: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccountLocation)) - { - builder.Append(" accountLocation: "); - builder.AppendLine($"'{AccountLocation.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountInstanceId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accountInstanceId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccountInstanceId)) - { - builder.Append(" accountInstanceId: "); - if (AccountInstanceId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{AccountInstanceId}'''"); - } - else - { - builder.AppendLine($"'{AccountInstanceId}'"); - } - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBThroughputPoolAccountData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosDBThroughputPoolAccountData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.cs deleted file mode 100644 index 717c462d1b87..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the CosmosDBThroughputPoolAccount data model. - /// An Azure Cosmos DB Throughputpool Account - /// - public partial class CosmosDBThroughputPoolAccountData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CosmosDBThroughputPoolAccountData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// A provisioning state of the ThroughputPool Account. - /// The resource identifier of global database account in the throughputPool. - /// The location of global database account in the throughputPool. - /// The instance id of global database account in the throughputPool. - /// Keeps track of any properties unknown to the library. - internal CosmosDBThroughputPoolAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CosmosDBStatus? provisioningState, ResourceIdentifier accountResourceIdentifier, AzureLocation? accountLocation, string accountInstanceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - ProvisioningState = provisioningState; - AccountResourceIdentifier = accountResourceIdentifier; - AccountLocation = accountLocation; - AccountInstanceId = accountInstanceId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// A provisioning state of the ThroughputPool Account. - [WirePath("properties.provisioningState")] - public CosmosDBStatus? ProvisioningState { get; set; } - /// The resource identifier of global database account in the throughputPool. - [WirePath("properties.accountResourceIdentifier")] - public ResourceIdentifier AccountResourceIdentifier { get; set; } - /// The location of global database account in the throughputPool. - [WirePath("properties.accountLocation")] - public AzureLocation? AccountLocation { get; set; } - /// The instance id of global database account in the throughputPool. - [WirePath("properties.accountInstanceId")] - public string AccountInstanceId { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.Serialization.cs deleted file mode 100644 index 3a9f4402b8f6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBThroughputPoolAccountResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - CosmosDBThroughputPoolAccountData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - CosmosDBThroughputPoolAccountData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs deleted file mode 100644 index b6c998474128..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CosmosDBThroughputPoolAccount along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCosmosDBThroughputPoolAccountResource method. - /// Otherwise you can get one from its parent resource using the GetCosmosDBThroughputPoolAccount method. - /// - public partial class CosmosDBThroughputPoolAccountResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The throughputPoolName. - /// The throughputPoolAccountName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics; - private readonly ThroughputPoolAccountRestOperations _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient; - private readonly CosmosDBThroughputPoolAccountData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/throughputPools/throughputPoolAccounts"; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBThroughputPoolAccountResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CosmosDBThroughputPoolAccountResource(ArmClient client, CosmosDBThroughputPoolAccountData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CosmosDBThroughputPoolAccountResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cosmosDBThroughputPoolAccountThroughputPoolAccountApiVersion); - _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient = new ThroughputPoolAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolAccountThroughputPoolAccountApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CosmosDBThroughputPoolAccountData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Get"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Get"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes an existing Azure Cosmos DB database account from a throughput pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Delete - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Delete"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes an existing Azure Cosmos DB database account from a throughput pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Delete - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Delete"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Create - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Update"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolAccountOperationSource(Client), _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Create - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Update"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolAccountOperationSource(Client), _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs deleted file mode 100644 index fff972d5cf3c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs +++ /dev/null @@ -1,499 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCosmosDBThroughputPools method from an instance of . - /// - public partial class CosmosDBThroughputPoolCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolClientDiagnostics; - private readonly ThroughputPoolRestOperations _cosmosDBThroughputPoolThroughputPoolRestClient; - private readonly ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics; - private readonly ThroughputPoolsRestOperations _cosmosDBThroughputPoolThroughputPoolsRestClient; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBThroughputPoolCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CosmosDBThroughputPoolCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBThroughputPoolThroughputPoolClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBThroughputPoolResource.ResourceType, out string cosmosDBThroughputPoolThroughputPoolApiVersion); - _cosmosDBThroughputPoolThroughputPoolRestClient = new ThroughputPoolRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolThroughputPoolApiVersion); - _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBThroughputPoolResource.ResourceType, out string cosmosDBThroughputPoolThroughputPoolsApiVersion); - _cosmosDBThroughputPoolThroughputPoolsRestClient = new ThroughputPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolThroughputPoolsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current ThroughputPool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string throughputPoolName, CosmosDBThroughputPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolOperationSource(Client), _cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current ThroughputPool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string throughputPoolName, CosmosDBThroughputPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolOperationSource(Client), _cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.Get"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.Get"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List all the ThroughputPools in a given resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBThroughputPoolThroughputPoolsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBThroughputPoolThroughputPoolsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "CosmosDBThroughputPoolCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List all the ThroughputPools in a given resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBThroughputPoolThroughputPoolsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBThroughputPoolThroughputPoolsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "CosmosDBThroughputPoolCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.Exists"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.Exists"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.GetIfExists"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs deleted file mode 100644 index 8f4bcce98f1e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs +++ /dev/null @@ -1,363 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBThroughputPoolData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsDefined(MaxThroughput)) - { - writer.WritePropertyName("maxThroughput"u8); - writer.WriteNumberValue(MaxThroughput.Value); - } - writer.WriteEndObject(); - } - - CosmosDBThroughputPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBThroughputPoolData(document.RootElement, options); - } - - internal static CosmosDBThroughputPoolData DeserializeCosmosDBThroughputPoolData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CosmosDBStatus? provisioningState = default; - int? maxThroughput = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new CosmosDBStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("maxThroughput"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxThroughput = property0.Value.GetInt32(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBThroughputPoolData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - provisioningState, - maxThroughput, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxThroughput), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" maxThroughput: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(MaxThroughput)) - { - builder.Append(" maxThroughput: "); - builder.AppendLine($"{MaxThroughput.Value}"); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBThroughputPoolData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosDBThroughputPoolData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.cs deleted file mode 100644 index c288a9624cc5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the CosmosDBThroughputPool data model. - /// An Azure Cosmos DB Throughputpool. - /// - public partial class CosmosDBThroughputPoolData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public CosmosDBThroughputPoolData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// A provisioning state of the ThroughputPool. - /// Value for throughput to be shared among CosmosDB resources in the pool. - /// Keeps track of any properties unknown to the library. - internal CosmosDBThroughputPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBStatus? provisioningState, int? maxThroughput, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - ProvisioningState = provisioningState; - MaxThroughput = maxThroughput; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CosmosDBThroughputPoolData() - { - } - - /// A provisioning state of the ThroughputPool. - [WirePath("properties.provisioningState")] - public CosmosDBStatus? ProvisioningState { get; set; } - /// Value for throughput to be shared among CosmosDB resources in the pool. - [WirePath("properties.maxThroughput")] - public int? MaxThroughput { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.Serialization.cs deleted file mode 100644 index e537ce88ec65..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBThroughputPoolResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - CosmosDBThroughputPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - CosmosDBThroughputPoolData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs deleted file mode 100644 index 45bdcb8be9a8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs +++ /dev/null @@ -1,417 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CosmosDBThroughputPool along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCosmosDBThroughputPoolResource method. - /// Otherwise you can get one from its parent resource using the GetCosmosDBThroughputPool method. - /// - public partial class CosmosDBThroughputPoolResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The throughputPoolName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolClientDiagnostics; - private readonly ThroughputPoolRestOperations _cosmosDBThroughputPoolThroughputPoolRestClient; - private readonly CosmosDBThroughputPoolData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/throughputPools"; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBThroughputPoolResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CosmosDBThroughputPoolResource(ArmClient client, CosmosDBThroughputPoolData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CosmosDBThroughputPoolResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBThroughputPoolThroughputPoolClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cosmosDBThroughputPoolThroughputPoolApiVersion); - _cosmosDBThroughputPoolThroughputPoolRestClient = new ThroughputPoolRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolThroughputPoolApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CosmosDBThroughputPoolData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of CosmosDBThroughputPoolAccountResources in the CosmosDBThroughputPool. - /// An object representing collection of CosmosDBThroughputPoolAccountResources and their operations over a CosmosDBThroughputPoolAccountResource. - public virtual CosmosDBThroughputPoolAccountCollection GetCosmosDBThroughputPoolAccounts() - { - return GetCachedClient(client => new CosmosDBThroughputPoolAccountCollection(client, Id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCosmosDBThroughputPoolAccountAsync(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - return await GetCosmosDBThroughputPoolAccounts().GetAsync(throughputPoolAccountName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCosmosDBThroughputPoolAccount(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - return GetCosmosDBThroughputPoolAccounts().Get(throughputPoolAccountName, cancellationToken); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Get"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Get"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Throughput Pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Delete - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Delete"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Throughput Pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Delete - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Delete"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates the properties of an existing Azure Cosmos DB Throughput Pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Update - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current Throughput Pool. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CosmosDBThroughputPoolPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Update"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolOperationSource(Client), _cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates the properties of an existing Azure Cosmos DB Throughput Pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Update - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current Throughput Pool. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CosmosDBThroughputPoolPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Update"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolOperationSource(Client), _cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs index 5a79c2ced285..016d1ac060e1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> Mi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateTableTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task> Mi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateTableTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> AddTag /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(string key, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> SetTag /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDictionar /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> Remove /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs deleted file mode 100644 index 41a781805471..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs +++ /dev/null @@ -1,498 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetDataTransferJobGetResults method from an instance of . - /// - public partial class DataTransferJobGetResultCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _dataTransferJobGetResultDataTransferJobsClientDiagnostics; - private readonly DataTransferJobsRestOperations _dataTransferJobGetResultDataTransferJobsRestClient; - - /// Initializes a new instance of the class for mocking. - protected DataTransferJobGetResultCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal DataTransferJobGetResultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _dataTransferJobGetResultDataTransferJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", DataTransferJobGetResultResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DataTransferJobGetResultResource.ResourceType, out string dataTransferJobGetResultDataTransferJobsApiVersion); - _dataTransferJobGetResultDataTransferJobsRestClient = new DataTransferJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataTransferJobGetResultDataTransferJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); - } - - /// - /// Creates a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Create - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the Data Transfer Job. - /// The to use. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string jobName, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, content, cancellationToken).ConfigureAwait(false); - var uri = _dataTransferJobGetResultDataTransferJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new CosmosDBArmOperation(Response.FromValue(new DataTransferJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Create - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the Data Transfer Job. - /// The to use. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string jobName, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, content, cancellationToken); - var uri = _dataTransferJobGetResultDataTransferJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new CosmosDBArmOperation(Response.FromValue(new DataTransferJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.Get"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.Get"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a list of Data Transfer jobs. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs - /// - /// - /// Operation Id - /// DataTransferJobs_ListByDatabaseAccount - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _dataTransferJobGetResultDataTransferJobsRestClient.CreateListByDatabaseAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataTransferJobGetResultDataTransferJobsRestClient.CreateListByDatabaseAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataTransferJobGetResultResource(Client, DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(e)), _dataTransferJobGetResultDataTransferJobsClientDiagnostics, Pipeline, "DataTransferJobGetResultCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Get a list of Data Transfer jobs. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs - /// - /// - /// Operation Id - /// DataTransferJobs_ListByDatabaseAccount - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _dataTransferJobGetResultDataTransferJobsRestClient.CreateListByDatabaseAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataTransferJobGetResultDataTransferJobsRestClient.CreateListByDatabaseAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataTransferJobGetResultResource(Client, DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(e)), _dataTransferJobGetResultDataTransferJobsClientDiagnostics, Pipeline, "DataTransferJobGetResultCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.Exists"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.Exists"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs deleted file mode 100644 index 84e08292fe46..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs +++ /dev/null @@ -1,579 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class DataTransferJobGetResultData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(JobName)) - { - writer.WritePropertyName("jobName"u8); - writer.WriteStringValue(JobName); - } - if (Optional.IsDefined(Source)) - { - writer.WritePropertyName("source"u8); - writer.WriteObjectValue(Source, options); - } - if (Optional.IsDefined(Destination)) - { - writer.WritePropertyName("destination"u8); - writer.WriteObjectValue(Destination, options); - } - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status); - } - if (options.Format != "W" && Optional.IsDefined(ProcessedCount)) - { - writer.WritePropertyName("processedCount"u8); - writer.WriteNumberValue(ProcessedCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(TotalCount)) - { - writer.WritePropertyName("totalCount"u8); - writer.WriteNumberValue(TotalCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(LastUpdatedUtcOn)) - { - writer.WritePropertyName("lastUpdatedUtcTime"u8); - writer.WriteStringValue(LastUpdatedUtcOn.Value, "O"); - } - if (Optional.IsDefined(WorkerCount)) - { - writer.WritePropertyName("workerCount"u8); - writer.WriteNumberValue(WorkerCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); - } - if (options.Format != "W" && Optional.IsDefined(Duration)) - { - writer.WritePropertyName("duration"u8); - writer.WriteStringValue(Duration.Value, "c"); - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - writer.WriteEndObject(); - } - - DataTransferJobGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferJobGetResultData(document.RootElement, options); - } - - internal static DataTransferJobGetResultData DeserializeDataTransferJobGetResultData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - string jobName = default; - DataTransferDataSourceSink source = default; - DataTransferDataSourceSink destination = default; - string status = default; - long? processedCount = default; - long? totalCount = default; - DateTimeOffset? lastUpdatedUtcTime = default; - int? workerCount = default; - CosmosDBErrorResult error = default; - TimeSpan? duration = default; - DataTransferJobMode? mode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("jobName"u8)) - { - jobName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("source"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - source = DataTransferDataSourceSink.DeserializeDataTransferDataSourceSink(property0.Value, options); - continue; - } - if (property0.NameEquals("destination"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - destination = DataTransferDataSourceSink.DeserializeDataTransferDataSourceSink(property0.Value, options); - continue; - } - if (property0.NameEquals("status"u8)) - { - status = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("processedCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - processedCount = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("totalCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - totalCount = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("lastUpdatedUtcTime"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastUpdatedUtcTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("workerCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workerCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("error"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = CosmosDBErrorResult.DeserializeCosmosDBErrorResult(property0.Value, options); - continue; - } - if (property0.NameEquals("duration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - duration = property0.Value.GetTimeSpan("c"); - continue; - } - if (property0.NameEquals("mode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new DataTransferJobMode(property0.Value.GetString()); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataTransferJobGetResultData( - id, - name, - type, - systemData, - jobName, - source, - destination, - status, - processedCount, - totalCount, - lastUpdatedUtcTime, - workerCount, - error, - duration, - mode, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" jobName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(JobName)) - { - builder.Append(" jobName: "); - if (JobName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{JobName}'''"); - } - else - { - builder.AppendLine($"'{JobName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" source: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Source)) - { - builder.Append(" source: "); - BicepSerializationHelpers.AppendChildObject(builder, Source, options, 4, false, " source: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destination), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" destination: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Destination)) - { - builder.Append(" destination: "); - BicepSerializationHelpers.AppendChildObject(builder, Destination, options, 4, false, " destination: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" status: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Status)) - { - builder.Append(" status: "); - if (Status.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Status}'''"); - } - else - { - builder.AppendLine($"'{Status}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" processedCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProcessedCount)) - { - builder.Append(" processedCount: "); - builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" totalCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(TotalCount)) - { - builder.Append(" totalCount: "); - builder.AppendLine($"'{TotalCount.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastUpdatedUtcOn), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" lastUpdatedUtcTime: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(LastUpdatedUtcOn)) - { - builder.Append(" lastUpdatedUtcTime: "); - var formattedDateTimeString = TypeFormatters.ToString(LastUpdatedUtcOn.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WorkerCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" workerCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(WorkerCount)) - { - builder.Append(" workerCount: "); - builder.AppendLine($"{WorkerCount.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" error: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Error)) - { - builder.Append(" error: "); - BicepSerializationHelpers.AppendChildObject(builder, Error, options, 4, false, " error: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Duration), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" duration: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Duration)) - { - builder.Append(" duration: "); - var formattedTimeSpan = TypeFormatters.ToString(Duration.Value, "P"); - builder.AppendLine($"'{formattedTimeSpan}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Mode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" mode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Mode)) - { - builder.Append(" mode: "); - builder.AppendLine($"'{Mode.Value.ToString()}'"); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support writing '{options.Format}' format."); - } - } - - DataTransferJobGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDataTransferJobGetResultData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs deleted file mode 100644 index 54d4b37de37b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the DataTransferJobGetResult data model. - /// A Cosmos DB Data Transfer Job - /// - public partial class DataTransferJobGetResultData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public DataTransferJobGetResultData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Job Name. - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - /// Job Status. - /// Processed Count. - /// Total Count. - /// Last Updated Time (ISO-8601 format). - /// Worker count. - /// Error response for Faulted job. - /// Total Duration of Job. - /// Mode of job execution. - /// Keeps track of any properties unknown to the library. - internal DataTransferJobGetResultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string jobName, DataTransferDataSourceSink source, DataTransferDataSourceSink destination, string status, long? processedCount, long? totalCount, DateTimeOffset? lastUpdatedUtcOn, int? workerCount, CosmosDBErrorResult error, TimeSpan? duration, DataTransferJobMode? mode, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - JobName = jobName; - Source = source; - Destination = destination; - Status = status; - ProcessedCount = processedCount; - TotalCount = totalCount; - LastUpdatedUtcOn = lastUpdatedUtcOn; - WorkerCount = workerCount; - Error = error; - Duration = duration; - Mode = mode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Job Name. - [WirePath("properties.jobName")] - public string JobName { get; } - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - [WirePath("properties.source")] - public DataTransferDataSourceSink Source { get; set; } - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - [WirePath("properties.destination")] - public DataTransferDataSourceSink Destination { get; set; } - /// Job Status. - [WirePath("properties.status")] - public string Status { get; } - /// Processed Count. - [WirePath("properties.processedCount")] - public long? ProcessedCount { get; } - /// Total Count. - [WirePath("properties.totalCount")] - public long? TotalCount { get; } - /// Last Updated Time (ISO-8601 format). - [WirePath("properties.lastUpdatedUtcTime")] - public DateTimeOffset? LastUpdatedUtcOn { get; } - /// Worker count. - [WirePath("properties.workerCount")] - public int? WorkerCount { get; set; } - /// Error response for Faulted job. - [WirePath("properties.error")] - public CosmosDBErrorResult Error { get; } - /// Total Duration of Job. - [WirePath("properties.duration")] - public TimeSpan? Duration { get; } - /// Mode of job execution. - [WirePath("properties.mode")] - public DataTransferJobMode? Mode { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.Serialization.cs deleted file mode 100644 index bd195cdfe057..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class DataTransferJobGetResultResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DataTransferJobGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - DataTransferJobGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs deleted file mode 100644 index 4389dd31711d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs +++ /dev/null @@ -1,572 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a DataTransferJobGetResult along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetDataTransferJobGetResultResource method. - /// Otherwise you can get one from its parent resource using the GetDataTransferJobGetResult method. - /// - public partial class DataTransferJobGetResultResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The jobName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _dataTransferJobGetResultDataTransferJobsClientDiagnostics; - private readonly DataTransferJobsRestOperations _dataTransferJobGetResultDataTransferJobsRestClient; - private readonly DataTransferJobGetResultData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"; - - /// Initializes a new instance of the class for mocking. - protected DataTransferJobGetResultResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal DataTransferJobGetResultResource(ArmClient client, DataTransferJobGetResultData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal DataTransferJobGetResultResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _dataTransferJobGetResultDataTransferJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string dataTransferJobGetResultDataTransferJobsApiVersion); - _dataTransferJobGetResultDataTransferJobsRestClient = new DataTransferJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataTransferJobGetResultDataTransferJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual DataTransferJobGetResultData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Get"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Get"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Create - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The to use. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Update"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var uri = _dataTransferJobGetResultDataTransferJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new CosmosDBArmOperation(Response.FromValue(new DataTransferJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Create - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The to use. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Update"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var uri = _dataTransferJobGetResultDataTransferJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new CosmosDBArmOperation(Response.FromValue(new DataTransferJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Pause a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause - /// - /// - /// Operation Id - /// DataTransferJobs_Pause - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> PauseAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Pause"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.PauseAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Pause a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause - /// - /// - /// Operation Id - /// DataTransferJobs_Pause - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Pause(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Pause"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Pause(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Resumes a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume - /// - /// - /// Operation Id - /// DataTransferJobs_Resume - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> ResumeAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Resume"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.ResumeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Resumes a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume - /// - /// - /// Operation Id - /// DataTransferJobs_Resume - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Resume(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Resume"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Resume(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Cancels a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel - /// - /// - /// Operation Id - /// DataTransferJobs_Cancel - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> CancelAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Cancel"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.CancelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Cancels a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel - /// - /// - /// Operation Id - /// DataTransferJobs_Cancel - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Cancel(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Cancel"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Cancel(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Completes a Data Transfer Online Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/complete - /// - /// - /// Operation Id - /// DataTransferJobs_Complete - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> CompleteAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Complete"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.CompleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Completes a Data Transfer Online Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/complete - /// - /// - /// Operation Id - /// DataTransferJobs_Complete - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Complete(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Complete"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Complete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs index 14a704c1f2bd..50e2600accf2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs @@ -37,25 +37,6 @@ private static MockableCosmosDBTenantResource GetMockableCosmosDBTenantResource( return resource.GetCachedClient(client => new MockableCosmosDBTenantResource(client, resource.Id)); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CosmosDBChaosFaultResource GetCosmosDBChaosFaultResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCosmosDBChaosFaultResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -75,25 +56,6 @@ public static CosmosDBAccountResource GetCosmosDBAccountResource(this ArmClient return GetMockableCosmosDBArmClient(client).GetCosmosDBAccountResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static GraphResourceGetResultResource GetGraphResourceGetResultResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetGraphResourceGetResultResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -246,25 +208,6 @@ public static CassandraTableThroughputSettingResource GetCassandraTableThroughpu return GetMockableCosmosDBArmClient(client).GetCassandraTableThroughputSettingResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CassandraViewThroughputSettingResource GetCassandraViewThroughputSettingResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCassandraViewThroughputSettingResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -304,41 +247,41 @@ public static GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSet } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static CosmosDBSqlContainerResource GetCosmosDBSqlContainerResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableCosmosDBArmClient(client).GetCosmosDBSqlClientEncryptionKeyResource(id); + return GetMockableCosmosDBArmClient(client).GetCosmosDBSqlContainerResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static CosmosDBSqlContainerResource GetCosmosDBSqlContainerResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableCosmosDBArmClient(client).GetCosmosDBSqlContainerResource(id); + return GetMockableCosmosDBArmClient(client).GetCosmosDBSqlClientEncryptionKeyResource(id); } /// @@ -531,44 +474,6 @@ public static CosmosDBTableResource GetCosmosDBTableResource(this ArmClient clie return GetMockableCosmosDBArmClient(client).GetCosmosDBTableResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CosmosDBTableRoleDefinitionResource GetCosmosDBTableRoleDefinitionResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCosmosDBTableRoleDefinitionResource(id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CosmosDBTableRoleAssignmentResource GetCosmosDBTableRoleAssignmentResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCosmosDBTableRoleAssignmentResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -607,25 +512,6 @@ public static CassandraTableResource GetCassandraTableResource(this ArmClient cl return GetMockableCosmosDBArmClient(client).GetCassandraTableResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CassandraViewGetResultResource GetCassandraViewGetResultResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCassandraViewGetResultResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -683,25 +569,6 @@ public static CosmosDBLocationResource GetCosmosDBLocationResource(this ArmClien return GetMockableCosmosDBArmClient(client).GetCosmosDBLocationResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static DataTransferJobGetResultResource GetDataTransferJobGetResultResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetDataTransferJobGetResultResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -740,25 +607,6 @@ public static CassandraDataCenterResource GetCassandraDataCenterResource(this Ar return GetMockableCosmosDBArmClient(client).GetCassandraDataCenterResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetNetworkSecurityPerimeterConfigurationResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -835,44 +683,6 @@ public static CosmosDBServiceResource GetCosmosDBServiceResource(this ArmClient return GetMockableCosmosDBArmClient(client).GetCosmosDBServiceResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CosmosDBThroughputPoolResource GetCosmosDBThroughputPoolResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCosmosDBThroughputPoolResource(id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CosmosDBThroughputPoolAccountResource GetCosmosDBThroughputPoolAccountResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCosmosDBThroughputPoolAccountResource(id); - } - /// /// Gets a collection of CosmosDBAccountResources in the ResourceGroupResource. /// @@ -903,7 +713,7 @@ public static CosmosDBAccountCollection GetCosmosDBAccounts(this ResourceGroupRe /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -941,7 +751,7 @@ public static async Task> GetCosmosDBAccountAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -996,7 +806,7 @@ public static CassandraClusterCollection GetCassandraClusters(this ResourceGroup /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1034,7 +844,7 @@ public static async Task> GetCassandraCluster /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1059,99 +869,6 @@ public static Response GetCassandraCluster(this Resour return GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCassandraCluster(clusterName, cancellationToken); } - /// - /// Gets a collection of CosmosDBThroughputPoolResources in the ResourceGroupResource. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// is null. - /// An object representing collection of CosmosDBThroughputPoolResources and their operations over a CosmosDBThroughputPoolResource. - public static CosmosDBThroughputPoolCollection GetCosmosDBThroughputPools(this ResourceGroupResource resourceGroupResource) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCosmosDBThroughputPools(); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetCosmosDBThroughputPoolAsync(this ResourceGroupResource resourceGroupResource, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return await GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCosmosDBThroughputPoolAsync(throughputPoolName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetCosmosDBThroughputPool(this ResourceGroupResource resourceGroupResource, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCosmosDBThroughputPool(throughputPoolName, cancellationToken); - } - /// /// Gets a collection of CosmosDBLocationResources in the SubscriptionResource. /// @@ -1182,7 +899,7 @@ public static CosmosDBLocationCollection GetCosmosDBLocations(this SubscriptionR /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1219,7 +936,7 @@ public static async Task> GetCosmosDBLocation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1256,7 +973,7 @@ public static Response GetCosmosDBLocation(this Subscr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1292,7 +1009,7 @@ public static AsyncPageable GetCosmosDBAccountsAsync(th /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1328,7 +1045,7 @@ public static Pageable GetCosmosDBAccounts(this Subscri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1364,7 +1081,7 @@ public static AsyncPageable GetCassandraClustersAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1400,7 +1117,7 @@ public static Pageable GetCassandraClusters(this Subsc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1436,7 +1153,7 @@ public static AsyncPageable GetRestorableCosm /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1459,78 +1176,6 @@ public static Pageable GetRestorableCosmosDBA return GetMockableCosmosDBSubscriptionResource(subscriptionResource).GetRestorableCosmosDBAccounts(cancellationToken); } - /// - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_List - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetCosmosDBThroughputPoolsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableCosmosDBSubscriptionResource(subscriptionResource).GetCosmosDBThroughputPoolsAsync(cancellationToken); - } - - /// - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_List - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetCosmosDBThroughputPools(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableCosmosDBSubscriptionResource(subscriptionResource).GetCosmosDBThroughputPools(cancellationToken); - } - /// /// Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. /// @@ -1544,7 +1189,7 @@ public static Pageable GetCosmosDBThroughputPool /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -1581,7 +1226,7 @@ public static async Task> CheckNameExistsDatabaseAccountAsync(thi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs index 4fa1c05b5a45..46b5ff6c6c8e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs @@ -34,18 +34,6 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CosmosDBChaosFaultResource GetCosmosDBChaosFaultResource(ResourceIdentifier id) - { - CosmosDBChaosFaultResource.ValidateResourceId(id); - return new CosmosDBChaosFaultResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -58,18 +46,6 @@ public virtual CosmosDBAccountResource GetCosmosDBAccountResource(ResourceIdenti return new CosmosDBAccountResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual GraphResourceGetResultResource GetGraphResourceGetResultResource(ResourceIdentifier id) - { - GraphResourceGetResultResource.ValidateResourceId(id); - return new GraphResourceGetResultResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -166,18 +142,6 @@ public virtual CassandraTableThroughputSettingResource GetCassandraTableThroughp return new CassandraTableThroughputSettingResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CassandraViewThroughputSettingResource GetCassandraViewThroughputSettingResource(ResourceIdentifier id) - { - CassandraViewThroughputSettingResource.ValidateResourceId(id); - return new CassandraViewThroughputSettingResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -202,18 +166,6 @@ public virtual GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSe return new GremlinGraphThroughputSettingResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(ResourceIdentifier id) - { - CosmosDBSqlClientEncryptionKeyResource.ValidateResourceId(id); - return new CosmosDBSqlClientEncryptionKeyResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -226,6 +178,18 @@ public virtual CosmosDBSqlContainerResource GetCosmosDBSqlContainerResource(Reso return new CosmosDBSqlContainerResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(ResourceIdentifier id) + { + CosmosDBSqlClientEncryptionKeyResource.ValidateResourceId(id); + return new CosmosDBSqlClientEncryptionKeyResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -346,30 +310,6 @@ public virtual CosmosDBTableResource GetCosmosDBTableResource(ResourceIdentifier return new CosmosDBTableResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CosmosDBTableRoleDefinitionResource GetCosmosDBTableRoleDefinitionResource(ResourceIdentifier id) - { - CosmosDBTableRoleDefinitionResource.ValidateResourceId(id); - return new CosmosDBTableRoleDefinitionResource(Client, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CosmosDBTableRoleAssignmentResource GetCosmosDBTableRoleAssignmentResource(ResourceIdentifier id) - { - CosmosDBTableRoleAssignmentResource.ValidateResourceId(id); - return new CosmosDBTableRoleAssignmentResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -394,18 +334,6 @@ public virtual CassandraTableResource GetCassandraTableResource(ResourceIdentifi return new CassandraTableResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CassandraViewGetResultResource GetCassandraViewGetResultResource(ResourceIdentifier id) - { - CassandraViewGetResultResource.ValidateResourceId(id); - return new CassandraViewGetResultResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -442,18 +370,6 @@ public virtual CosmosDBLocationResource GetCosmosDBLocationResource(ResourceIden return new CosmosDBLocationResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual DataTransferJobGetResultResource GetDataTransferJobGetResultResource(ResourceIdentifier id) - { - DataTransferJobGetResultResource.ValidateResourceId(id); - return new DataTransferJobGetResultResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -478,18 +394,6 @@ public virtual CassandraDataCenterResource GetCassandraDataCenterResource(Resour return new CassandraDataCenterResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(ResourceIdentifier id) - { - NetworkSecurityPerimeterConfigurationResource.ValidateResourceId(id); - return new NetworkSecurityPerimeterConfigurationResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -537,29 +441,5 @@ public virtual CosmosDBServiceResource GetCosmosDBServiceResource(ResourceIdenti CosmosDBServiceResource.ValidateResourceId(id); return new CosmosDBServiceResource(Client, id); } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CosmosDBThroughputPoolResource GetCosmosDBThroughputPoolResource(ResourceIdentifier id) - { - CosmosDBThroughputPoolResource.ValidateResourceId(id); - return new CosmosDBThroughputPoolResource(Client, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CosmosDBThroughputPoolAccountResource GetCosmosDBThroughputPoolAccountResource(ResourceIdentifier id) - { - CosmosDBThroughputPoolAccountResource.ValidateResourceId(id); - return new CosmosDBThroughputPoolAccountResource(Client, id); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs index 93d39dd8e3e9..91ac0af1e913 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual CosmosDBAccountCollection GetCosmosDBAccounts() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetCosmosDBAccountA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -122,7 +122,7 @@ public virtual CassandraClusterCollection GetCassandraClusters() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> GetCassandraCluste /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -170,74 +170,5 @@ public virtual Response GetCassandraCluster(string clu { return GetCassandraClusters().Get(clusterName, cancellationToken); } - - /// Gets a collection of CosmosDBThroughputPoolResources in the ResourceGroupResource. - /// An object representing collection of CosmosDBThroughputPoolResources and their operations over a CosmosDBThroughputPoolResource. - public virtual CosmosDBThroughputPoolCollection GetCosmosDBThroughputPools() - { - return GetCachedClient(client => new CosmosDBThroughputPoolCollection(client, Id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCosmosDBThroughputPoolAsync(string throughputPoolName, CancellationToken cancellationToken = default) - { - return await GetCosmosDBThroughputPools().GetAsync(throughputPoolName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCosmosDBThroughputPool(string throughputPoolName, CancellationToken cancellationToken = default) - { - return GetCosmosDBThroughputPools().Get(throughputPoolName, cancellationToken); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs index c38f8282a4cf..50885f2762e1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs @@ -22,8 +22,6 @@ public partial class MockableCosmosDBSubscriptionResource : ArmResource private CassandraClustersRestOperations _cassandraClusterRestClient; private ClientDiagnostics _restorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics; private RestorableDatabaseAccountsRestOperations _restorableCosmosDBAccountRestorableDatabaseAccountsRestClient; - private ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics; - private ThroughputPoolsRestOperations _cosmosDBThroughputPoolThroughputPoolsRestClient; /// Initializes a new instance of the class for mocking. protected MockableCosmosDBSubscriptionResource() @@ -43,8 +41,6 @@ internal MockableCosmosDBSubscriptionResource(ArmClient client, ResourceIdentifi private CassandraClustersRestOperations CassandraClusterRestClient => _cassandraClusterRestClient ??= new CassandraClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CassandraClusterResource.ResourceType)); private ClientDiagnostics RestorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics => _restorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CosmosDB", RestorableCosmosDBAccountResource.ResourceType.Namespace, Diagnostics); private RestorableDatabaseAccountsRestOperations RestorableCosmosDBAccountRestorableDatabaseAccountsRestClient => _restorableCosmosDBAccountRestorableDatabaseAccountsRestClient ??= new RestorableDatabaseAccountsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(RestorableCosmosDBAccountResource.ResourceType)); - private ClientDiagnostics CosmosDBThroughputPoolThroughputPoolsClientDiagnostics => _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolResource.ResourceType.Namespace, Diagnostics); - private ThroughputPoolsRestOperations CosmosDBThroughputPoolThroughputPoolsRestClient => _cosmosDBThroughputPoolThroughputPoolsRestClient ??= new ThroughputPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CosmosDBThroughputPoolResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -72,7 +68,7 @@ public virtual CosmosDBLocationCollection GetCosmosDBLocations() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -101,7 +97,7 @@ public virtual async Task> GetCosmosDBLocatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -130,7 +126,7 @@ public virtual Response GetCosmosDBLocation(AzureLocat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -159,7 +155,7 @@ public virtual AsyncPageable GetCosmosDBAccountsAsync(C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -188,7 +184,7 @@ public virtual Pageable GetCosmosDBAccounts(Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -217,7 +213,7 @@ public virtual AsyncPageable GetCassandraClustersAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -246,7 +242,7 @@ public virtual Pageable GetCassandraClusters(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -275,7 +271,7 @@ public virtual AsyncPageable GetRestorableCos /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -290,65 +286,5 @@ public virtual Pageable GetRestorableCosmosDB HttpMessage FirstPageRequest(int? pageSizeHint) => RestorableCosmosDBAccountRestorableDatabaseAccountsRestClient.CreateListRequest(Id.SubscriptionId); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new RestorableCosmosDBAccountResource(Client, RestorableCosmosDBAccountData.DeserializeRestorableCosmosDBAccountData(e)), RestorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics, Pipeline, "MockableCosmosDBSubscriptionResource.GetRestorableCosmosDBAccounts", "value", null, cancellationToken); } - - /// - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_List - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCosmosDBThroughputPoolsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), CosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "MockableCosmosDBSubscriptionResource.GetCosmosDBThroughputPools", "value", "nextLink", cancellationToken); - } - - /// - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_List - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCosmosDBThroughputPools(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), CosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "MockableCosmosDBSubscriptionResource.GetCosmosDBThroughputPools", "value", "nextLink", cancellationToken); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs index e301cf7e9288..3946791cc427 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs @@ -53,7 +53,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -96,7 +96,7 @@ public virtual async Task> CheckNameExistsDatabaseAccountAsync(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs deleted file mode 100644 index 1c085fec0690..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetGraphResourceGetResults method from an instance of . - /// - public partial class GraphResourceGetResultCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _graphResourceGetResultGraphResourcesClientDiagnostics; - private readonly GraphResourcesRestOperations _graphResourceGetResultGraphResourcesRestClient; - - /// Initializes a new instance of the class for mocking. - protected GraphResourceGetResultCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal GraphResourceGetResultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _graphResourceGetResultGraphResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", GraphResourceGetResultResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(GraphResourceGetResultResource.ResourceType, out string graphResourceGetResultGraphResourcesApiVersion); - _graphResourceGetResultGraphResourcesRestClient = new GraphResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, graphResourceGetResultGraphResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); - } - - /// - /// Create or update an Azure Cosmos DB Graph. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_CreateUpdateGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB graph resource name. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string graphName, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.CreateUpdateGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, content, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new GraphResourceGetResultOperationSource(Client), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateCreateUpdateGraphRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Graph. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_CreateUpdateGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB graph resource name. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string graphName, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.CreateUpdateGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, content, cancellationToken); - var operation = new CosmosDBArmOperation(new GraphResourceGetResultOperationSource(Client), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateCreateUpdateGraphRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.Get"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.Get"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the graphs under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs - /// - /// - /// Operation Id - /// GraphResources_ListGraphs - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _graphResourceGetResultGraphResourcesRestClient.CreateListGraphsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new GraphResourceGetResultResource(Client, GraphResourceGetResultData.DeserializeGraphResourceGetResultData(e)), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, "GraphResourceGetResultCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Lists the graphs under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs - /// - /// - /// Operation Id - /// GraphResources_ListGraphs - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _graphResourceGetResultGraphResourcesRestClient.CreateListGraphsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new GraphResourceGetResultResource(Client, GraphResourceGetResultData.DeserializeGraphResourceGetResultData(e)), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, "GraphResourceGetResultCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.Exists"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.Exists"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs deleted file mode 100644 index 942ccf7463b4..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class GraphResourceGetResultData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Resource)) - { - writer.WritePropertyName("resource"u8); - JsonSerializer.Serialize(writer, Resource); - } - if (Optional.IsDefined(Options)) - { - writer.WritePropertyName("options"u8); - writer.WriteObjectValue(Options, options); - } - writer.WriteEndObject(); - } - - GraphResourceGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGraphResourceGetResultData(document.RootElement, options); - } - - internal static GraphResourceGetResultData DeserializeGraphResourceGetResultData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - WritableSubResource resource = default; - GraphResourceGetPropertiesOptions options0 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resource = JsonSerializer.Deserialize(property0.Value.GetRawText()); - continue; - } - if (property0.NameEquals("options"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - options0 = GraphResourceGetPropertiesOptions.DeserializeGraphResourceGetPropertiesOptions(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GraphResourceGetResultData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - options0, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResourceId", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine("{"); - builder.AppendLine(" resource: {"); - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" options: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Options)) - { - builder.Append(" options: "); - BicepSerializationHelpers.AppendChildObject(builder, Options, options, 4, false, " options: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support writing '{options.Format}' format."); - } - } - - GraphResourceGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeGraphResourceGetResultData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.cs deleted file mode 100644 index 7210bb573190..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the GraphResourceGetResult data model. - /// An Azure Cosmos DB Graph resource. - /// - public partial class GraphResourceGetResultData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public GraphResourceGetResultData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Gets or sets the resource. - /// - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal GraphResourceGetResultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, WritableSubResource resource, GraphResourceGetPropertiesOptions options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Options = options; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GraphResourceGetResultData() - { - } - - /// Gets or sets the resource. - internal WritableSubResource Resource { get; set; } - /// Gets or sets Id. - [WirePath("properties.resource.id")] - public ResourceIdentifier ResourceId - { - get => Resource is null ? default : Resource.Id; - set - { - if (Resource is null) - Resource = new WritableSubResource(); - Resource.Id = value; - } - } - - /// Gets or sets the options. - [WirePath("properties.options")] - public GraphResourceGetPropertiesOptions Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.Serialization.cs deleted file mode 100644 index 9cabba2759d1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class GraphResourceGetResultResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - GraphResourceGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - GraphResourceGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs deleted file mode 100644 index 01d1e63a7df7..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs +++ /dev/null @@ -1,707 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a GraphResourceGetResult along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetGraphResourceGetResultResource method. - /// Otherwise you can get one from its parent resource using the GetGraphResourceGetResult method. - /// - public partial class GraphResourceGetResultResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The graphName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _graphResourceGetResultGraphResourcesClientDiagnostics; - private readonly GraphResourcesRestOperations _graphResourceGetResultGraphResourcesRestClient; - private readonly GraphResourceGetResultData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/graphs"; - - /// Initializes a new instance of the class for mocking. - protected GraphResourceGetResultResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal GraphResourceGetResultResource(ArmClient client, GraphResourceGetResultData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal GraphResourceGetResultResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _graphResourceGetResultGraphResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string graphResourceGetResultGraphResourcesApiVersion); - _graphResourceGetResultGraphResourcesRestClient = new GraphResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, graphResourceGetResultGraphResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual GraphResourceGetResultData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Get"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Get"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Graph Resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_DeleteGraphResource - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Delete"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.DeleteGraphResourceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateDeleteGraphResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Graph Resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_DeleteGraphResource - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Delete"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.DeleteGraphResource(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateDeleteGraphResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Graph. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_CreateUpdateGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Update"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.CreateUpdateGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new GraphResourceGetResultOperationSource(Client), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateCreateUpdateGraphRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Graph. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_CreateUpdateGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Update"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.CreateUpdateGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new CosmosDBArmOperation(new GraphResourceGetResultOperationSource(Client), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateCreateUpdateGraphRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs index d952dcb00519..09ec44e2ec15 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string dat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs index 63d4349d94f6..e4df0e1b07d6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -80,7 +74,6 @@ internal static GremlinDatabaseData DeserializeGremlinDatabaseData(JsonElement e { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -93,16 +86,6 @@ internal static GremlinDatabaseData DeserializeGremlinDatabaseData(JsonElement e Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -191,7 +174,6 @@ internal static GremlinDatabaseData DeserializeGremlinDatabaseData(JsonElement e location, resource, options0, - identity, serializedAdditionalRawData); } @@ -278,21 +260,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.cs index 7c1234e5de4d..98733e89aa61 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.cs @@ -66,13 +66,11 @@ public GremlinDatabaseData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal GremlinDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedGremlinDatabaseResourceInfo resource, GremlinDatabasePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal GremlinDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedGremlinDatabaseResourceInfo resource, GremlinDatabasePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal GremlinDatabaseData() /// Gets or sets the options. [WirePath("properties.options")] public GremlinDatabasePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs index d9025dcb002b..b36e83fe03ae 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs @@ -117,7 +117,7 @@ public virtual GremlinGraphCollection GetGremlinGraphs() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetGremlinGraphAsync(s /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual Response GetGremlinGraph(string graphName, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -389,7 +389,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -435,7 +435,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -497,7 +497,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -559,7 +559,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -616,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -673,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -733,7 +733,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs index 45aceb445eaa..23fc239e1188 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateGre /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateGre /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs index 87814e0c8d3e..3219f331ed12 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string graphN /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string graphName, Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string graphName, Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string graphName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs index 70a05163f014..3a3d73d1518e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -80,7 +74,6 @@ internal static GremlinGraphData DeserializeGremlinGraphData(JsonElement element { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -93,16 +86,6 @@ internal static GremlinGraphData DeserializeGremlinGraphData(JsonElement element Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -191,7 +174,6 @@ internal static GremlinGraphData DeserializeGremlinGraphData(JsonElement element location, resource, options0, - identity, serializedAdditionalRawData); } @@ -278,21 +260,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.cs index 777952f74990..6b4043d8f297 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.cs @@ -66,13 +66,11 @@ public GremlinGraphData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal GremlinGraphData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedGremlinGraphResourceInfo resource, GremlinGraphPropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal GremlinGraphData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedGremlinGraphResourceInfo resource, GremlinGraphPropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal GremlinGraphData() /// Gets or sets the options. [WirePath("properties.options")] public GremlinGraphPropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs index c07e5d380308..0e519e2b1db5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs @@ -111,7 +111,7 @@ public virtual GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSe /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -367,7 +367,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Gr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -413,7 +413,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -459,7 +459,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -521,7 +521,7 @@ public virtual async Task> AddTagAsync(string key /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -583,7 +583,7 @@ public virtual Response AddTag(string key, string value, C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -640,7 +640,7 @@ public virtual async Task> SetTagsAsync(IDictiona /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -697,7 +697,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -757,7 +757,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs index 3c4071e263b9..1f26e6ba2caf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation MigrateGremli /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual ArmOperation MigrateGremli /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -506,7 +506,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -568,7 +568,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -625,7 +625,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs index 056a1bb85695..16e3fd1a0d2a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs @@ -60,7 +60,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs index 941778df95d2..1dff36e7d5bc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewGetResultOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewGetResultOperationSource.cs deleted file mode 100644 index 4e8f8406b328..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewGetResultOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CassandraViewGetResultOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CassandraViewGetResultOperationSource(ArmClient client) - { - _client = client; - } - - CassandraViewGetResultResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return new CassandraViewGetResultResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return await Task.FromResult(new CassandraViewGetResultResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewThroughputSettingOperationSource.cs deleted file mode 100644 index ba9a5f124a3d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewThroughputSettingOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CassandraViewThroughputSettingOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CassandraViewThroughputSettingOperationSource(ArmClient client) - { - _client = client; - } - - CassandraViewThroughputSettingResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return new CassandraViewThroughputSettingResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return await Task.FromResult(new CassandraViewThroughputSettingResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBChaosFaultResourceOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBChaosFaultResourceOperationSource.cs deleted file mode 100644 index f5a23d121b0a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBChaosFaultResourceOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CosmosDBChaosFaultResourceOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CosmosDBChaosFaultResourceOperationSource(ArmClient client) - { - _client = client; - } - - CosmosDBChaosFaultResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return new CosmosDBChaosFaultResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return await Task.FromResult(new CosmosDBChaosFaultResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs index c9da610c8b19..4f1f336ee65d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs index 8762ca7907f5..a4e0c7584e97 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs @@ -60,7 +60,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBTableRoleAssignmentOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBTableRoleAssignmentOperationSource.cs deleted file mode 100644 index f93c9fe06d40..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBTableRoleAssignmentOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CosmosDBTableRoleAssignmentOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CosmosDBTableRoleAssignmentOperationSource(ArmClient client) - { - _client = client; - } - - CosmosDBTableRoleAssignmentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return new CosmosDBTableRoleAssignmentResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return await Task.FromResult(new CosmosDBTableRoleAssignmentResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBTableRoleDefinitionOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBTableRoleDefinitionOperationSource.cs deleted file mode 100644 index 1213833275ef..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBTableRoleDefinitionOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CosmosDBTableRoleDefinitionOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CosmosDBTableRoleDefinitionOperationSource(ArmClient client) - { - _client = client; - } - - CosmosDBTableRoleDefinitionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return new CosmosDBTableRoleDefinitionResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return await Task.FromResult(new CosmosDBTableRoleDefinitionResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs deleted file mode 100644 index ea7312c9b7fd..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CosmosDBThroughputPoolAccountOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CosmosDBThroughputPoolAccountOperationSource(ArmClient client) - { - _client = client; - } - - CosmosDBThroughputPoolAccountResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return new CosmosDBThroughputPoolAccountResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return await Task.FromResult(new CosmosDBThroughputPoolAccountResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolOperationSource.cs deleted file mode 100644 index d06bd969b8e0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CosmosDBThroughputPoolOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CosmosDBThroughputPoolOperationSource(ArmClient client) - { - _client = client; - } - - CosmosDBThroughputPoolResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return new CosmosDBThroughputPoolResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return await Task.FromResult(new CosmosDBThroughputPoolResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs index b2a6906e45e7..7f7f6bfd1175 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs @@ -60,7 +60,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs deleted file mode 100644 index c92710dd7dbd..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class GraphResourceGetResultOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal GraphResourceGetResultOperationSource(ArmClient client) - { - _client = client; - } - - GraphResourceGetResultResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return new GraphResourceGetResultResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content); - return await Task.FromResult(new GraphResourceGetResultResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs index 48a928e89a5a..f6f2f9f53250 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs @@ -60,7 +60,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs index 922a12a2fbaf..829a4005da7a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs index f0fbd15ab4d0..e52e3c07d70e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs index 3d0e8702af63..c57800f6c4e4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs @@ -60,7 +60,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionStorageInfoCollectionOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionStorageInfoCollectionOperationSource.cs deleted file mode 100644 index ae1b0655e746..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionStorageInfoCollectionOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class PhysicalPartitionStorageInfoCollectionOperationSource : IOperationSource - { - PhysicalPartitionStorageInfoCollection IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - return PhysicalPartitionStorageInfoCollection.DeserializePhysicalPartitionStorageInfoCollection(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - return PhysicalPartitionStorageInfoCollection.DeserializePhysicalPartitionStorageInfoCollection(document.RootElement); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionThroughputInfoResultOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionThroughputInfoResultOperationSource.cs deleted file mode 100644 index 8deef7d65411..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionThroughputInfoResultOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class PhysicalPartitionThroughputInfoResultOperationSource : IOperationSource - { - PhysicalPartitionThroughputInfoResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - return PhysicalPartitionThroughputInfoResult.DeserializePhysicalPartitionThroughputInfoResult(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - return PhysicalPartitionThroughputInfoResult.DeserializePhysicalPartitionThroughputInfoResult(document.RootElement); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs deleted file mode 100644 index 95418dc64db5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class AccessRule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessRule)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - AccessRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessRule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAccessRule(document.RootElement, options); - } - - internal static AccessRule DeserializeAccessRule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - AccessRuleProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = AccessRuleProperties.DeserializeAccessRuleProperties(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AccessRule(name, properties, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" properties: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Properties)) - { - builder.Append(" properties: "); - BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(AccessRule)} does not support writing '{options.Format}' format."); - } - } - - AccessRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAccessRule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AccessRule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.cs deleted file mode 100644 index 6a99ca26cdbc..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Access rule in a network security perimeter configuration profile. - public partial class AccessRule - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public AccessRule() - { - } - - /// Initializes a new instance of . - /// Name of the access rule. - /// Properties of Access Rule. - /// Keeps track of any properties unknown to the library. - internal AccessRule(string name, AccessRuleProperties properties, IDictionary serializedAdditionalRawData) - { - Name = name; - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Name of the access rule. - [WirePath("name")] - public string Name { get; set; } - /// Properties of Access Rule. - [WirePath("properties")] - public AccessRuleProperties Properties { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleDirection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleDirection.cs deleted file mode 100644 index 683fd7d3354b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleDirection.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Direction of Access Rule. - public readonly partial struct AccessRuleDirection : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AccessRuleDirection(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InboundValue = "Inbound"; - private const string OutboundValue = "Outbound"; - - /// Applies to inbound network traffic to the secured resources. - public static AccessRuleDirection Inbound { get; } = new AccessRuleDirection(InboundValue); - /// Applies to outbound network traffic from the secured resources. - public static AccessRuleDirection Outbound { get; } = new AccessRuleDirection(OutboundValue); - /// Determines if two values are the same. - public static bool operator ==(AccessRuleDirection left, AccessRuleDirection right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AccessRuleDirection left, AccessRuleDirection right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator AccessRuleDirection(string value) => new AccessRuleDirection(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AccessRuleDirection other && Equals(other); - /// - public bool Equals(AccessRuleDirection other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs deleted file mode 100644 index d3c793821ee3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs +++ /dev/null @@ -1,516 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class AccessRuleProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Direction)) - { - writer.WritePropertyName("direction"u8); - writer.WriteStringValue(Direction.Value.ToString()); - } - if (Optional.IsCollectionDefined(AddressPrefixes)) - { - writer.WritePropertyName("addressPrefixes"u8); - writer.WriteStartArray(); - foreach (var item in AddressPrefixes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Subscriptions)) - { - writer.WritePropertyName("subscriptions"u8); - writer.WriteStartArray(); - foreach (var item in Subscriptions) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(NetworkSecurityPerimeters)) - { - writer.WritePropertyName("networkSecurityPerimeters"u8); - writer.WriteStartArray(); - foreach (var item in NetworkSecurityPerimeters) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(FullyQualifiedDomainNames)) - { - writer.WritePropertyName("fullyQualifiedDomainNames"u8); - writer.WriteStartArray(); - foreach (var item in FullyQualifiedDomainNames) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(EmailAddresses)) - { - writer.WritePropertyName("emailAddresses"u8); - writer.WriteStartArray(); - foreach (var item in EmailAddresses) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(PhoneNumbers)) - { - writer.WritePropertyName("phoneNumbers"u8); - writer.WriteStartArray(); - foreach (var item in PhoneNumbers) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - AccessRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAccessRuleProperties(document.RootElement, options); - } - - internal static AccessRuleProperties DeserializeAccessRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - AccessRuleDirection? direction = default; - IList addressPrefixes = default; - IList subscriptions = default; - IList networkSecurityPerimeters = default; - IList fullyQualifiedDomainNames = default; - IList emailAddresses = default; - IList phoneNumbers = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("direction"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - direction = new AccessRuleDirection(property.Value.GetString()); - continue; - } - if (property.NameEquals("addressPrefixes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - addressPrefixes = array; - continue; - } - if (property.NameEquals("subscriptions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - subscriptions = array; - continue; - } - if (property.NameEquals("networkSecurityPerimeters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NetworkSecurityPerimeter.DeserializeNetworkSecurityPerimeter(item, options)); - } - networkSecurityPerimeters = array; - continue; - } - if (property.NameEquals("fullyQualifiedDomainNames"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - fullyQualifiedDomainNames = array; - continue; - } - if (property.NameEquals("emailAddresses"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - emailAddresses = array; - continue; - } - if (property.NameEquals("phoneNumbers"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - phoneNumbers = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AccessRuleProperties( - direction, - addressPrefixes ?? new ChangeTrackingList(), - subscriptions ?? new ChangeTrackingList(), - networkSecurityPerimeters ?? new ChangeTrackingList(), - fullyQualifiedDomainNames ?? new ChangeTrackingList(), - emailAddresses ?? new ChangeTrackingList(), - phoneNumbers ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Direction), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" direction: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Direction)) - { - builder.Append(" direction: "); - builder.AppendLine($"'{Direction.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AddressPrefixes), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" addressPrefixes: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(AddressPrefixes)) - { - if (AddressPrefixes.Any()) - { - builder.Append(" addressPrefixes: "); - builder.AppendLine("["); - foreach (var item in AddressPrefixes) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Subscriptions), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" subscriptions: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Subscriptions)) - { - if (Subscriptions.Any()) - { - builder.Append(" subscriptions: "); - builder.AppendLine("["); - foreach (var item in Subscriptions) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " subscriptions: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkSecurityPerimeters), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" networkSecurityPerimeters: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(NetworkSecurityPerimeters)) - { - if (NetworkSecurityPerimeters.Any()) - { - builder.Append(" networkSecurityPerimeters: "); - builder.AppendLine("["); - foreach (var item in NetworkSecurityPerimeters) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " networkSecurityPerimeters: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FullyQualifiedDomainNames), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" fullyQualifiedDomainNames: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(FullyQualifiedDomainNames)) - { - if (FullyQualifiedDomainNames.Any()) - { - builder.Append(" fullyQualifiedDomainNames: "); - builder.AppendLine("["); - foreach (var item in FullyQualifiedDomainNames) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EmailAddresses), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" emailAddresses: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(EmailAddresses)) - { - if (EmailAddresses.Any()) - { - builder.Append(" emailAddresses: "); - builder.AppendLine("["); - foreach (var item in EmailAddresses) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhoneNumbers), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" phoneNumbers: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhoneNumbers)) - { - if (PhoneNumbers.Any()) - { - builder.Append(" phoneNumbers: "); - builder.AppendLine("["); - foreach (var item in PhoneNumbers) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support writing '{options.Format}' format."); - } - } - - AccessRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAccessRuleProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.cs deleted file mode 100644 index 5f258218ce35..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Properties of Access Rule. - public partial class AccessRuleProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public AccessRuleProperties() - { - AddressPrefixes = new ChangeTrackingList(); - Subscriptions = new ChangeTrackingList(); - NetworkSecurityPerimeters = new ChangeTrackingList(); - FullyQualifiedDomainNames = new ChangeTrackingList(); - EmailAddresses = new ChangeTrackingList(); - PhoneNumbers = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Direction of Access Rule. - /// Address prefixes in the CIDR format for inbound rules. - /// Subscriptions for inbound rules. - /// Network security perimeters for inbound rules. - /// Fully qualified domain names (FQDN) for outbound rules. - /// Email addresses for outbound rules. - /// Phone numbers for outbound rules. - /// Keeps track of any properties unknown to the library. - internal AccessRuleProperties(AccessRuleDirection? direction, IList addressPrefixes, IList subscriptions, IList networkSecurityPerimeters, IList fullyQualifiedDomainNames, IList emailAddresses, IList phoneNumbers, IDictionary serializedAdditionalRawData) - { - Direction = direction; - AddressPrefixes = addressPrefixes; - Subscriptions = subscriptions; - NetworkSecurityPerimeters = networkSecurityPerimeters; - FullyQualifiedDomainNames = fullyQualifiedDomainNames; - EmailAddresses = emailAddresses; - PhoneNumbers = phoneNumbers; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Direction of Access Rule. - [WirePath("direction")] - public AccessRuleDirection? Direction { get; set; } - /// Address prefixes in the CIDR format for inbound rules. - [WirePath("addressPrefixes")] - public IList AddressPrefixes { get; } - /// Subscriptions for inbound rules. - [WirePath("subscriptions")] - public IList Subscriptions { get; } - /// Network security perimeters for inbound rules. - [WirePath("networkSecurityPerimeters")] - public IList NetworkSecurityPerimeters { get; } - /// Fully qualified domain names (FQDN) for outbound rules. - [WirePath("fullyQualifiedDomainNames")] - public IList FullyQualifiedDomainNames { get; } - /// Email addresses for outbound rules. - [WirePath("emailAddresses")] - public IList EmailAddresses { get; } - /// Phone numbers for outbound rules. - [WirePath("phoneNumbers")] - public IList PhoneNumbers { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index bbb3f0b989e1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class AzureBlobDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("containerName"u8); - writer.WriteStringValue(ContainerName); - if (Optional.IsDefined(EndpointUri)) - { - writer.WritePropertyName("endpointUrl"u8); - writer.WriteStringValue(EndpointUri.AbsoluteUri); - } - } - - AzureBlobDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureBlobDataTransferDataSourceSink(document.RootElement, options); - } - - internal static AzureBlobDataTransferDataSourceSink DeserializeAzureBlobDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string containerName = default; - Uri endpointUrl = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("containerName"u8)) - { - containerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("endpointUrl"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - endpointUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AzureBlobDataTransferDataSourceSink(component, serializedAdditionalRawData, containerName, endpointUrl); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" containerName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ContainerName)) - { - builder.Append(" containerName: "); - if (ContainerName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ContainerName}'''"); - } - else - { - builder.AppendLine($"'{ContainerName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EndpointUri), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" endpointUrl: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EndpointUri)) - { - builder.Append(" endpointUrl: "); - builder.AppendLine($"'{EndpointUri.AbsoluteUri}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - AzureBlobDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAzureBlobDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.cs deleted file mode 100644 index 0beca6426b11..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// An Azure Blob Storage data source/sink. - public partial class AzureBlobDataTransferDataSourceSink : DataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// is null. - public AzureBlobDataTransferDataSourceSink(string containerName) - { - Argument.AssertNotNull(containerName, nameof(containerName)); - - ContainerName = containerName; - Component = DataTransferComponent.AzureBlobStorage; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - internal AzureBlobDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string containerName, Uri endpointUri) : base(component, serializedAdditionalRawData) - { - ContainerName = containerName; - EndpointUri = endpointUri; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal AzureBlobDataTransferDataSourceSink() - { - } - - /// Gets or sets the container name. - [WirePath("containerName")] - public string ContainerName { get; set; } - /// Gets or sets the endpoint uri. - [WirePath("endpointUrl")] - public Uri EndpointUri { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index 8f26aa8f95ca..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class BaseCosmosDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(RemoteAccountName)) - { - writer.WritePropertyName("remoteAccountName"u8); - writer.WriteStringValue(RemoteAccountName); - } - } - - BaseCosmosDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBaseCosmosDataTransferDataSourceSink(document.RootElement, options); - } - - internal static BaseCosmosDataTransferDataSourceSink DeserializeBaseCosmosDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("component", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "CosmosDBCassandra": return CosmosCassandraDataTransferDataSourceSink.DeserializeCosmosCassandraDataTransferDataSourceSink(element, options); - case "CosmosDBMongo": return CosmosMongoDataTransferDataSourceSink.DeserializeCosmosMongoDataTransferDataSourceSink(element, options); - case "CosmosDBSql": return CosmosSqlDataTransferDataSourceSink.DeserializeCosmosSqlDataTransferDataSourceSink(element, options); - } - } - string remoteAccountName = default; - DataTransferComponent component = "BaseCosmosDataTransferDataSourceSink"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("remoteAccountName"u8)) - { - remoteAccountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new BaseCosmosDataTransferDataSourceSink(component, serializedAdditionalRawData, remoteAccountName); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" remoteAccountName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RemoteAccountName)) - { - builder.Append(" remoteAccountName: "); - if (RemoteAccountName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RemoteAccountName}'''"); - } - else - { - builder.AppendLine($"'{RemoteAccountName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - BaseCosmosDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBaseCosmosDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.cs deleted file mode 100644 index 572917dec35e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// - /// A base CosmosDB data source/sink - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public partial class BaseCosmosDataTransferDataSourceSink : DataTransferDataSourceSink - { - /// Initializes a new instance of . - public BaseCosmosDataTransferDataSourceSink() - { - Component = new DataTransferComponent("BaseCosmosDataTransferDataSourceSink"); - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - internal BaseCosmosDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string remoteAccountName) : base(component, serializedAdditionalRawData) - { - RemoteAccountName = remoteAccountName; - Component = component; - } - - /// Gets or sets the remote account name. - [WirePath("remoteAccountName")] - public string RemoteAccountName { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityMode.cs deleted file mode 100644 index f5383aea90ed..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityMode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Indicates the capacity mode of the account. - public readonly partial struct CapacityMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CapacityMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string ProvisionedValue = "Provisioned"; - private const string ServerlessValue = "Serverless"; - - /// None. - public static CapacityMode None { get; } = new CapacityMode(NoneValue); - /// Provisioned. - public static CapacityMode Provisioned { get; } = new CapacityMode(ProvisionedValue); - /// Serverless. - public static CapacityMode Serverless { get; } = new CapacityMode(ServerlessValue); - /// Determines if two values are the same. - public static bool operator ==(CapacityMode left, CapacityMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CapacityMode left, CapacityMode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CapacityMode(string value) => new CapacityMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CapacityMode other && Equals(other); - /// - public bool Equals(CapacityMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs deleted file mode 100644 index 9c525e0df02b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CapacityModeChangeTransitionState : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(CapacityModeTransitionStatus)) - { - writer.WritePropertyName("capacityModeTransitionStatus"u8); - writer.WriteStringValue(CapacityModeTransitionStatus.Value.ToString()); - } - if (Optional.IsDefined(CurrentCapacityMode)) - { - writer.WritePropertyName("currentCapacityMode"u8); - writer.WriteStringValue(CurrentCapacityMode.Value.ToString()); - } - if (Optional.IsDefined(PreviousCapacityMode)) - { - writer.WritePropertyName("previousCapacityMode"u8); - writer.WriteStringValue(PreviousCapacityMode.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(CapacityModeTransitionBeginTimestamp)) - { - writer.WritePropertyName("capacityModeTransitionBeginTimestamp"u8); - writer.WriteStringValue(CapacityModeTransitionBeginTimestamp.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(CapacityModeTransitionEndTimestamp)) - { - writer.WritePropertyName("capacityModeTransitionEndTimestamp"u8); - writer.WriteStringValue(CapacityModeTransitionEndTimestamp.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(CapacityModeLastSuccessfulTransitionEndTimestamp)) - { - writer.WritePropertyName("capacityModeLastSuccessfulTransitionEndTimestamp"u8); - writer.WriteStringValue(CapacityModeLastSuccessfulTransitionEndTimestamp.Value, "O"); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - CapacityModeChangeTransitionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCapacityModeChangeTransitionState(document.RootElement, options); - } - - internal static CapacityModeChangeTransitionState DeserializeCapacityModeChangeTransitionState(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - CapacityModeTransitionStatus? capacityModeTransitionStatus = default; - CapacityMode? currentCapacityMode = default; - CapacityMode? previousCapacityMode = default; - DateTimeOffset? capacityModeTransitionBeginTimestamp = default; - DateTimeOffset? capacityModeTransitionEndTimestamp = default; - DateTimeOffset? capacityModeLastSuccessfulTransitionEndTimestamp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("capacityModeTransitionStatus"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeTransitionStatus = new CapacityModeTransitionStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("currentCapacityMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - currentCapacityMode = new CapacityMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("previousCapacityMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - previousCapacityMode = new CapacityMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("capacityModeTransitionBeginTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeTransitionBeginTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("capacityModeTransitionEndTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeTransitionEndTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("capacityModeLastSuccessfulTransitionEndTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeLastSuccessfulTransitionEndTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CapacityModeChangeTransitionState( - capacityModeTransitionStatus, - currentCapacityMode, - previousCapacityMode, - capacityModeTransitionBeginTimestamp, - capacityModeTransitionEndTimestamp, - capacityModeLastSuccessfulTransitionEndTimestamp, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeTransitionStatus), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeTransitionStatus: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeTransitionStatus)) - { - builder.Append(" capacityModeTransitionStatus: "); - builder.AppendLine($"'{CapacityModeTransitionStatus.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CurrentCapacityMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" currentCapacityMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CurrentCapacityMode)) - { - builder.Append(" currentCapacityMode: "); - builder.AppendLine($"'{CurrentCapacityMode.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PreviousCapacityMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" previousCapacityMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(PreviousCapacityMode)) - { - builder.Append(" previousCapacityMode: "); - builder.AppendLine($"'{PreviousCapacityMode.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeTransitionBeginTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeTransitionBeginTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeTransitionBeginTimestamp)) - { - builder.Append(" capacityModeTransitionBeginTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(CapacityModeTransitionBeginTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeTransitionEndTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeTransitionEndTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeTransitionEndTimestamp)) - { - builder.Append(" capacityModeTransitionEndTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(CapacityModeTransitionEndTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeLastSuccessfulTransitionEndTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeLastSuccessfulTransitionEndTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeLastSuccessfulTransitionEndTimestamp)) - { - builder.Append(" capacityModeLastSuccessfulTransitionEndTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(CapacityModeLastSuccessfulTransitionEndTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support writing '{options.Format}' format."); - } - } - - CapacityModeChangeTransitionState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCapacityModeChangeTransitionState(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.cs deleted file mode 100644 index d84fd207dee9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The transition state information related capacity mode change with update request. - public partial class CapacityModeChangeTransitionState - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CapacityModeChangeTransitionState() - { - } - - /// Initializes a new instance of . - /// The transition status of capacity mode. - /// Indicates the current capacity mode of the account. - /// Indicates the previous capacity mode of the account before successful transition. - /// Begin time in UTC of the capacity mode change. - /// End time in UTC of the capacity mode change. - /// End time in UTC of the last successful capacity mode change. - /// Keeps track of any properties unknown to the library. - internal CapacityModeChangeTransitionState(CapacityModeTransitionStatus? capacityModeTransitionStatus, CapacityMode? currentCapacityMode, CapacityMode? previousCapacityMode, DateTimeOffset? capacityModeTransitionBeginTimestamp, DateTimeOffset? capacityModeTransitionEndTimestamp, DateTimeOffset? capacityModeLastSuccessfulTransitionEndTimestamp, IDictionary serializedAdditionalRawData) - { - CapacityModeTransitionStatus = capacityModeTransitionStatus; - CurrentCapacityMode = currentCapacityMode; - PreviousCapacityMode = previousCapacityMode; - CapacityModeTransitionBeginTimestamp = capacityModeTransitionBeginTimestamp; - CapacityModeTransitionEndTimestamp = capacityModeTransitionEndTimestamp; - CapacityModeLastSuccessfulTransitionEndTimestamp = capacityModeLastSuccessfulTransitionEndTimestamp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The transition status of capacity mode. - [WirePath("capacityModeTransitionStatus")] - public CapacityModeTransitionStatus? CapacityModeTransitionStatus { get; set; } - /// Indicates the current capacity mode of the account. - [WirePath("currentCapacityMode")] - public CapacityMode? CurrentCapacityMode { get; set; } - /// Indicates the previous capacity mode of the account before successful transition. - [WirePath("previousCapacityMode")] - public CapacityMode? PreviousCapacityMode { get; set; } - /// Begin time in UTC of the capacity mode change. - [WirePath("capacityModeTransitionBeginTimestamp")] - public DateTimeOffset? CapacityModeTransitionBeginTimestamp { get; } - /// End time in UTC of the capacity mode change. - [WirePath("capacityModeTransitionEndTimestamp")] - public DateTimeOffset? CapacityModeTransitionEndTimestamp { get; } - /// End time in UTC of the last successful capacity mode change. - [WirePath("capacityModeLastSuccessfulTransitionEndTimestamp")] - public DateTimeOffset? CapacityModeLastSuccessfulTransitionEndTimestamp { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeTransitionStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeTransitionStatus.cs deleted file mode 100644 index ce09601aeb62..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeTransitionStatus.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The transition status of capacity mode. - public readonly partial struct CapacityModeTransitionStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CapacityModeTransitionStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InvalidValue = "Invalid"; - private const string InitializedValue = "Initialized"; - private const string InProgressValue = "InProgress"; - private const string CompletedValue = "Completed"; - private const string FailedValue = "Failed"; - - /// Invalid. - public static CapacityModeTransitionStatus Invalid { get; } = new CapacityModeTransitionStatus(InvalidValue); - /// Initialized. - public static CapacityModeTransitionStatus Initialized { get; } = new CapacityModeTransitionStatus(InitializedValue); - /// InProgress. - public static CapacityModeTransitionStatus InProgress { get; } = new CapacityModeTransitionStatus(InProgressValue); - /// Completed. - public static CapacityModeTransitionStatus Completed { get; } = new CapacityModeTransitionStatus(CompletedValue); - /// Failed. - public static CapacityModeTransitionStatus Failed { get; } = new CapacityModeTransitionStatus(FailedValue); - /// Determines if two values are the same. - public static bool operator ==(CapacityModeTransitionStatus left, CapacityModeTransitionStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CapacityModeTransitionStatus left, CapacityModeTransitionStatus right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CapacityModeTransitionStatus(string value) => new CapacityModeTransitionStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CapacityModeTransitionStatus other && Equals(other); - /// - public bool Equals(CapacityModeTransitionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAutoReplicateForm.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAutoReplicateForm.cs deleted file mode 100644 index 0ac79482e873..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAutoReplicateForm.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The form of AutoReplicate that is being used by this cluster. - public readonly partial struct CassandraAutoReplicateForm : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CassandraAutoReplicateForm(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string SystemKeyspacesValue = "SystemKeyspaces"; - private const string AllKeyspacesValue = "AllKeyspaces"; - - /// None. - public static CassandraAutoReplicateForm None { get; } = new CassandraAutoReplicateForm(NoneValue); - /// SystemKeyspaces. - public static CassandraAutoReplicateForm SystemKeyspaces { get; } = new CassandraAutoReplicateForm(SystemKeyspacesValue); - /// AllKeyspaces. - public static CassandraAutoReplicateForm AllKeyspaces { get; } = new CassandraAutoReplicateForm(AllKeyspacesValue); - /// Determines if two values are the same. - public static bool operator ==(CassandraAutoReplicateForm left, CassandraAutoReplicateForm right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CassandraAutoReplicateForm left, CassandraAutoReplicateForm right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CassandraAutoReplicateForm(string value) => new CassandraAutoReplicateForm(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CassandraAutoReplicateForm other && Equals(other); - /// - public bool Equals(CassandraAutoReplicateForm other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs deleted file mode 100644 index 489e7af72aaf..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraClusterBackupResourceInfo : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(BackupId)) - { - writer.WritePropertyName("backupId"u8); - writer.WriteStringValue(BackupId); - } - if (Optional.IsDefined(BackupState)) - { - writer.WritePropertyName("backupState"u8); - writer.WriteStringValue(BackupState.Value.ToString()); - } - if (Optional.IsDefined(BackupStartTimestamp)) - { - writer.WritePropertyName("backupStartTimestamp"u8); - writer.WriteStringValue(BackupStartTimestamp.Value, "O"); - } - if (Optional.IsDefined(BackupStopTimestamp)) - { - writer.WritePropertyName("backupStopTimestamp"u8); - writer.WriteStringValue(BackupStopTimestamp.Value, "O"); - } - if (Optional.IsDefined(BackupExpiryTimestamp)) - { - writer.WritePropertyName("backupExpiryTimestamp"u8); - writer.WriteStringValue(BackupExpiryTimestamp.Value, "O"); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - CassandraClusterBackupResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraClusterBackupResourceInfo(document.RootElement, options); - } - - internal static CassandraClusterBackupResourceInfo DeserializeCassandraClusterBackupResourceInfo(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string backupId = default; - CassandraClusterBackupState? backupState = default; - DateTimeOffset? backupStartTimestamp = default; - DateTimeOffset? backupStopTimestamp = default; - DateTimeOffset? backupExpiryTimestamp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("backupId"u8)) - { - backupId = property.Value.GetString(); - continue; - } - if (property.NameEquals("backupState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backupState = new CassandraClusterBackupState(property.Value.GetString()); - continue; - } - if (property.NameEquals("backupStartTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backupStartTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("backupStopTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backupStopTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("backupExpiryTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backupExpiryTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraClusterBackupResourceInfo( - backupId, - backupState, - backupStartTimestamp, - backupStopTimestamp, - backupExpiryTimestamp, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupId)) - { - builder.Append(" backupId: "); - if (BackupId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{BackupId}'''"); - } - else - { - builder.AppendLine($"'{BackupId}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupState)) - { - builder.Append(" backupState: "); - builder.AppendLine($"'{BackupState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupStartTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupStartTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupStartTimestamp)) - { - builder.Append(" backupStartTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(BackupStartTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupStopTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupStopTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupStopTimestamp)) - { - builder.Append(" backupStopTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(BackupStopTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupExpiryTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupExpiryTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupExpiryTimestamp)) - { - builder.Append(" backupExpiryTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(BackupExpiryTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support writing '{options.Format}' format."); - } - } - - CassandraClusterBackupResourceInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCassandraClusterBackupResourceInfo(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.cs deleted file mode 100644 index 2fb86f9304e3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A restorable backup of a Cassandra cluster. - public partial class CassandraClusterBackupResourceInfo - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal CassandraClusterBackupResourceInfo() - { - } - - /// Initializes a new instance of . - /// The unique identifier of backup. - /// The current state of the backup. - /// The time at which the backup process begins. - /// The time at which the backup process ends. - /// The time at which the backup will expire. - /// Keeps track of any properties unknown to the library. - internal CassandraClusterBackupResourceInfo(string backupId, CassandraClusterBackupState? backupState, DateTimeOffset? backupStartTimestamp, DateTimeOffset? backupStopTimestamp, DateTimeOffset? backupExpiryTimestamp, IDictionary serializedAdditionalRawData) - { - BackupId = backupId; - BackupState = backupState; - BackupStartTimestamp = backupStartTimestamp; - BackupStopTimestamp = backupStopTimestamp; - BackupExpiryTimestamp = backupExpiryTimestamp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The unique identifier of backup. - [WirePath("backupId")] - public string BackupId { get; } - /// The current state of the backup. - [WirePath("backupState")] - public CassandraClusterBackupState? BackupState { get; } - /// The time at which the backup process begins. - [WirePath("backupStartTimestamp")] - public DateTimeOffset? BackupStartTimestamp { get; } - /// The time at which the backup process ends. - [WirePath("backupStopTimestamp")] - public DateTimeOffset? BackupStopTimestamp { get; } - /// The time at which the backup will expire. - [WirePath("backupExpiryTimestamp")] - public DateTimeOffset? BackupExpiryTimestamp { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs deleted file mode 100644 index 00e115267367..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraClusterBackupSchedule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(ScheduleName)) - { - writer.WritePropertyName("scheduleName"u8); - writer.WriteStringValue(ScheduleName); - } - if (Optional.IsDefined(CronExpression)) - { - writer.WritePropertyName("cronExpression"u8); - writer.WriteStringValue(CronExpression); - } - if (Optional.IsDefined(RetentionInHours)) - { - writer.WritePropertyName("retentionInHours"u8); - writer.WriteNumberValue(RetentionInHours.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - CassandraClusterBackupSchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraClusterBackupSchedule(document.RootElement, options); - } - - internal static CassandraClusterBackupSchedule DeserializeCassandraClusterBackupSchedule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string scheduleName = default; - string cronExpression = default; - int? retentionInHours = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("scheduleName"u8)) - { - scheduleName = property.Value.GetString(); - continue; - } - if (property.NameEquals("cronExpression"u8)) - { - cronExpression = property.Value.GetString(); - continue; - } - if (property.NameEquals("retentionInHours"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - retentionInHours = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraClusterBackupSchedule(scheduleName, cronExpression, retentionInHours, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScheduleName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" scheduleName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ScheduleName)) - { - builder.Append(" scheduleName: "); - if (ScheduleName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ScheduleName}'''"); - } - else - { - builder.AppendLine($"'{ScheduleName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CronExpression), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" cronExpression: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CronExpression)) - { - builder.Append(" cronExpression: "); - if (CronExpression.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{CronExpression}'''"); - } - else - { - builder.AppendLine($"'{CronExpression}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RetentionInHours), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" retentionInHours: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RetentionInHours)) - { - builder.Append(" retentionInHours: "); - builder.AppendLine($"{RetentionInHours.Value}"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support writing '{options.Format}' format."); - } - } - - CassandraClusterBackupSchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCassandraClusterBackupSchedule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.cs deleted file mode 100644 index 82a98b5c58dc..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The CassandraClusterBackupSchedule. - public partial class CassandraClusterBackupSchedule - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CassandraClusterBackupSchedule() - { - } - - /// Initializes a new instance of . - /// The unique identifier of backup schedule. - /// The cron expression that defines when you want to back up your data. - /// The retention period (hours) of the backups. If you want to retain data forever, set retention to 0. - /// Keeps track of any properties unknown to the library. - internal CassandraClusterBackupSchedule(string scheduleName, string cronExpression, int? retentionInHours, IDictionary serializedAdditionalRawData) - { - ScheduleName = scheduleName; - CronExpression = cronExpression; - RetentionInHours = retentionInHours; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The unique identifier of backup schedule. - [WirePath("scheduleName")] - public string ScheduleName { get; set; } - /// The cron expression that defines when you want to back up your data. - [WirePath("cronExpression")] - public string CronExpression { get; set; } - /// The retention period (hours) of the backups. If you want to retain data forever, set retention to 0. - [WirePath("retentionInHours")] - public int? RetentionInHours { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupState.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupState.cs deleted file mode 100644 index e16cccd059f7..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupState.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The current state of the backup. - public readonly partial struct CassandraClusterBackupState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CassandraClusterBackupState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InitiatedValue = "Initiated"; - private const string InProgressValue = "InProgress"; - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - - /// Initiated. - public static CassandraClusterBackupState Initiated { get; } = new CassandraClusterBackupState(InitiatedValue); - /// InProgress. - public static CassandraClusterBackupState InProgress { get; } = new CassandraClusterBackupState(InProgressValue); - /// Succeeded. - public static CassandraClusterBackupState Succeeded { get; } = new CassandraClusterBackupState(SucceededValue); - /// Failed. - public static CassandraClusterBackupState Failed { get; } = new CassandraClusterBackupState(FailedValue); - /// Determines if two values are the same. - public static bool operator ==(CassandraClusterBackupState left, CassandraClusterBackupState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CassandraClusterBackupState left, CassandraClusterBackupState right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CassandraClusterBackupState(string value) => new CassandraClusterBackupState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CassandraClusterBackupState other && Equals(other); - /// - public bool Equals(CassandraClusterBackupState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs deleted file mode 100644 index af27a13b565b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs +++ /dev/null @@ -1,477 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraClusterCommand : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Command)) - { - writer.WritePropertyName("command"u8); - writer.WriteStringValue(Command); - } - if (Optional.IsDefined(CommandId)) - { - writer.WritePropertyName("commandId"u8); - writer.WriteStringValue(CommandId); - } - if (Optional.IsDefined(Arguments)) - { - writer.WritePropertyName("arguments"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Arguments); -#else - using (JsonDocument document = JsonDocument.Parse(Arguments, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - if (Optional.IsDefined(Host)) - { - writer.WritePropertyName("host"u8); - writer.WriteStringValue(Host); - } - if (Optional.IsDefined(IsAdmin)) - { - writer.WritePropertyName("isAdmin"u8); - writer.WriteBooleanValue(IsAdmin.Value); - } - if (Optional.IsDefined(ShouldStopCassandraBeforeStart)) - { - writer.WritePropertyName("cassandraStopStart"u8); - writer.WriteBooleanValue(ShouldStopCassandraBeforeStart.Value); - } - if (Optional.IsDefined(IsReadWrite)) - { - writer.WritePropertyName("readWrite"u8); - writer.WriteBooleanValue(IsReadWrite.Value); - } - if (Optional.IsDefined(Result)) - { - writer.WritePropertyName("result"u8); - writer.WriteStringValue(Result); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (Optional.IsDefined(OutputFile)) - { - writer.WritePropertyName("outputFile"u8); - writer.WriteStringValue(OutputFile); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - CassandraClusterCommand IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraClusterCommand(document.RootElement, options); - } - - internal static CassandraClusterCommand DeserializeCassandraClusterCommand(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string command = default; - string commandId = default; - BinaryData arguments = default; - string host = default; - bool? isAdmin = default; - bool? cassandraStopStart = default; - bool? readWrite = default; - string result = default; - CassandraClusterCommandStatus? status = default; - string outputFile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("command"u8)) - { - command = property.Value.GetString(); - continue; - } - if (property.NameEquals("commandId"u8)) - { - commandId = property.Value.GetString(); - continue; - } - if (property.NameEquals("arguments"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - arguments = BinaryData.FromString(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("host"u8)) - { - host = property.Value.GetString(); - continue; - } - if (property.NameEquals("isAdmin"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isAdmin = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("cassandraStopStart"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - cassandraStopStart = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("readWrite"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - readWrite = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("result"u8)) - { - result = property.Value.GetString(); - continue; - } - if (property.NameEquals("status"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - status = new CassandraClusterCommandStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("outputFile"u8)) - { - outputFile = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraClusterCommand( - command, - commandId, - arguments, - host, - isAdmin, - cassandraStopStart, - readWrite, - result, - status, - outputFile, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Command), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" command: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Command)) - { - builder.Append(" command: "); - if (Command.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Command}'''"); - } - else - { - builder.AppendLine($"'{Command}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CommandId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" commandId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CommandId)) - { - builder.Append(" commandId: "); - if (CommandId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{CommandId}'''"); - } - else - { - builder.AppendLine($"'{CommandId}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Arguments), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" arguments: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Arguments)) - { - builder.Append(" arguments: "); - builder.AppendLine($"'{Arguments.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Host), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" host: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Host)) - { - builder.Append(" host: "); - if (Host.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Host}'''"); - } - else - { - builder.AppendLine($"'{Host}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsAdmin), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" isAdmin: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(IsAdmin)) - { - builder.Append(" isAdmin: "); - var boolValue = IsAdmin.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ShouldStopCassandraBeforeStart), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" cassandraStopStart: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ShouldStopCassandraBeforeStart)) - { - builder.Append(" cassandraStopStart: "); - var boolValue = ShouldStopCassandraBeforeStart.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsReadWrite), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" readWrite: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(IsReadWrite)) - { - builder.Append(" readWrite: "); - var boolValue = IsReadWrite.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Result), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" result: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Result)) - { - builder.Append(" result: "); - if (Result.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Result}'''"); - } - else - { - builder.AppendLine($"'{Result}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" status: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Status)) - { - builder.Append(" status: "); - builder.AppendLine($"'{Status.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OutputFile), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" outputFile: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(OutputFile)) - { - builder.Append(" outputFile: "); - if (OutputFile.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{OutputFile}'''"); - } - else - { - builder.AppendLine($"'{OutputFile}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support writing '{options.Format}' format."); - } - } - - CassandraClusterCommand IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCassandraClusterCommand(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.cs deleted file mode 100644 index 698500131c28..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.cs +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// resource representing a command. - public partial class CassandraClusterCommand - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal CassandraClusterCommand() - { - } - - /// Initializes a new instance of . - /// The command which should be run. - /// The unique id of command. - /// The arguments for the command to be run. - /// IP address of the cassandra host to run the command on. - /// Whether command has admin privileges. - /// If true, stops cassandra before executing the command and then start it again. - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. - /// Result output of the command. - /// Status of the command. - /// The name of the file where the result is written. - /// Keeps track of any properties unknown to the library. - internal CassandraClusterCommand(string command, string commandId, BinaryData arguments, string host, bool? isAdmin, bool? shouldStopCassandraBeforeStart, bool? isReadWrite, string result, CassandraClusterCommandStatus? status, string outputFile, IDictionary serializedAdditionalRawData) - { - Command = command; - CommandId = commandId; - Arguments = arguments; - Host = host; - IsAdmin = isAdmin; - ShouldStopCassandraBeforeStart = shouldStopCassandraBeforeStart; - IsReadWrite = isReadWrite; - Result = result; - Status = status; - OutputFile = outputFile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The command which should be run. - [WirePath("command")] - public string Command { get; } - /// The unique id of command. - [WirePath("commandId")] - public string CommandId { get; } - /// - /// The arguments for the command to be run - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - [WirePath("arguments")] - public BinaryData Arguments { get; } - /// IP address of the cassandra host to run the command on. - [WirePath("host")] - public string Host { get; } - /// Whether command has admin privileges. - [WirePath("isAdmin")] - public bool? IsAdmin { get; } - /// If true, stops cassandra before executing the command and then start it again. - [WirePath("cassandraStopStart")] - public bool? ShouldStopCassandraBeforeStart { get; } - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. - [WirePath("readWrite")] - public bool? IsReadWrite { get; } - /// Result output of the command. - [WirePath("result")] - public string Result { get; } - /// Status of the command. - [WirePath("status")] - public CassandraClusterCommandStatus? Status { get; } - /// The name of the file where the result is written. - [WirePath("outputFile")] - public string OutputFile { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommandStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommandStatus.cs deleted file mode 100644 index 18d1f271a6f3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommandStatus.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Status of the command. - public readonly partial struct CassandraClusterCommandStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CassandraClusterCommandStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DoneValue = "Done"; - private const string RunningValue = "Running"; - private const string EnqueueValue = "Enqueue"; - private const string ProcessingValue = "Processing"; - private const string FinishedValue = "Finished"; - private const string FailedValue = "Failed"; - - /// Done. - public static CassandraClusterCommandStatus Done { get; } = new CassandraClusterCommandStatus(DoneValue); - /// Running. - public static CassandraClusterCommandStatus Running { get; } = new CassandraClusterCommandStatus(RunningValue); - /// Enqueue. - public static CassandraClusterCommandStatus Enqueue { get; } = new CassandraClusterCommandStatus(EnqueueValue); - /// Processing. - public static CassandraClusterCommandStatus Processing { get; } = new CassandraClusterCommandStatus(ProcessingValue); - /// Finished. - public static CassandraClusterCommandStatus Finished { get; } = new CassandraClusterCommandStatus(FinishedValue); - /// Failed. - public static CassandraClusterCommandStatus Failed { get; } = new CassandraClusterCommandStatus(FailedValue); - /// Determines if two values are the same. - public static bool operator ==(CassandraClusterCommandStatus left, CassandraClusterCommandStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CassandraClusterCommandStatus left, CassandraClusterCommandStatus right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CassandraClusterCommandStatus(string value) => new CassandraClusterCommandStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CassandraClusterCommandStatus other && Equals(other); - /// - public bool Equals(CassandraClusterCommandStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs index 2b3fa6e875fa..6ccf5e874144 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs @@ -126,11 +126,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("cpuUsage"u8); writer.WriteNumberValue(CpuUsage.Value); } - if (Optional.IsDefined(IsLatestModel)) - { - writer.WritePropertyName("isLatestModel"u8); - writer.WriteBooleanValue(IsLatestModel.Value); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -185,7 +180,6 @@ internal static CassandraClusterDataCenterNodeItem DeserializeCassandraClusterDa long? memoryFreeKB = default; long? memoryTotalKB = default; double? cpuUsage = default; - bool? isLatestModel = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -324,15 +318,6 @@ internal static CassandraClusterDataCenterNodeItem DeserializeCassandraClusterDa cpuUsage = property.Value.GetDouble(); continue; } - if (property.NameEquals("isLatestModel"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isLatestModel = property.Value.GetBoolean(); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -357,7 +342,6 @@ internal static CassandraClusterDataCenterNodeItem DeserializeCassandraClusterDa memoryFreeKB, memoryTotalKB, cpuUsage, - isLatestModel, serializedAdditionalRawData); } @@ -696,22 +680,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsLatestModel), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" isLatestModel: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(IsLatestModel)) - { - builder.Append(" isLatestModel: "); - var boolValue = IsLatestModel.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs index dba03dd08080..3932357b3057 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs @@ -69,9 +69,8 @@ internal CassandraClusterDataCenterNodeItem() /// Unused memory (MemFree and SwapFree in /proc/meminfo), in kB. /// Total installed memory (MemTotal and SwapTotal in /proc/meminfo), in kB. /// A float representing the current system-wide CPU utilization as a percentage. - /// If node has been updated to latest model. /// Keeps track of any properties unknown to the library. - internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? state, string status, string cassandraProcessStatus, string load, IReadOnlyList tokens, int? size, Guid? hostId, string rack, string timestamp, long? diskUsedKB, long? diskFreeKB, long? memoryUsedKB, long? memoryBuffersAndCachedKB, long? memoryFreeKB, long? memoryTotalKB, double? cpuUsage, bool? isLatestModel, IDictionary serializedAdditionalRawData) + internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? state, string status, string cassandraProcessStatus, string load, IReadOnlyList tokens, int? size, Guid? hostId, string rack, string timestamp, long? diskUsedKB, long? diskFreeKB, long? memoryUsedKB, long? memoryBuffersAndCachedKB, long? memoryFreeKB, long? memoryTotalKB, double? cpuUsage, IDictionary serializedAdditionalRawData) { Address = address; State = state; @@ -90,7 +89,6 @@ internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? MemoryFreeKB = memoryFreeKB; MemoryTotalKB = memoryTotalKB; CpuUsage = cpuUsage; - IsLatestModel = isLatestModel; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -145,8 +143,5 @@ internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? /// A float representing the current system-wide CPU utilization as a percentage. [WirePath("cpuUsage")] public double? CpuUsage { get; } - /// If node has been updated to latest model. - [WirePath("isLatestModel")] - public bool? IsLatestModel { get; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs index d05fa61eabca..9391df37f494 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs @@ -81,11 +81,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("repairEnabled"u8); writer.WriteBooleanValue(IsRepairEnabled.Value); } - if (Optional.IsDefined(AutoReplicate)) - { - writer.WritePropertyName("autoReplicate"u8); - writer.WriteStringValue(AutoReplicate.Value.ToString()); - } if (Optional.IsCollectionDefined(ClientCertificates)) { writer.WritePropertyName("clientCertificates"u8); @@ -136,16 +131,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } - if (Optional.IsCollectionDefined(ExternalDataCenters)) - { - writer.WritePropertyName("externalDataCenters"u8); - writer.WriteStartArray(); - foreach (var item in ExternalDataCenters) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } if (Optional.IsDefined(HoursBetweenBackups)) { writer.WritePropertyName("hoursBetweenBackups"u8); @@ -161,41 +146,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("cassandraAuditLoggingEnabled"u8); writer.WriteBooleanValue(IsCassandraAuditLoggingEnabled.Value); } - if (Optional.IsDefined(ClusterType)) - { - writer.WritePropertyName("clusterType"u8); - writer.WriteStringValue(ClusterType.Value.ToString()); - } if (Optional.IsDefined(ProvisionError)) { writer.WritePropertyName("provisionError"u8); writer.WriteObjectValue(ProvisionError, options); } - if (Optional.IsCollectionDefined(Extensions)) - { - writer.WritePropertyName("extensions"u8); - writer.WriteStartArray(); - foreach (var item in Extensions) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(BackupSchedules)) - { - writer.WritePropertyName("backupSchedules"u8); - writer.WriteStartArray(); - foreach (var item in BackupSchedules) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ScheduledEventStrategy)) - { - writer.WritePropertyName("scheduledEventStrategy"u8); - writer.WriteStringValue(ScheduledEventStrategy.Value.ToString()); - } if (Optional.IsDefined(AzureConnectionMethod)) { writer.WritePropertyName("azureConnectionMethod"u8); @@ -252,21 +207,15 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties string initialCassandraAdminPassword = default; CassandraDataCenterSeedNode prometheusEndpoint = default; bool? repairEnabled = default; - CassandraAutoReplicateForm? autoReplicate = default; IList clientCertificates = default; IList externalGossipCertificates = default; IReadOnlyList gossipCertificates = default; IList externalSeedNodes = default; IReadOnlyList seedNodes = default; - IList externalDataCenters = default; int? hoursBetweenBackups = default; bool? deallocated = default; bool? cassandraAuditLoggingEnabled = default; - CassandraClusterType? clusterType = default; CassandraError provisionError = default; - IList extensions = default; - IList backupSchedules = default; - ScheduledEventStrategy? scheduledEventStrategy = default; ServiceConnectionType? azureConnectionMethod = default; ResourceIdentifier privateLinkResourceId = default; IDictionary serializedAdditionalRawData = default; @@ -338,15 +287,6 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties repairEnabled = property.Value.GetBoolean(); continue; } - if (property.NameEquals("autoReplicate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoReplicate = new CassandraAutoReplicateForm(property.Value.GetString()); - continue; - } if (property.NameEquals("clientCertificates"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -417,20 +357,6 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties seedNodes = array; continue; } - if (property.NameEquals("externalDataCenters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - externalDataCenters = array; - continue; - } if (property.NameEquals("hoursBetweenBackups"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -458,15 +384,6 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties cassandraAuditLoggingEnabled = property.Value.GetBoolean(); continue; } - if (property.NameEquals("clusterType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - clusterType = new CassandraClusterType(property.Value.GetString()); - continue; - } if (property.NameEquals("provisionError"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -476,43 +393,6 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties provisionError = CassandraError.DeserializeCassandraError(property.Value, options); continue; } - if (property.NameEquals("extensions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - extensions = array; - continue; - } - if (property.NameEquals("backupSchedules"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CassandraClusterBackupSchedule.DeserializeCassandraClusterBackupSchedule(item, options)); - } - backupSchedules = array; - continue; - } - if (property.NameEquals("scheduledEventStrategy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scheduledEventStrategy = new ScheduledEventStrategy(property.Value.GetString()); - continue; - } if (property.NameEquals("azureConnectionMethod"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -547,21 +427,15 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties initialCassandraAdminPassword, prometheusEndpoint, repairEnabled, - autoReplicate, clientCertificates ?? new ChangeTrackingList(), externalGossipCertificates ?? new ChangeTrackingList(), gossipCertificates ?? new ChangeTrackingList(), externalSeedNodes ?? new ChangeTrackingList(), seedNodes ?? new ChangeTrackingList(), - externalDataCenters ?? new ChangeTrackingList(), hoursBetweenBackups, deallocated, cassandraAuditLoggingEnabled, - clusterType, provisionError, - extensions ?? new ChangeTrackingList(), - backupSchedules ?? new ChangeTrackingList(), - scheduledEventStrategy, azureConnectionMethod, privateLinkResourceId, serializedAdditionalRawData); @@ -749,21 +623,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AutoReplicate), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" autoReplicate: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AutoReplicate)) - { - builder.Append(" autoReplicate: "); - builder.AppendLine($"'{AutoReplicate.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClientCertificates), out propertyOverride); if (hasPropertyOverride) { @@ -879,42 +738,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExternalDataCenters), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" externalDataCenters: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(ExternalDataCenters)) - { - if (ExternalDataCenters.Any()) - { - builder.Append(" externalDataCenters: "); - builder.AppendLine("["); - foreach (var item in ExternalDataCenters) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HoursBetweenBackups), out propertyOverride); if (hasPropertyOverride) { @@ -962,21 +785,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClusterType), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" clusterType: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ClusterType)) - { - builder.Append(" clusterType: "); - builder.AppendLine($"'{ClusterType.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisionError), out propertyOverride); if (hasPropertyOverride) { @@ -992,80 +800,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Extensions), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" extensions: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Extensions)) - { - if (Extensions.Any()) - { - builder.Append(" extensions: "); - builder.AppendLine("["); - foreach (var item in Extensions) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupSchedules), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupSchedules: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(BackupSchedules)) - { - if (BackupSchedules.Any()) - { - builder.Append(" backupSchedules: "); - builder.AppendLine("["); - foreach (var item in BackupSchedules) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " backupSchedules: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScheduledEventStrategy), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" scheduledEventStrategy: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ScheduledEventStrategy)) - { - builder.Append(" scheduledEventStrategy: "); - builder.AppendLine($"'{ScheduledEventStrategy.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AzureConnectionMethod), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs index ee65e9f38870..75291438ae06 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs @@ -54,9 +54,6 @@ public CassandraClusterProperties() GossipCertificates = new ChangeTrackingList(); ExternalSeedNodes = new ChangeTrackingList(); SeedNodes = new ChangeTrackingList(); - ExternalDataCenters = new ChangeTrackingList(); - Extensions = new ChangeTrackingList(); - BackupSchedules = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -69,25 +66,19 @@ public CassandraClusterProperties() /// Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null on GET. This field only applies when the authenticationMethod field is 'Cassandra'. /// Hostname or IP address where the Prometheus endpoint containing data about the managed Cassandra nodes can be reached. /// Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. - /// The form of AutoReplicate that is being used by this cluster. /// List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more of the public certificates in this property. /// List of TLS certificates used to authorize gossip from unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be verifiable using one of the certificates provided in this property. /// List of TLS certificates that unmanaged nodes must trust for gossip with managed nodes. All managed nodes will present TLS client certificates that are verifiable using one of the certificates provided in this property. /// List of IP addresses of seed nodes in unmanaged data centers. These will be added to the seed node lists of all managed nodes. /// List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. - /// List of the data center names for unmanaged data centers in this cluster to be included in auto-replication. /// (Deprecated) Number of hours to wait between taking a backup of the cluster. /// Whether the cluster and associated data centers has been deallocated. /// Whether Cassandra audit logging is enabled. - /// Type of the cluster. If set to Production, some operations might not be permitted on cluster. /// Error related to resource provisioning. - /// Extensions to be added or updated on cluster. - /// List of backup schedules that define when you want to back up your data. - /// How the nodes in the cluster react to scheduled events. /// How to connect to the azure services needed for running the cluster. - /// If the Connection Method is Vpn, this is the Id of the private link resource that the datacenters need to connect to. + /// If the Connection Method is VPN, this is the Id of the private link resource that the datacenters need to connect to. /// Keeps track of any properties unknown to the library. - internal CassandraClusterProperties(CassandraProvisioningState? provisioningState, string restoreFromBackupId, ResourceIdentifier delegatedManagementSubnetId, string cassandraVersion, string clusterNameOverride, CassandraAuthenticationMethod? authenticationMethod, string initialCassandraAdminPassword, CassandraDataCenterSeedNode prometheusEndpoint, bool? isRepairEnabled, CassandraAutoReplicateForm? autoReplicate, IList clientCertificates, IList externalGossipCertificates, IReadOnlyList gossipCertificates, IList externalSeedNodes, IReadOnlyList seedNodes, IList externalDataCenters, int? hoursBetweenBackups, bool? isDeallocated, bool? isCassandraAuditLoggingEnabled, CassandraClusterType? clusterType, CassandraError provisionError, IList extensions, IList backupSchedules, ScheduledEventStrategy? scheduledEventStrategy, ServiceConnectionType? azureConnectionMethod, ResourceIdentifier privateLinkResourceId, IDictionary serializedAdditionalRawData) + internal CassandraClusterProperties(CassandraProvisioningState? provisioningState, string restoreFromBackupId, ResourceIdentifier delegatedManagementSubnetId, string cassandraVersion, string clusterNameOverride, CassandraAuthenticationMethod? authenticationMethod, string initialCassandraAdminPassword, CassandraDataCenterSeedNode prometheusEndpoint, bool? isRepairEnabled, IList clientCertificates, IList externalGossipCertificates, IReadOnlyList gossipCertificates, IList externalSeedNodes, IReadOnlyList seedNodes, int? hoursBetweenBackups, bool? isDeallocated, bool? isCassandraAuditLoggingEnabled, CassandraError provisionError, ServiceConnectionType? azureConnectionMethod, ResourceIdentifier privateLinkResourceId, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; RestoreFromBackupId = restoreFromBackupId; @@ -98,21 +89,15 @@ internal CassandraClusterProperties(CassandraProvisioningState? provisioningStat InitialCassandraAdminPassword = initialCassandraAdminPassword; PrometheusEndpoint = prometheusEndpoint; IsRepairEnabled = isRepairEnabled; - AutoReplicate = autoReplicate; ClientCertificates = clientCertificates; ExternalGossipCertificates = externalGossipCertificates; GossipCertificates = gossipCertificates; ExternalSeedNodes = externalSeedNodes; SeedNodes = seedNodes; - ExternalDataCenters = externalDataCenters; HoursBetweenBackups = hoursBetweenBackups; IsDeallocated = isDeallocated; IsCassandraAuditLoggingEnabled = isCassandraAuditLoggingEnabled; - ClusterType = clusterType; ProvisionError = provisionError; - Extensions = extensions; - BackupSchedules = backupSchedules; - ScheduledEventStrategy = scheduledEventStrategy; AzureConnectionMethod = azureConnectionMethod; PrivateLinkResourceId = privateLinkResourceId; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -157,9 +142,6 @@ public string PrometheusEndpointIPAddress /// Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. [WirePath("repairEnabled")] public bool? IsRepairEnabled { get; set; } - /// The form of AutoReplicate that is being used by this cluster. - [WirePath("autoReplicate")] - public CassandraAutoReplicateForm? AutoReplicate { get; set; } /// List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more of the public certificates in this property. [WirePath("clientCertificates")] public IList ClientCertificates { get; } @@ -175,9 +157,6 @@ public string PrometheusEndpointIPAddress /// List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. [WirePath("seedNodes")] public IReadOnlyList SeedNodes { get; } - /// List of the data center names for unmanaged data centers in this cluster to be included in auto-replication. - [WirePath("externalDataCenters")] - public IList ExternalDataCenters { get; } /// (Deprecated) Number of hours to wait between taking a backup of the cluster. [WirePath("hoursBetweenBackups")] public int? HoursBetweenBackups { get; set; } @@ -187,25 +166,13 @@ public string PrometheusEndpointIPAddress /// Whether Cassandra audit logging is enabled. [WirePath("cassandraAuditLoggingEnabled")] public bool? IsCassandraAuditLoggingEnabled { get; set; } - /// Type of the cluster. If set to Production, some operations might not be permitted on cluster. - [WirePath("clusterType")] - public CassandraClusterType? ClusterType { get; set; } /// Error related to resource provisioning. [WirePath("provisionError")] public CassandraError ProvisionError { get; set; } - /// Extensions to be added or updated on cluster. - [WirePath("extensions")] - public IList Extensions { get; } - /// List of backup schedules that define when you want to back up your data. - [WirePath("backupSchedules")] - public IList BackupSchedules { get; } - /// How the nodes in the cluster react to scheduled events. - [WirePath("scheduledEventStrategy")] - public ScheduledEventStrategy? ScheduledEventStrategy { get; set; } /// How to connect to the azure services needed for running the cluster. [WirePath("azureConnectionMethod")] public ServiceConnectionType? AzureConnectionMethod { get; set; } - /// If the Connection Method is Vpn, this is the Id of the private link resource that the datacenters need to connect to. + /// If the Connection Method is VPN, this is the Id of the private link resource that the datacenters need to connect to. [WirePath("privateLinkResourceId")] public ResourceIdentifier PrivateLinkResourceId { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterType.cs deleted file mode 100644 index 08dbc03f6414..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Type of the cluster. If set to Production, some operations might not be permitted on cluster. - public readonly partial struct CassandraClusterType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CassandraClusterType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ProductionValue = "Production"; - private const string NonProductionValue = "NonProduction"; - - /// Production. - public static CassandraClusterType Production { get; } = new CassandraClusterType(ProductionValue); - /// NonProduction. - public static CassandraClusterType NonProduction { get; } = new CassandraClusterType(NonProductionValue); - /// Determines if two values are the same. - public static bool operator ==(CassandraClusterType left, CassandraClusterType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CassandraClusterType left, CassandraClusterType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CassandraClusterType(string value) => new CassandraClusterType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CassandraClusterType other && Equals(other); - /// - public bool Equals(CassandraClusterType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs index 56287a9af13e..22a384cee39b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -76,7 +70,6 @@ internal static CassandraKeyspaceCreateOrUpdateContent DeserializeCassandraKeysp { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -89,16 +82,6 @@ internal static CassandraKeyspaceCreateOrUpdateContent DeserializeCassandraKeysp Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,7 +166,6 @@ internal static CassandraKeyspaceCreateOrUpdateContent DeserializeCassandraKeysp location, resource, options0, - identity, serializedAdditionalRawData); } @@ -270,21 +252,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.cs index 6820de815f52..b76fc6bec344 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CassandraKeyspaceCreateOrUpdateContent(AzureLocation location, CassandraK /// The location. /// The standard JSON format of a Cassandra keyspace. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CassandraKeyspaceCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraKeyspaceResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CassandraKeyspaceCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraKeyspaceResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -95,8 +93,5 @@ public string ResourceKeyspaceName /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs index 8db83cfd8549..978ddaa7bdf7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -76,7 +70,6 @@ internal static CassandraTableCreateOrUpdateContent DeserializeCassandraTableCre { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -89,16 +82,6 @@ internal static CassandraTableCreateOrUpdateContent DeserializeCassandraTableCre Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,7 +166,6 @@ internal static CassandraTableCreateOrUpdateContent DeserializeCassandraTableCre location, resource, options0, - identity, serializedAdditionalRawData); } @@ -270,21 +252,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.cs index 2605da0abfae..5235cd0d4f83 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CassandraTableCreateOrUpdateContent(AzureLocation location, CassandraTabl /// The location. /// The standard JSON format of a Cassandra table. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CassandraTableCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraTableResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CassandraTableCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraTableResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CassandraTableCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs deleted file mode 100644 index 5ba4ddcf2f10..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraViewGetPropertiesOptions : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - CassandraViewGetPropertiesOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewGetPropertiesOptions(document.RootElement, options); - } - - internal static CassandraViewGetPropertiesOptions DeserializeCassandraViewGetPropertiesOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? throughput = default; - AutoscaleSettings autoscaleSettings = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("throughput"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - throughput = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("autoscaleSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoscaleSettings = AutoscaleSettings.DeserializeAutoscaleSettings(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewGetPropertiesOptions(throughput, autoscaleSettings, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Throughput), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughput: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Throughput)) - { - builder.Append(" throughput: "); - builder.AppendLine($"{Throughput.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("AutoscaleMaxThroughput", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" autoscaleSettings: "); - builder.AppendLine("{"); - builder.Append(" maxThroughput: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(AutoscaleSettings)) - { - builder.Append(" autoscaleSettings: "); - BicepSerializationHelpers.AppendChildObject(builder, AutoscaleSettings, options, 2, false, " autoscaleSettings: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewGetPropertiesOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCassandraViewGetPropertiesOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.cs deleted file mode 100644 index 592a376d7a9f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The CassandraViewGetPropertiesOptions. - public partial class CassandraViewGetPropertiesOptions : CosmosDBBaseConfig - { - /// Initializes a new instance of . - public CassandraViewGetPropertiesOptions() - { - } - - /// Initializes a new instance of . - /// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. - /// Specifies the Autoscale settings. - /// Keeps track of any properties unknown to the library. - internal CassandraViewGetPropertiesOptions(int? throughput, AutoscaleSettings autoscaleSettings, IDictionary serializedAdditionalRawData) : base(throughput, autoscaleSettings, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs deleted file mode 100644 index ceab400fab9c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraViewGetPropertiesResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (options.Format != "W" && Optional.IsDefined(Rid)) - { - writer.WritePropertyName("_rid"u8); - writer.WriteStringValue(Rid); - } - if (options.Format != "W" && Optional.IsDefined(Timestamp)) - { - writer.WritePropertyName("_ts"u8); - writer.WriteNumberValue(Timestamp.Value); - } - if (options.Format != "W" && Optional.IsDefined(ETag)) - { - writer.WritePropertyName("_etag"u8); - writer.WriteStringValue(ETag.Value.ToString()); - } - } - - CassandraViewGetPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewGetPropertiesResource(document.RootElement, options); - } - - internal static CassandraViewGetPropertiesResource DeserializeCassandraViewGetPropertiesResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string rid = default; - float? ts = default; - ETag? etag = default; - string id = default; - string viewDefinition = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("_rid"u8)) - { - rid = property.Value.GetString(); - continue; - } - if (property.NameEquals("_ts"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - ts = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("_etag"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("viewDefinition"u8)) - { - viewDefinition = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewGetPropertiesResource( - id, - viewDefinition, - serializedAdditionalRawData, - rid, - ts, - etag); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Rid), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" _rid: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Rid)) - { - builder.Append(" _rid: "); - if (Rid.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Rid}'''"); - } - else - { - builder.AppendLine($"'{Rid}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Timestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" _ts: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Timestamp)) - { - builder.Append(" _ts: "); - builder.AppendLine($"'{Timestamp.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" _etag: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ETag)) - { - builder.Append(" _etag: "); - builder.AppendLine($"'{ETag.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" viewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ViewDefinition)) - { - builder.Append(" viewDefinition: "); - if (ViewDefinition.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ViewDefinition}'''"); - } - else - { - builder.AppendLine($"'{ViewDefinition}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewGetPropertiesResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCassandraViewGetPropertiesResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.cs deleted file mode 100644 index 9b83c445f7b3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The CassandraViewGetPropertiesResource. - public partial class CassandraViewGetPropertiesResource : CassandraViewResource - { - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// or is null. - public CassandraViewGetPropertiesResource(string id, string viewDefinition) : base(id, viewDefinition) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(viewDefinition, nameof(viewDefinition)); - } - - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// Keeps track of any properties unknown to the library. - /// A system generated property. A unique identifier. - /// A system generated property that denotes the last updated timestamp of the resource. - /// A system generated property representing the resource etag required for optimistic concurrency control. - internal CassandraViewGetPropertiesResource(string id, string viewDefinition, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(id, viewDefinition, serializedAdditionalRawData) - { - Rid = rid; - Timestamp = timestamp; - ETag = etag; - } - - /// Initializes a new instance of for deserialization. - internal CassandraViewGetPropertiesResource() - { - } - - /// A system generated property. A unique identifier. - [WirePath("_rid")] - public string Rid { get; } - /// A system generated property that denotes the last updated timestamp of the resource. - [WirePath("_ts")] - public float? Timestamp { get; } - /// A system generated property representing the resource etag required for optimistic concurrency control. - [WirePath("_etag")] - public ETag? ETag { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index 6ede0683a92c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraViewGetResultCreateOrUpdateContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - if (Optional.IsDefined(Options)) - { - writer.WritePropertyName("options"u8); - writer.WriteObjectValue(Options, options); - } - writer.WriteEndObject(); - } - - CassandraViewGetResultCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewGetResultCreateOrUpdateContent(document.RootElement, options); - } - - internal static CassandraViewGetResultCreateOrUpdateContent DeserializeCassandraViewGetResultCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CassandraViewResource resource = default; - CosmosDBCreateUpdateConfig options0 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - resource = CassandraViewResource.DeserializeCassandraViewResource(property0.Value, options); - continue; - } - if (property0.NameEquals("options"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - options0 = CosmosDBCreateUpdateConfig.DeserializeCosmosDBCreateUpdateConfig(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewGetResultCreateOrUpdateContent( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - options0, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Resource), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" options: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Options)) - { - builder.Append(" options: "); - BicepSerializationHelpers.AppendChildObject(builder, Options, options, 4, false, " options: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewGetResultCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCassandraViewGetResultCreateOrUpdateContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.cs deleted file mode 100644 index 69d2c56c0064..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Parameters to create and update Cosmos DB Cassandra view. - public partial class CassandraViewGetResultCreateOrUpdateContent : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The standard JSON format of a Cassandra view. - /// is null. - public CassandraViewGetResultCreateOrUpdateContent(AzureLocation location, CassandraViewResource resource) : base(location) - { - Argument.AssertNotNull(resource, nameof(resource)); - - Resource = resource; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a Cassandra view. - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal CassandraViewGetResultCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraViewResource resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Options = options; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CassandraViewGetResultCreateOrUpdateContent() - { - } - - /// The standard JSON format of a Cassandra view. - [WirePath("properties.resource")] - public CassandraViewResource Resource { get; set; } - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - [WirePath("properties.options")] - public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs deleted file mode 100644 index 242aa82b2ec0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class CassandraViewListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - CassandraViewListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewListResult(document.RootElement, options); - } - - internal static CassandraViewListResult DeserializeCassandraViewListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CassandraViewGetResultData.DeserializeCassandraViewGetResultData(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewListResult(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCassandraViewListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.cs deleted file mode 100644 index 35fd26a8643c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The List operation response, that contains the Cassandra views and their properties. - internal partial class CassandraViewListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal CassandraViewListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of Cassandra views and their properties. - /// Keeps track of any properties unknown to the library. - internal CassandraViewListResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of Cassandra views and their properties. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs deleted file mode 100644 index f91c8991e60c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraViewResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewResource)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("viewDefinition"u8); - writer.WriteStringValue(ViewDefinition); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - CassandraViewResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewResource(document.RootElement, options); - } - - internal static CassandraViewResource DeserializeCassandraViewResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - string viewDefinition = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("viewDefinition"u8)) - { - viewDefinition = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewResource(id, viewDefinition, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" viewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ViewDefinition)) - { - builder.Append(" viewDefinition: "); - if (ViewDefinition.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ViewDefinition}'''"); - } - else - { - builder.AppendLine($"'{ViewDefinition}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewResource)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCassandraViewResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.cs deleted file mode 100644 index 00b0c796b103..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Cosmos DB Cassandra view resource object. - public partial class CassandraViewResource - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// or is null. - public CassandraViewResource(string id, string viewDefinition) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(viewDefinition, nameof(viewDefinition)); - - Id = id; - ViewDefinition = viewDefinition; - } - - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// Keeps track of any properties unknown to the library. - internal CassandraViewResource(string id, string viewDefinition, IDictionary serializedAdditionalRawData) - { - Id = id; - ViewDefinition = viewDefinition; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CassandraViewResource() - { - } - - /// Name of the Cosmos DB Cassandra view. - [WirePath("id")] - public string Id { get; set; } - /// View Definition of the Cosmos DB Cassandra view. - [WirePath("viewDefinition")] - public string ViewDefinition { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ChaosFaultListResponse.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ChaosFaultListResponse.cs deleted file mode 100644 index c8fac0e70a66..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ChaosFaultListResponse.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Chaos Fault List Response. - internal partial class ChaosFaultListResponse - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ChaosFaultListResponse() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of Chaos Faults. - /// The link used to get the next page of results. - /// Keeps track of any properties unknown to the library. - internal ChaosFaultListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of Chaos Faults. - public IReadOnlyList Value { get; } - /// The link used to get the next page of results. - public string NextLink { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs index 30b994436d03..692a02f725ea 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs @@ -32,7 +32,7 @@ internal ContinuousModeBackupPolicy(BackupPolicyType backupPolicyType, BackupPol /// Configuration values for continuous mode backup. internal ContinuousModeProperties ContinuousModeProperties { get; set; } - /// Enum to indicate type of Continuos backup mode. + /// Enum to indicate type of Continuous backup mode. [WirePath("continuousModeProperties.tier")] public ContinuousTier? ContinuousModeTier { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.cs index 6ba0eb1d606e..a8e3f277570d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.cs @@ -51,7 +51,7 @@ public ContinuousModeProperties() } /// Initializes a new instance of . - /// Enum to indicate type of Continuos backup mode. + /// Enum to indicate type of Continuous backup mode. /// Keeps track of any properties unknown to the library. internal ContinuousModeProperties(ContinuousTier? tier, IDictionary serializedAdditionalRawData) { @@ -59,7 +59,7 @@ internal ContinuousModeProperties(ContinuousTier? tier, IDictionary Enum to indicate type of Continuos backup mode. + /// Enum to indicate type of Continuous backup mode. [WirePath("tier")] public ContinuousTier? Tier { get; set; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index a0dd0e7aca6b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosCassandraDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("keyspaceName"u8); - writer.WriteStringValue(KeyspaceName); - writer.WritePropertyName("tableName"u8); - writer.WriteStringValue(TableName); - } - - CosmosCassandraDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosCassandraDataTransferDataSourceSink(document.RootElement, options); - } - - internal static CosmosCassandraDataTransferDataSourceSink DeserializeCosmosCassandraDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string keyspaceName = default; - string tableName = default; - string remoteAccountName = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("keyspaceName"u8)) - { - keyspaceName = property.Value.GetString(); - continue; - } - if (property.NameEquals("tableName"u8)) - { - tableName = property.Value.GetString(); - continue; - } - if (property.NameEquals("remoteAccountName"u8)) - { - remoteAccountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosCassandraDataTransferDataSourceSink(component, serializedAdditionalRawData, remoteAccountName, keyspaceName, tableName); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeyspaceName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" keyspaceName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(KeyspaceName)) - { - builder.Append(" keyspaceName: "); - if (KeyspaceName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{KeyspaceName}'''"); - } - else - { - builder.AppendLine($"'{KeyspaceName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TableName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tableName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(TableName)) - { - builder.Append(" tableName: "); - if (TableName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{TableName}'''"); - } - else - { - builder.AppendLine($"'{TableName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" remoteAccountName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RemoteAccountName)) - { - builder.Append(" remoteAccountName: "); - if (RemoteAccountName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RemoteAccountName}'''"); - } - else - { - builder.AppendLine($"'{RemoteAccountName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - CosmosCassandraDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosCassandraDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.cs deleted file mode 100644 index f915006de849..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A CosmosDB Cassandra API data source/sink. - public partial class CosmosCassandraDataTransferDataSourceSink : BaseCosmosDataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// - /// or is null. - public CosmosCassandraDataTransferDataSourceSink(string keyspaceName, string tableName) - { - Argument.AssertNotNull(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNull(tableName, nameof(tableName)); - - KeyspaceName = keyspaceName; - TableName = tableName; - Component = DataTransferComponent.CosmosDBCassandra; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - /// - internal CosmosCassandraDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string remoteAccountName, string keyspaceName, string tableName) : base(component, serializedAdditionalRawData, remoteAccountName) - { - KeyspaceName = keyspaceName; - TableName = tableName; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal CosmosCassandraDataTransferDataSourceSink() - { - } - - /// Gets or sets the keyspace name. - [WirePath("keyspaceName")] - public string KeyspaceName { get; set; } - /// Gets or sets the table name. - [WirePath("tableName")] - public string TableName { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs index 470fe58a1128..3bc466fe0d70 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs @@ -200,11 +200,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } - if (Optional.IsDefined(DiagnosticLogSettings)) - { - writer.WritePropertyName("diagnosticLogSettings"u8); - writer.WriteObjectValue(DiagnosticLogSettings, options); - } if (Optional.IsDefined(DisableLocalAuth)) { writer.WritePropertyName("disableLocalAuth"u8); @@ -220,16 +215,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("capacity"u8); writer.WriteObjectValue(Capacity, options); } - if (Optional.IsDefined(CapacityMode)) - { - writer.WritePropertyName("capacityMode"u8); - writer.WriteStringValue(CapacityMode.Value.ToString()); - } - if (Optional.IsDefined(EnableMaterializedViews)) - { - writer.WritePropertyName("enableMaterializedViews"u8); - writer.WriteBooleanValue(EnableMaterializedViews.Value); - } if (options.Format != "W" && Optional.IsDefined(KeysMetadata)) { writer.WritePropertyName("keysMetadata"u8); @@ -240,31 +225,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("enablePartitionMerge"u8); writer.WriteBooleanValue(EnablePartitionMerge.Value); } - if (Optional.IsDefined(EnableBurstCapacity)) - { - writer.WritePropertyName("enableBurstCapacity"u8); - writer.WriteBooleanValue(EnableBurstCapacity.Value); - } if (Optional.IsDefined(MinimalTlsVersion)) { writer.WritePropertyName("minimalTlsVersion"u8); writer.WriteStringValue(MinimalTlsVersion.Value.ToString()); } + if (Optional.IsDefined(EnableBurstCapacity)) + { + writer.WritePropertyName("enableBurstCapacity"u8); + writer.WriteBooleanValue(EnableBurstCapacity.Value); + } if (Optional.IsDefined(CustomerManagedKeyStatus)) { writer.WritePropertyName("customerManagedKeyStatus"u8); writer.WriteStringValue(CustomerManagedKeyStatus); } - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - writer.WritePropertyName("enablePriorityBasedExecution"u8); - writer.WriteBooleanValue(EnablePriorityBasedExecution.Value); - } - if (Optional.IsDefined(DefaultPriorityLevel)) - { - writer.WritePropertyName("defaultPriorityLevel"u8); - writer.WriteStringValue(DefaultPriorityLevel.Value.ToString()); - } if (Optional.IsDefined(EnablePerRegionPerPartitionAutoscale)) { writer.WritePropertyName("enablePerRegionPerPartitionAutoscale"u8); @@ -325,19 +300,14 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC IList cors = default; NetworkAclBypass? networkAclBypass = default; IList networkAclBypassResourceIds = default; - DiagnosticLogSettings diagnosticLogSettings = default; bool? disableLocalAuth = default; CosmosDBAccountRestoreParameters restoreParameters = default; CosmosDBAccountCapacity capacity = default; - CapacityMode? capacityMode = default; - bool? enableMaterializedViews = default; DatabaseAccountKeysMetadata keysMetadata = default; bool? enablePartitionMerge = default; - bool? enableBurstCapacity = default; CosmosDBMinimalTlsVersion? minimalTlsVersion = default; + bool? enableBurstCapacity = default; string customerManagedKeyStatus = default; - bool? enablePriorityBasedExecution = default; - DefaultPriorityLevel? defaultPriorityLevel = default; bool? enablePerRegionPerPartitionAutoscale = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -655,15 +625,6 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC networkAclBypassResourceIds = array; continue; } - if (property0.NameEquals("diagnosticLogSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diagnosticLogSettings = DiagnosticLogSettings.DeserializeDiagnosticLogSettings(property0.Value, options); - continue; - } if (property0.NameEquals("disableLocalAuth"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -691,24 +652,6 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC capacity = CosmosDBAccountCapacity.DeserializeCosmosDBAccountCapacity(property0.Value, options); continue; } - if (property0.NameEquals("capacityMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityMode = new CapacityMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("enableMaterializedViews"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableMaterializedViews = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("keysMetadata"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -727,15 +670,6 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC enablePartitionMerge = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enableBurstCapacity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableBurstCapacity = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("minimalTlsVersion"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -745,27 +679,18 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC minimalTlsVersion = new CosmosDBMinimalTlsVersion(property0.Value.GetString()); continue; } - if (property0.NameEquals("customerManagedKeyStatus"u8)) - { - customerManagedKeyStatus = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enablePriorityBasedExecution"u8)) + if (property0.NameEquals("enableBurstCapacity"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - enablePriorityBasedExecution = property0.Value.GetBoolean(); + enableBurstCapacity = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("defaultPriorityLevel"u8)) + if (property0.NameEquals("customerManagedKeyStatus"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defaultPriorityLevel = new DefaultPriorityLevel(property0.Value.GetString()); + customerManagedKeyStatus = property0.Value.GetString(); continue; } if (property0.NameEquals("enablePerRegionPerPartitionAutoscale"u8)) @@ -794,6 +719,7 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC tags ?? new ChangeTrackingDictionary(), location, kind, + identity, consistencyPolicy, locations, databaseAccountOfferType, @@ -818,21 +744,15 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC cors ?? new ChangeTrackingList(), networkAclBypass, networkAclBypassResourceIds ?? new ChangeTrackingList(), - diagnosticLogSettings, disableLocalAuth, restoreParameters, capacity, - capacityMode, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, - identity, serializedAdditionalRawData); } @@ -1416,26 +1336,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DiagnosticLogEnableFullTextQuery", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" diagnosticLogSettings: "); - builder.AppendLine("{"); - builder.AppendLine(" diagnosticLogSettings: {"); - builder.Append(" enableFullTextQuery: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(DiagnosticLogSettings)) - { - builder.Append(" diagnosticLogSettings: "); - BicepSerializationHelpers.AppendChildObject(builder, DiagnosticLogSettings, options, 4, false, " diagnosticLogSettings: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisableLocalAuth), out propertyOverride); if (hasPropertyOverride) { @@ -1487,37 +1387,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityMode)) - { - builder.Append(" capacityMode: "); - builder.AppendLine($"'{CapacityMode.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableMaterializedViews), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enableMaterializedViews: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnableMaterializedViews)) - { - builder.Append(" enableMaterializedViews: "); - var boolValue = EnableMaterializedViews.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeysMetadata), out propertyOverride); if (hasPropertyOverride) { @@ -1549,34 +1418,34 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableBurstCapacity), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimalTlsVersion), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" enableBurstCapacity: "); + builder.Append(" minimalTlsVersion: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(EnableBurstCapacity)) + if (Optional.IsDefined(MinimalTlsVersion)) { - builder.Append(" enableBurstCapacity: "); - var boolValue = EnableBurstCapacity.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); + builder.Append(" minimalTlsVersion: "); + builder.AppendLine($"'{MinimalTlsVersion.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimalTlsVersion), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableBurstCapacity), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" minimalTlsVersion: "); + builder.Append(" enableBurstCapacity: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(MinimalTlsVersion)) + if (Optional.IsDefined(EnableBurstCapacity)) { - builder.Append(" minimalTlsVersion: "); - builder.AppendLine($"'{MinimalTlsVersion.Value.ToString()}'"); + builder.Append(" enableBurstCapacity: "); + var boolValue = EnableBurstCapacity.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); } } @@ -1603,37 +1472,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePriorityBasedExecution), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enablePriorityBasedExecution: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - builder.Append(" enablePriorityBasedExecution: "); - var boolValue = EnablePriorityBasedExecution.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DefaultPriorityLevel), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" defaultPriorityLevel: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DefaultPriorityLevel)) - { - builder.Append(" defaultPriorityLevel: "); - builder.AppendLine($"'{DefaultPriorityLevel.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePerRegionPerPartitionAutoscale), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs index a7ba9d36a3bb..bffc11a22f56 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs @@ -73,6 +73,7 @@ public CosmosDBAccountCreateOrUpdateContent(AzureLocation location, IEnumerable< /// The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. + /// Identity for the resource. /// The consistency policy for the Cosmos DB account. /// An array that contains the georeplication locations enabled for the Cosmos DB account. /// The offer type for the database. @@ -101,25 +102,20 @@ public CosmosDBAccountCreateOrUpdateContent(AzureLocation location, IEnumerable< /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// Parameters to indicate the information about the restore. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// 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. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - /// Identity for the resource. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. /// Keeps track of any properties unknown to the library. - internal CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, ConsistencyPolicy consistencyPolicy, IList locations, CosmosDBAccountOfferType databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountCreateMode? createMode, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, ManagedServiceIdentity identity, ConsistencyPolicy consistencyPolicy, IList locations, CosmosDBAccountOfferType databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountCreateMode? createMode, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, bool? disableLocalAuth, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountCapacity capacity, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, CosmosDBMinimalTlsVersion? minimalTlsVersion, bool? enableBurstCapacity, string customerManagedKeyStatus, bool? enablePerRegionPerPartitionAutoscale, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Kind = kind; + Identity = identity; ConsistencyPolicy = consistencyPolicy; Locations = locations; DatabaseAccountOfferType = databaseAccountOfferType; @@ -144,21 +140,15 @@ internal CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id, string name Cors = cors; NetworkAclBypass = networkAclBypass; NetworkAclBypassResourceIds = networkAclBypassResourceIds; - DiagnosticLogSettings = diagnosticLogSettings; DisableLocalAuth = disableLocalAuth; RestoreParameters = restoreParameters; Capacity = capacity; - CapacityMode = capacityMode; - EnableMaterializedViews = enableMaterializedViews; KeysMetadata = keysMetadata; EnablePartitionMerge = enablePartitionMerge; - EnableBurstCapacity = enableBurstCapacity; MinimalTlsVersion = minimalTlsVersion; + EnableBurstCapacity = enableBurstCapacity; CustomerManagedKeyStatus = customerManagedKeyStatus; - EnablePriorityBasedExecution = enablePriorityBasedExecution; - DefaultPriorityLevel = defaultPriorityLevel; EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -170,6 +160,9 @@ internal CosmosDBAccountCreateOrUpdateContent() /// Indicates the type of database account. This can only be set at database account creation. [WirePath("kind")] public CosmosDBAccountKind? Kind { get; set; } + /// Identity for the resource. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } /// The consistency policy for the Cosmos DB account. [WirePath("properties.consistencyPolicy")] public ConsistencyPolicy ConsistencyPolicy { get; set; } @@ -267,21 +260,6 @@ public AnalyticalStorageSchemaType? AnalyticalStorageSchemaType /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. [WirePath("properties.networkAclBypassResourceIds")] public IList NetworkAclBypassResourceIds { get; } - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. - internal DiagnosticLogSettings DiagnosticLogSettings { get; set; } - /// Describe the level of detail with which queries are to be logged. - [WirePath("properties.diagnosticLogSettings.enableFullTextQuery")] - public EnableFullTextQuery? DiagnosticLogEnableFullTextQuery - { - get => DiagnosticLogSettings is null ? default : DiagnosticLogSettings.EnableFullTextQuery; - set - { - if (DiagnosticLogSettings is null) - DiagnosticLogSettings = new DiagnosticLogSettings(); - DiagnosticLogSettings.EnableFullTextQuery = value; - } - } - /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. [WirePath("properties.disableLocalAuth")] public bool? DisableLocalAuth { get; set; } @@ -303,38 +281,23 @@ public int? CapacityTotalThroughputLimit } } - /// Indicates the capacityMode of the Cosmos DB account. - [WirePath("properties.capacityMode")] - public CapacityMode? CapacityMode { get; set; } - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. - [WirePath("properties.enableMaterializedViews")] - public bool? EnableMaterializedViews { get; set; } /// 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. [WirePath("properties.keysMetadata")] public DatabaseAccountKeysMetadata KeysMetadata { get; } /// Flag to indicate enabling/disabling of Partition Merge feature on the account. [WirePath("properties.enablePartitionMerge")] public bool? EnablePartitionMerge { get; set; } - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - [WirePath("properties.enableBurstCapacity")] - public bool? EnableBurstCapacity { get; set; } - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. [WirePath("properties.minimalTlsVersion")] public CosmosDBMinimalTlsVersion? MinimalTlsVersion { get; set; } + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. + [WirePath("properties.enableBurstCapacity")] + public bool? EnableBurstCapacity { get; set; } /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. [WirePath("properties.customerManagedKeyStatus")] public string CustomerManagedKeyStatus { get; set; } - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - [WirePath("properties.enablePriorityBasedExecution")] - public bool? EnablePriorityBasedExecution { get; set; } - /// Enum to indicate default Priority Level of request for Priority Based Execution. - [WirePath("properties.defaultPriorityLevel")] - public DefaultPriorityLevel? DefaultPriorityLevel { get; set; } - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. [WirePath("properties.enablePerRegionPerPartitionAutoscale")] public bool? EnablePerRegionPerPartitionAutoscale { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountLocation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountLocation.cs index a3b10163477d..ddc041a5c7e4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountLocation.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountLocation.cs @@ -55,7 +55,7 @@ public CosmosDBAccountLocation() /// The unique identifier of the region within the database account. Example: <accountName>-<locationName>. /// The name of the region. /// The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/. - /// The provisioning state of the resource. + /// The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. /// The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. /// Flag to indicate whether or not this region is an AvailabilityZone region. /// Keeps track of any properties unknown to the library. @@ -79,7 +79,7 @@ internal CosmosDBAccountLocation(string id, AzureLocation? locationName, string /// The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/. [WirePath("documentEndpoint")] public string DocumentEndpoint { get; } - /// The provisioning state of the resource. + /// The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. [WirePath("provisioningState")] public string ProvisioningState { get; } /// The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs index 9f6c5b996eb5..2c102f856276 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs @@ -204,11 +204,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } - if (Optional.IsDefined(DiagnosticLogSettings)) - { - writer.WritePropertyName("diagnosticLogSettings"u8); - writer.WriteObjectValue(DiagnosticLogSettings, options); - } if (Optional.IsDefined(DisableLocalAuth)) { writer.WritePropertyName("disableLocalAuth"u8); @@ -219,16 +214,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("capacity"u8); writer.WriteObjectValue(Capacity, options); } - if (Optional.IsDefined(CapacityMode)) - { - writer.WritePropertyName("capacityMode"u8); - writer.WriteStringValue(CapacityMode.Value.ToString()); - } - if (Optional.IsDefined(EnableMaterializedViews)) - { - writer.WritePropertyName("enableMaterializedViews"u8); - writer.WriteBooleanValue(EnableMaterializedViews.Value); - } if (options.Format != "W" && Optional.IsDefined(KeysMetadata)) { writer.WritePropertyName("keysMetadata"u8); @@ -239,31 +224,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("enablePartitionMerge"u8); writer.WriteBooleanValue(EnablePartitionMerge.Value); } - if (Optional.IsDefined(EnableBurstCapacity)) - { - writer.WritePropertyName("enableBurstCapacity"u8); - writer.WriteBooleanValue(EnableBurstCapacity.Value); - } if (Optional.IsDefined(MinimalTlsVersion)) { writer.WritePropertyName("minimalTlsVersion"u8); writer.WriteStringValue(MinimalTlsVersion.Value.ToString()); } + if (Optional.IsDefined(EnableBurstCapacity)) + { + writer.WritePropertyName("enableBurstCapacity"u8); + writer.WriteBooleanValue(EnableBurstCapacity.Value); + } if (Optional.IsDefined(CustomerManagedKeyStatus)) { writer.WritePropertyName("customerManagedKeyStatus"u8); writer.WriteStringValue(CustomerManagedKeyStatus); } - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - writer.WritePropertyName("enablePriorityBasedExecution"u8); - writer.WriteBooleanValue(EnablePriorityBasedExecution.Value); - } - if (Optional.IsDefined(DefaultPriorityLevel)) - { - writer.WritePropertyName("defaultPriorityLevel"u8); - writer.WriteStringValue(DefaultPriorityLevel.Value.ToString()); - } if (Optional.IsDefined(EnablePerRegionPerPartitionAutoscale)) { writer.WritePropertyName("enablePerRegionPerPartitionAutoscale"u8); @@ -332,18 +307,13 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement IList cors = default; NetworkAclBypass? networkAclBypass = default; IList networkAclBypassResourceIds = default; - DiagnosticLogSettings diagnosticLogSettings = default; bool? disableLocalAuth = default; CosmosDBAccountCapacity capacity = default; - CapacityMode? capacityMode = default; - bool? enableMaterializedViews = default; DatabaseAccountKeysMetadata keysMetadata = default; bool? enablePartitionMerge = default; - bool? enableBurstCapacity = default; CosmosDBMinimalTlsVersion? minimalTlsVersion = default; + bool? enableBurstCapacity = default; string customerManagedKeyStatus = default; - bool? enablePriorityBasedExecution = default; - DefaultPriorityLevel? defaultPriorityLevel = default; bool? enablePerRegionPerPartitionAutoscale = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -622,15 +592,6 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement networkAclBypassResourceIds = array; continue; } - if (property0.NameEquals("diagnosticLogSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diagnosticLogSettings = DiagnosticLogSettings.DeserializeDiagnosticLogSettings(property0.Value, options); - continue; - } if (property0.NameEquals("disableLocalAuth"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -649,24 +610,6 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement capacity = CosmosDBAccountCapacity.DeserializeCosmosDBAccountCapacity(property0.Value, options); continue; } - if (property0.NameEquals("capacityMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityMode = new CapacityMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("enableMaterializedViews"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableMaterializedViews = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("keysMetadata"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -685,15 +628,6 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement enablePartitionMerge = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enableBurstCapacity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableBurstCapacity = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("minimalTlsVersion"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -703,27 +637,18 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement minimalTlsVersion = new CosmosDBMinimalTlsVersion(property0.Value.GetString()); continue; } - if (property0.NameEquals("customerManagedKeyStatus"u8)) - { - customerManagedKeyStatus = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enablePriorityBasedExecution"u8)) + if (property0.NameEquals("enableBurstCapacity"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - enablePriorityBasedExecution = property0.Value.GetBoolean(); + enableBurstCapacity = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("defaultPriorityLevel"u8)) + if (property0.NameEquals("customerManagedKeyStatus"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defaultPriorityLevel = new DefaultPriorityLevel(property0.Value.GetString()); + customerManagedKeyStatus = property0.Value.GetString(); continue; } if (property0.NameEquals("enablePerRegionPerPartitionAutoscale"u8)) @@ -770,18 +695,13 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement cors ?? new ChangeTrackingList(), networkAclBypass, networkAclBypassResourceIds ?? new ChangeTrackingList(), - diagnosticLogSettings, disableLocalAuth, capacity, - capacityMode, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, serializedAdditionalRawData); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs index 41c2c81ce816..7b24aef45701 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs @@ -89,21 +89,16 @@ public CosmosDBAccountPatch() /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. /// Keeps track of any properties unknown to the library. - internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? location, ManagedServiceIdentity identity, ConsistencyPolicy consistencyPolicy, IList locations, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, IDictionary serializedAdditionalRawData) + internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? location, ManagedServiceIdentity identity, ConsistencyPolicy consistencyPolicy, IList locations, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, CosmosDBMinimalTlsVersion? minimalTlsVersion, bool? enableBurstCapacity, string customerManagedKeyStatus, bool? enablePerRegionPerPartitionAutoscale, IDictionary serializedAdditionalRawData) { Tags = tags; Location = location; @@ -130,18 +125,13 @@ internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? l Cors = cors; NetworkAclBypass = networkAclBypass; NetworkAclBypassResourceIds = networkAclBypassResourceIds; - DiagnosticLogSettings = diagnosticLogSettings; DisableLocalAuth = disableLocalAuth; Capacity = capacity; - CapacityMode = capacityMode; - EnableMaterializedViews = enableMaterializedViews; KeysMetadata = keysMetadata; EnablePartitionMerge = enablePartitionMerge; - EnableBurstCapacity = enableBurstCapacity; MinimalTlsVersion = minimalTlsVersion; + EnableBurstCapacity = enableBurstCapacity; CustomerManagedKeyStatus = customerManagedKeyStatus; - EnablePriorityBasedExecution = enablePriorityBasedExecution; - DefaultPriorityLevel = defaultPriorityLevel; EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -249,21 +239,6 @@ public AnalyticalStorageSchemaType? AnalyticalStorageSchemaType /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. [WirePath("properties.networkAclBypassResourceIds")] public IList NetworkAclBypassResourceIds { get; } - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. - internal DiagnosticLogSettings DiagnosticLogSettings { get; set; } - /// Describe the level of detail with which queries are to be logged. - [WirePath("properties.diagnosticLogSettings.enableFullTextQuery")] - public EnableFullTextQuery? DiagnosticLogEnableFullTextQuery - { - get => DiagnosticLogSettings is null ? default : DiagnosticLogSettings.EnableFullTextQuery; - set - { - if (DiagnosticLogSettings is null) - DiagnosticLogSettings = new DiagnosticLogSettings(); - DiagnosticLogSettings.EnableFullTextQuery = value; - } - } - /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. [WirePath("properties.disableLocalAuth")] public bool? DisableLocalAuth { get; set; } @@ -282,34 +257,22 @@ public int? CapacityTotalThroughputLimit } } - /// Indicates the capacityMode of the Cosmos DB account. - [WirePath("properties.capacityMode")] - public CapacityMode? CapacityMode { get; set; } - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. - [WirePath("properties.enableMaterializedViews")] - public bool? EnableMaterializedViews { get; set; } /// This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. [WirePath("properties.keysMetadata")] public DatabaseAccountKeysMetadata KeysMetadata { get; } /// Flag to indicate enabling/disabling of Partition Merge feature on the account. [WirePath("properties.enablePartitionMerge")] public bool? EnablePartitionMerge { get; set; } - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - [WirePath("properties.enableBurstCapacity")] - public bool? EnableBurstCapacity { get; set; } - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. [WirePath("properties.minimalTlsVersion")] public CosmosDBMinimalTlsVersion? MinimalTlsVersion { get; set; } + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. + [WirePath("properties.enableBurstCapacity")] + public bool? EnableBurstCapacity { get; set; } /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. [WirePath("properties.customerManagedKeyStatus")] public string CustomerManagedKeyStatus { get; set; } - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - [WirePath("properties.enablePriorityBasedExecution")] - public bool? EnablePriorityBasedExecution { get; set; } - /// Enum to indicate default Priority Level of request for Priority Based Execution. - [WirePath("properties.defaultPriorityLevel")] - public DefaultPriorityLevel? DefaultPriorityLevel { get; set; } - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. [WirePath("properties.enablePerRegionPerPartitionAutoscale")] public bool? EnablePerRegionPerPartitionAutoscale { get; set; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs index b9fbd93e0e40..2823119ac9fe 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs @@ -72,11 +72,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } - if (Optional.IsDefined(SourceBackupLocation)) - { - writer.WritePropertyName("sourceBackupLocation"u8); - writer.WriteStringValue(SourceBackupLocation); - } } CosmosDBAccountRestoreParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -103,7 +98,6 @@ internal static CosmosDBAccountRestoreParameters DeserializeCosmosDBAccountResto IList databasesToRestore = default; IList gremlinDatabasesToRestore = default; IList tablesToRestore = default; - string sourceBackupLocation = default; string restoreSource = default; DateTimeOffset? restoreTimestampInUtc = default; bool? restoreWithTtlDisabled = default; @@ -162,11 +156,6 @@ internal static CosmosDBAccountRestoreParameters DeserializeCosmosDBAccountResto tablesToRestore = array; continue; } - if (property.NameEquals("sourceBackupLocation"u8)) - { - sourceBackupLocation = property.Value.GetString(); - continue; - } if (property.NameEquals("restoreSource"u8)) { restoreSource = property.Value.GetString(); @@ -204,8 +193,7 @@ internal static CosmosDBAccountRestoreParameters DeserializeCosmosDBAccountResto restoreMode, databasesToRestore ?? new ChangeTrackingList(), gremlinDatabasesToRestore ?? new ChangeTrackingList(), - tablesToRestore ?? new ChangeTrackingList(), - sourceBackupLocation); + tablesToRestore ?? new ChangeTrackingList()); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -316,29 +304,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceBackupLocation), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sourceBackupLocation: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SourceBackupLocation)) - { - builder.Append(" sourceBackupLocation: "); - if (SourceBackupLocation.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{SourceBackupLocation}'''"); - } - else - { - builder.AppendLine($"'{SourceBackupLocation}'"); - } - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RestoreSource), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.cs index 11c9f08a794e..0baf944cb56e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.cs @@ -30,14 +30,12 @@ public CosmosDBAccountRestoreParameters() /// List of specific databases available for restore. /// List of specific gremlin databases available for restore. /// List of specific tables available for restore. - /// The source backup location for restore. - internal CosmosDBAccountRestoreParameters(string restoreSource, DateTimeOffset? restoreTimestampInUtc, bool? isRestoreWithTtlDisabled, IDictionary serializedAdditionalRawData, CosmosDBAccountRestoreMode? restoreMode, IList databasesToRestore, IList gremlinDatabasesToRestore, IList tablesToRestore, string sourceBackupLocation) : base(restoreSource, restoreTimestampInUtc, isRestoreWithTtlDisabled, serializedAdditionalRawData) + internal CosmosDBAccountRestoreParameters(string restoreSource, DateTimeOffset? restoreTimestampInUtc, bool? isRestoreWithTtlDisabled, IDictionary serializedAdditionalRawData, CosmosDBAccountRestoreMode? restoreMode, IList databasesToRestore, IList gremlinDatabasesToRestore, IList tablesToRestore) : base(restoreSource, restoreTimestampInUtc, isRestoreWithTtlDisabled, serializedAdditionalRawData) { RestoreMode = restoreMode; DatabasesToRestore = databasesToRestore; GremlinDatabasesToRestore = gremlinDatabasesToRestore; TablesToRestore = tablesToRestore; - SourceBackupLocation = sourceBackupLocation; } /// Describes the mode of the restore. @@ -52,8 +50,5 @@ internal CosmosDBAccountRestoreParameters(string restoreSource, DateTimeOffset? /// List of specific tables available for restore. [WirePath("tablesToRestore")] public IList TablesToRestore { get; } - /// The source backup location for restore. - [WirePath("sourceBackupLocation")] - public string SourceBackupLocation { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBChaosFaultSupportedAction.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBChaosFaultSupportedAction.Serialization.cs deleted file mode 100644 index 4267104b6a95..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBChaosFaultSupportedAction.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal static partial class CosmosDBChaosFaultSupportedActionExtensions - { - public static string ToSerialString(this CosmosDBChaosFaultSupportedAction value) => value switch - { - CosmosDBChaosFaultSupportedAction.Enable => "Enable", - CosmosDBChaosFaultSupportedAction.Disable => "Disable", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CosmosDBChaosFaultSupportedAction value.") - }; - - public static CosmosDBChaosFaultSupportedAction ToCosmosDBChaosFaultSupportedAction(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Enable")) return CosmosDBChaosFaultSupportedAction.Enable; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Disable")) return CosmosDBChaosFaultSupportedAction.Disable; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CosmosDBChaosFaultSupportedAction value."); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBChaosFaultSupportedAction.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBChaosFaultSupportedAction.cs deleted file mode 100644 index 2be4004ef272..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBChaosFaultSupportedAction.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Indicates whether what action to take for the Chaos Fault. - public enum CosmosDBChaosFaultSupportedAction - { - /// Enable. - Enable, - /// Disable. - Disable - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs deleted file mode 100644 index 26ee1eb7eff9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosDBErrorResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Code)) - { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); - } - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - CosmosDBErrorResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBErrorResult(document.RootElement, options); - } - - internal static CosmosDBErrorResult DeserializeCosmosDBErrorResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string code = default; - string message = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBErrorResult(code, message, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Code), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" code: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Code)) - { - builder.Append(" code: "); - if (Code.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Code}'''"); - } - else - { - builder.AppendLine($"'{Code}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Message), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" message: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Message)) - { - builder.Append(" message: "); - if (Message.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Message}'''"); - } - else - { - builder.AppendLine($"'{Message}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBErrorResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosDBErrorResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.cs deleted file mode 100644 index 39831ff05b05..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Error Response. - public partial class CosmosDBErrorResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal CosmosDBErrorResult() - { - } - - /// Initializes a new instance of . - /// Error code. - /// Error message indicating why the operation failed. - /// Keeps track of any properties unknown to the library. - internal CosmosDBErrorResult(string code, string message, IDictionary serializedAdditionalRawData) - { - Code = code; - Message = message; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Error code. - [WirePath("code")] - public string Code { get; } - /// Error message indicating why the operation failed. - [WirePath("message")] - public string Message { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMinimalTlsVersion.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMinimalTlsVersion.cs index 36694ae838ab..4aa6f13733b0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMinimalTlsVersion.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMinimalTlsVersion.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. public readonly partial struct CosmosDBMinimalTlsVersion : IEquatable { private readonly string _value; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs index 9385b94c6057..58ed9b8e2b8f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -76,7 +70,6 @@ internal static CosmosDBSqlContainerCreateOrUpdateContent DeserializeCosmosDBSql { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -89,16 +82,6 @@ internal static CosmosDBSqlContainerCreateOrUpdateContent DeserializeCosmosDBSql Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,7 +166,6 @@ internal static CosmosDBSqlContainerCreateOrUpdateContent DeserializeCosmosDBSql location, resource, options0, - identity, serializedAdditionalRawData); } @@ -270,21 +252,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.cs index 93ebed35b8c1..bc52ada406d3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlContainerCreateOrUpdateContent(AzureLocation location, CosmosD /// The location. /// The standard JSON format of a container. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlContainerCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlContainerResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlContainerCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlContainerResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlContainerCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs index 6b5af4b2b70f..7a58c6882ba7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs @@ -83,11 +83,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("createMode"u8); writer.WriteStringValue(CreateMode.Value.ToString()); } - if (Optional.IsDefined(MaterializedViewDefinition)) - { - writer.WritePropertyName("materializedViewDefinition"u8); - writer.WriteObjectValue(MaterializedViewDefinition, options); - } if (Optional.IsCollectionDefined(ComputedProperties)) { writer.WritePropertyName("computedProperties"u8); @@ -103,6 +98,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("vectorEmbeddingPolicy"u8); writer.WriteObjectValue(VectorEmbeddingPolicy, options); } + if (Optional.IsDefined(FullTextPolicy)) + { + writer.WritePropertyName("fullTextPolicy"u8); + writer.WriteObjectValue(FullTextPolicy, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -150,9 +150,9 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer long? analyticalStorageTtl = default; ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; - MaterializedViewDefinition materializedViewDefinition = default; IList computedProperties = default; VectorEmbeddingPolicy vectorEmbeddingPolicy = default; + FullTextPolicy fullTextPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -243,15 +243,6 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer createMode = new CosmosDBAccountCreateMode(property.Value.GetString()); continue; } - if (property.NameEquals("materializedViewDefinition"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value, options); - continue; - } if (property.NameEquals("computedProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -275,6 +266,15 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer vectorEmbeddingPolicy = VectorEmbeddingPolicy.DeserializeVectorEmbeddingPolicy(property.Value, options); continue; } + if (property.NameEquals("fullTextPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fullTextPolicy = FullTextPolicy.DeserializeFullTextPolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -292,9 +292,9 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties ?? new ChangeTrackingList(), vectorEmbeddingPolicy, + fullTextPolicy, serializedAdditionalRawData); } @@ -470,21 +470,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaterializedViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" materializedViewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(MaterializedViewDefinition)) - { - builder.Append(" materializedViewDefinition: "); - BicepSerializationHelpers.AppendChildObject(builder, MaterializedViewDefinition, options, 2, false, " materializedViewDefinition: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComputedProperties), out propertyOverride); if (hasPropertyOverride) { @@ -526,6 +511,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FullTextPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" fullTextPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FullTextPolicy)) + { + builder.Append(" fullTextPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, FullTextPolicy, options, 2, false, " fullTextPolicy: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs index 600ba7b32ccd..016865dfff53 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs @@ -67,11 +67,11 @@ public CosmosDBSqlContainerResourceInfo(string containerName) /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// The vector embedding policy for the container. + /// The FullText policy for the container. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList computedProperties, VectorEmbeddingPolicy vectorEmbeddingPolicy, IDictionary serializedAdditionalRawData) + internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, IList computedProperties, VectorEmbeddingPolicy vectorEmbeddingPolicy, FullTextPolicy fullTextPolicy, IDictionary serializedAdditionalRawData) { ContainerName = containerName; IndexingPolicy = indexingPolicy; @@ -83,9 +83,9 @@ internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexing AnalyticalStorageTtl = analyticalStorageTtl; RestoreParameters = restoreParameters; CreateMode = createMode; - MaterializedViewDefinition = materializedViewDefinition; ComputedProperties = computedProperties; VectorEmbeddingPolicy = vectorEmbeddingPolicy; + FullTextPolicy = fullTextPolicy; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -135,9 +135,6 @@ public IList UniqueKeys /// Enum to indicate the mode of resource creation. [WirePath("createMode")] public CosmosDBAccountCreateMode? CreateMode { get; set; } - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. - [WirePath("materializedViewDefinition")] - public MaterializedViewDefinition MaterializedViewDefinition { get; set; } /// List of computed properties. [WirePath("computedProperties")] public IList ComputedProperties { get; } @@ -154,5 +151,9 @@ public IList VectorEmbeddings return VectorEmbeddingPolicy.VectorEmbeddings; } } + + /// The FullText policy for the container. + [WirePath("fullTextPolicy")] + public FullTextPolicy FullTextPolicy { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs index 6fd81e87bb56..5111d0866461 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -76,7 +70,6 @@ internal static CosmosDBSqlDatabaseCreateOrUpdateContent DeserializeCosmosDBSqlD { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -89,16 +82,6 @@ internal static CosmosDBSqlDatabaseCreateOrUpdateContent DeserializeCosmosDBSqlD Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,7 +166,6 @@ internal static CosmosDBSqlDatabaseCreateOrUpdateContent DeserializeCosmosDBSqlD location, resource, options0, - identity, serializedAdditionalRawData); } @@ -270,21 +252,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.cs index 4ad9a4132deb..1c5cb4ee68d1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlDatabaseCreateOrUpdateContent(AzureLocation location, CosmosDB /// The location. /// The standard JSON format of a SQL database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlDatabaseCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs index 645c872d46fa..774755c270ee 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -76,7 +70,6 @@ internal static CosmosDBSqlStoredProcedureCreateOrUpdateContent DeserializeCosmo { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -89,16 +82,6 @@ internal static CosmosDBSqlStoredProcedureCreateOrUpdateContent DeserializeCosmo Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,7 +166,6 @@ internal static CosmosDBSqlStoredProcedureCreateOrUpdateContent DeserializeCosmo location, resource, options0, - identity, serializedAdditionalRawData); } @@ -270,21 +252,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.cs index 2cfc40ab5dfa..cd8b59e13e7b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlStoredProcedureCreateOrUpdateContent(AzureLocation location, C /// The location. /// The standard JSON format of a storedProcedure. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlStoredProcedureCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlStoredProcedureResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlStoredProcedureCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlStoredProcedureResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlStoredProcedureCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs index 8674a6db6c31..caf630802b77 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -76,7 +70,6 @@ internal static CosmosDBSqlTriggerCreateOrUpdateContent DeserializeCosmosDBSqlTr { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -89,16 +82,6 @@ internal static CosmosDBSqlTriggerCreateOrUpdateContent DeserializeCosmosDBSqlTr Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,7 +166,6 @@ internal static CosmosDBSqlTriggerCreateOrUpdateContent DeserializeCosmosDBSqlTr location, resource, options0, - identity, serializedAdditionalRawData); } @@ -270,21 +252,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.cs index b5ec82f9849f..890b4b29a41d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlTriggerCreateOrUpdateContent(AzureLocation location, CosmosDBS /// The location. /// The standard JSON format of a trigger. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlTriggerCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlTriggerResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlTriggerCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlTriggerResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlTriggerCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs index ace41d4a4bff..6a7f2873a0a2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -76,7 +70,6 @@ internal static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent DeserializeC { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -89,16 +82,6 @@ internal static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent DeserializeC Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,7 +166,6 @@ internal static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent DeserializeC location, resource, options0, - identity, serializedAdditionalRawData); } @@ -270,21 +252,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.cs index 9091d7a2d98e..8ff656a56c9c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(AzureLocation locatio /// The location. /// The standard JSON format of a userDefinedFunction. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlUserDefinedFunctionResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlUserDefinedFunctionResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs index c76d86492910..df2983e849b6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs @@ -27,10 +27,6 @@ public CosmosDBStatus(string value) private const string InternallyReadyValue = "InternallyReady"; private const string OnlineValue = "Online"; private const string DeletingValue = "Deleting"; - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; - private const string UpdatingValue = "Updating"; /// Uninitialized. public static CosmosDBStatus Uninitialized { get; } = new CosmosDBStatus(UninitializedValue); @@ -42,14 +38,6 @@ public CosmosDBStatus(string value) public static CosmosDBStatus Online { get; } = new CosmosDBStatus(OnlineValue); /// Deleting. public static CosmosDBStatus Deleting { get; } = new CosmosDBStatus(DeletingValue); - /// Succeeded. - public static CosmosDBStatus Succeeded { get; } = new CosmosDBStatus(SucceededValue); - /// Failed. - public static CosmosDBStatus Failed { get; } = new CosmosDBStatus(FailedValue); - /// Canceled. - public static CosmosDBStatus Canceled { get; } = new CosmosDBStatus(CanceledValue); - /// Updating. - public static CosmosDBStatus Updating { get; } = new CosmosDBStatus(UpdatingValue); /// Determines if two values are the same. public static bool operator ==(CosmosDBStatus left, CosmosDBStatus right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs index 6ccb1e6d48ea..da6023f0a940 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -76,7 +70,6 @@ internal static CosmosDBTableCreateOrUpdateContent DeserializeCosmosDBTableCreat { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -89,16 +82,6 @@ internal static CosmosDBTableCreateOrUpdateContent DeserializeCosmosDBTableCreat Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,7 +166,6 @@ internal static CosmosDBTableCreateOrUpdateContent DeserializeCosmosDBTableCreat location, resource, options0, - identity, serializedAdditionalRawData); } @@ -270,21 +252,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.cs index ef312eb5d395..4d9b419dd115 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBTableCreateOrUpdateContent(AzureLocation location, CosmosDBTableR /// The location. /// The standard JSON format of a Table. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBTableCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBTableResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBTableCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBTableResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBTableCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableRolePermission.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableRolePermission.Serialization.cs deleted file mode 100644 index 15900e4e2bff..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableRolePermission.Serialization.cs +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosDBTableRolePermission : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBTableRolePermission)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsCollectionDefined(DataActions)) - { - writer.WritePropertyName("dataActions"u8); - writer.WriteStartArray(); - foreach (var item in DataActions) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(NotDataActions)) - { - writer.WritePropertyName("notDataActions"u8); - writer.WriteStartArray(); - foreach (var item in NotDataActions) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - CosmosDBTableRolePermission IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBTableRolePermission)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBTableRolePermission(document.RootElement, options); - } - - internal static CosmosDBTableRolePermission DeserializeCosmosDBTableRolePermission(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - IList dataActions = default; - IList notDataActions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("dataActions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - dataActions = array; - continue; - } - if (property.NameEquals("notDataActions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - notDataActions = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBTableRolePermission(id, dataActions ?? new ChangeTrackingList(), notDataActions ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DataActions), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" dataActions: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(DataActions)) - { - if (DataActions.Any()) - { - builder.Append(" dataActions: "); - builder.AppendLine("["); - foreach (var item in DataActions) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NotDataActions), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" notDataActions: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(NotDataActions)) - { - if (NotDataActions.Any()) - { - builder.Append(" notDataActions: "); - builder.AppendLine("["); - foreach (var item in NotDataActions) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBTableRolePermission)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBTableRolePermission IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosDBTableRolePermission(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBTableRolePermission)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableRolePermission.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableRolePermission.cs deleted file mode 100644 index 60e584cb6d41..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableRolePermission.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The set of data plane operations permitted through this Role Definition. - public partial class CosmosDBTableRolePermission - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CosmosDBTableRolePermission() - { - DataActions = new ChangeTrackingList(); - NotDataActions = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id for the permission. - /// An array of data actions that are allowed. - /// An array of data actions that are denied. - /// Keeps track of any properties unknown to the library. - internal CosmosDBTableRolePermission(string id, IList dataActions, IList notDataActions, IDictionary serializedAdditionalRawData) - { - Id = id; - DataActions = dataActions; - NotDataActions = notDataActions; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The id for the permission. - [WirePath("id")] - public string Id { get; set; } - /// An array of data actions that are allowed. - [WirePath("dataActions")] - public IList DataActions { get; } - /// An array of data actions that are denied. - [WirePath("notDataActions")] - public IList NotDataActions { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputBucket.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputBucket.Serialization.cs deleted file mode 100644 index 04d1f6c31679..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputBucket.Serialization.cs +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosDBThroughputBucket : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputBucket)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("id"u8); - writer.WriteNumberValue(Id); - writer.WritePropertyName("maxThroughputPercentage"u8); - writer.WriteNumberValue(MaxThroughputPercentage); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - CosmosDBThroughputBucket IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputBucket)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBThroughputBucket(document.RootElement, options); - } - - internal static CosmosDBThroughputBucket DeserializeCosmosDBThroughputBucket(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int id = default; - int maxThroughputPercentage = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThroughputPercentage"u8)) - { - maxThroughputPercentage = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBThroughputBucket(id, maxThroughputPercentage, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" id: "); - builder.AppendLine($"{Id}"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxThroughputPercentage), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" maxThroughputPercentage: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" maxThroughputPercentage: "); - builder.AppendLine($"{MaxThroughputPercentage}"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputBucket)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBThroughputBucket IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosDBThroughputBucket(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputBucket)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputBucket.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputBucket.cs deleted file mode 100644 index 58945da62327..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputBucket.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Cosmos DB throughput bucket object. - public partial class CosmosDBThroughputBucket - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Represents the throughput bucket id. - /// Represents maximum percentage throughput that can be used by the bucket. - public CosmosDBThroughputBucket(int id, int maxThroughputPercentage) - { - Id = id; - MaxThroughputPercentage = maxThroughputPercentage; - } - - /// Initializes a new instance of . - /// Represents the throughput bucket id. - /// Represents maximum percentage throughput that can be used by the bucket. - /// Keeps track of any properties unknown to the library. - internal CosmosDBThroughputBucket(int id, int maxThroughputPercentage, IDictionary serializedAdditionalRawData) - { - Id = id; - MaxThroughputPercentage = maxThroughputPercentage; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CosmosDBThroughputBucket() - { - } - - /// Represents the throughput bucket id. - [WirePath("id")] - public int Id { get; set; } - /// Represents maximum percentage throughput that can be used by the bucket. - [WirePath("maxThroughputPercentage")] - public int MaxThroughputPercentage { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs deleted file mode 100644 index 0acf20d44354..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosDBThroughputPoolPatch : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsDefined(MaxThroughput)) - { - writer.WritePropertyName("maxThroughput"u8); - writer.WriteNumberValue(MaxThroughput.Value); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - CosmosDBThroughputPoolPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBThroughputPoolPatch(document.RootElement, options); - } - - internal static CosmosDBThroughputPoolPatch DeserializeCosmosDBThroughputPoolPatch(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - CosmosDBStatus? provisioningState = default; - int? maxThroughput = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new CosmosDBStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("maxThroughput"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxThroughput = property0.Value.GetInt32(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBThroughputPoolPatch(provisioningState, maxThroughput, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBThroughputPoolPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosDBThroughputPoolPatch(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.cs deleted file mode 100644 index b1d54c8f96ce..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Represents a throughput pool resource for updates. - public partial class CosmosDBThroughputPoolPatch - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CosmosDBThroughputPoolPatch() - { - } - - /// Initializes a new instance of . - /// A provisioning state of the ThroughputPool. - /// Value for throughput to be shared among CosmosDB resources in the pool. - /// Keeps track of any properties unknown to the library. - internal CosmosDBThroughputPoolPatch(CosmosDBStatus? provisioningState, int? maxThroughput, IDictionary serializedAdditionalRawData) - { - ProvisioningState = provisioningState; - MaxThroughput = maxThroughput; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// A provisioning state of the ThroughputPool. - [WirePath("properties.provisioningState")] - public CosmosDBStatus? ProvisioningState { get; set; } - /// Value for throughput to be shared among CosmosDB resources in the pool. - [WirePath("properties.maxThroughput")] - public int? MaxThroughput { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index 798f036ecca9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosMongoDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("databaseName"u8); - writer.WriteStringValue(DatabaseName); - writer.WritePropertyName("collectionName"u8); - writer.WriteStringValue(CollectionName); - } - - CosmosMongoDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosMongoDataTransferDataSourceSink(document.RootElement, options); - } - - internal static CosmosMongoDataTransferDataSourceSink DeserializeCosmosMongoDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string databaseName = default; - string collectionName = default; - string remoteAccountName = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("databaseName"u8)) - { - databaseName = property.Value.GetString(); - continue; - } - if (property.NameEquals("collectionName"u8)) - { - collectionName = property.Value.GetString(); - continue; - } - if (property.NameEquals("remoteAccountName"u8)) - { - remoteAccountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosMongoDataTransferDataSourceSink(component, serializedAdditionalRawData, remoteAccountName, databaseName, collectionName); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" databaseName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DatabaseName)) - { - builder.Append(" databaseName: "); - if (DatabaseName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{DatabaseName}'''"); - } - else - { - builder.AppendLine($"'{DatabaseName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CollectionName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" collectionName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CollectionName)) - { - builder.Append(" collectionName: "); - if (CollectionName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{CollectionName}'''"); - } - else - { - builder.AppendLine($"'{CollectionName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" remoteAccountName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RemoteAccountName)) - { - builder.Append(" remoteAccountName: "); - if (RemoteAccountName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RemoteAccountName}'''"); - } - else - { - builder.AppendLine($"'{RemoteAccountName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - CosmosMongoDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosMongoDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs deleted file mode 100644 index 1f4eb9086d73..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A CosmosDB Mongo API data source/sink. - public partial class CosmosMongoDataTransferDataSourceSink : BaseCosmosDataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// - /// or is null. - public CosmosMongoDataTransferDataSourceSink(string databaseName, string collectionName) - { - Argument.AssertNotNull(databaseName, nameof(databaseName)); - Argument.AssertNotNull(collectionName, nameof(collectionName)); - - DatabaseName = databaseName; - CollectionName = collectionName; - Component = DataTransferComponent.CosmosDBMongo; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - /// - internal CosmosMongoDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string remoteAccountName, string databaseName, string collectionName) : base(component, serializedAdditionalRawData, remoteAccountName) - { - DatabaseName = databaseName; - CollectionName = collectionName; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal CosmosMongoDataTransferDataSourceSink() - { - } - - /// Gets or sets the database name. - [WirePath("databaseName")] - public string DatabaseName { get; set; } - /// Gets or sets the collection name. - [WirePath("collectionName")] - public string CollectionName { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoVCoreDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoVCoreDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index 8a7c8871b789..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoVCoreDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosMongoVCoreDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosMongoVCoreDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("databaseName"u8); - writer.WriteStringValue(DatabaseName); - writer.WritePropertyName("collectionName"u8); - writer.WriteStringValue(CollectionName); - if (Optional.IsDefined(HostName)) - { - writer.WritePropertyName("hostName"u8); - writer.WriteStringValue(HostName); - } - if (Optional.IsDefined(ConnectionStringKeyVaultUri)) - { - writer.WritePropertyName("connectionStringKeyVaultUri"u8); - writer.WriteStringValue(ConnectionStringKeyVaultUri.AbsoluteUri); - } - } - - CosmosMongoVCoreDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosMongoVCoreDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosMongoVCoreDataTransferDataSourceSink(document.RootElement, options); - } - - internal static CosmosMongoVCoreDataTransferDataSourceSink DeserializeCosmosMongoVCoreDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string databaseName = default; - string collectionName = default; - string hostName = default; - Uri connectionStringKeyVaultUri = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("databaseName"u8)) - { - databaseName = property.Value.GetString(); - continue; - } - if (property.NameEquals("collectionName"u8)) - { - collectionName = property.Value.GetString(); - continue; - } - if (property.NameEquals("hostName"u8)) - { - hostName = property.Value.GetString(); - continue; - } - if (property.NameEquals("connectionStringKeyVaultUri"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - connectionStringKeyVaultUri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosMongoVCoreDataTransferDataSourceSink( - component, - serializedAdditionalRawData, - databaseName, - collectionName, - hostName, - connectionStringKeyVaultUri); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" databaseName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DatabaseName)) - { - builder.Append(" databaseName: "); - if (DatabaseName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{DatabaseName}'''"); - } - else - { - builder.AppendLine($"'{DatabaseName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CollectionName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" collectionName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CollectionName)) - { - builder.Append(" collectionName: "); - if (CollectionName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{CollectionName}'''"); - } - else - { - builder.AppendLine($"'{CollectionName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HostName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" hostName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(HostName)) - { - builder.Append(" hostName: "); - if (HostName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{HostName}'''"); - } - else - { - builder.AppendLine($"'{HostName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConnectionStringKeyVaultUri), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" connectionStringKeyVaultUri: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ConnectionStringKeyVaultUri)) - { - builder.Append(" connectionStringKeyVaultUri: "); - builder.AppendLine($"'{ConnectionStringKeyVaultUri.AbsoluteUri}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosMongoVCoreDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - CosmosMongoVCoreDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosMongoVCoreDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosMongoVCoreDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoVCoreDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoVCoreDataTransferDataSourceSink.cs deleted file mode 100644 index e41150c2ac52..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoVCoreDataTransferDataSourceSink.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A CosmosDB Mongo vCore API data source/sink. - public partial class CosmosMongoVCoreDataTransferDataSourceSink : DataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// - /// or is null. - public CosmosMongoVCoreDataTransferDataSourceSink(string databaseName, string collectionName) - { - Argument.AssertNotNull(databaseName, nameof(databaseName)); - Argument.AssertNotNull(collectionName, nameof(collectionName)); - - DatabaseName = databaseName; - CollectionName = collectionName; - Component = DataTransferComponent.CosmosDBMongoVCore; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - /// - /// - internal CosmosMongoVCoreDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string databaseName, string collectionName, string hostName, Uri connectionStringKeyVaultUri) : base(component, serializedAdditionalRawData) - { - DatabaseName = databaseName; - CollectionName = collectionName; - HostName = hostName; - ConnectionStringKeyVaultUri = connectionStringKeyVaultUri; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal CosmosMongoVCoreDataTransferDataSourceSink() - { - } - - /// Gets or sets the database name. - [WirePath("databaseName")] - public string DatabaseName { get; set; } - /// Gets or sets the collection name. - [WirePath("collectionName")] - public string CollectionName { get; set; } - /// Gets or sets the host name. - [WirePath("hostName")] - public string HostName { get; set; } - /// Gets or sets the connection string key vault uri. - [WirePath("connectionStringKeyVaultUri")] - public Uri ConnectionStringKeyVaultUri { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index 4908cdee97fe..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosSqlDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("databaseName"u8); - writer.WriteStringValue(DatabaseName); - writer.WritePropertyName("containerName"u8); - writer.WriteStringValue(ContainerName); - } - - CosmosSqlDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosSqlDataTransferDataSourceSink(document.RootElement, options); - } - - internal static CosmosSqlDataTransferDataSourceSink DeserializeCosmosSqlDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string databaseName = default; - string containerName = default; - string remoteAccountName = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("databaseName"u8)) - { - databaseName = property.Value.GetString(); - continue; - } - if (property.NameEquals("containerName"u8)) - { - containerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("remoteAccountName"u8)) - { - remoteAccountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosSqlDataTransferDataSourceSink(component, serializedAdditionalRawData, remoteAccountName, databaseName, containerName); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" databaseName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DatabaseName)) - { - builder.Append(" databaseName: "); - if (DatabaseName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{DatabaseName}'''"); - } - else - { - builder.AppendLine($"'{DatabaseName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" containerName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ContainerName)) - { - builder.Append(" containerName: "); - if (ContainerName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ContainerName}'''"); - } - else - { - builder.AppendLine($"'{ContainerName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" remoteAccountName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RemoteAccountName)) - { - builder.Append(" remoteAccountName: "); - if (RemoteAccountName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RemoteAccountName}'''"); - } - else - { - builder.AppendLine($"'{RemoteAccountName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - CosmosSqlDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeCosmosSqlDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.cs deleted file mode 100644 index 44cd8c46b05c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A CosmosDB No Sql API data source/sink. - public partial class CosmosSqlDataTransferDataSourceSink : BaseCosmosDataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// - /// or is null. - public CosmosSqlDataTransferDataSourceSink(string databaseName, string containerName) - { - Argument.AssertNotNull(databaseName, nameof(databaseName)); - Argument.AssertNotNull(containerName, nameof(containerName)); - - DatabaseName = databaseName; - ContainerName = containerName; - Component = DataTransferComponent.CosmosDBSql; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - /// - internal CosmosSqlDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string remoteAccountName, string databaseName, string containerName) : base(component, serializedAdditionalRawData, remoteAccountName) - { - DatabaseName = databaseName; - ContainerName = containerName; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal CosmosSqlDataTransferDataSourceSink() - { - } - - /// Gets or sets the database name. - [WirePath("databaseName")] - public string DatabaseName { get; set; } - /// Gets or sets the container name. - [WirePath("containerName")] - public string ContainerName { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs deleted file mode 100644 index 94ae1f605ed0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The DataTransferComponent. - internal readonly partial struct DataTransferComponent : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DataTransferComponent(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CosmosDBCassandraValue = "CosmosDBCassandra"; - private const string CosmosDBMongoValue = "CosmosDBMongo"; - private const string CosmosDBMongoVCoreValue = "CosmosDBMongoVCore"; - private const string CosmosDBSqlValue = "CosmosDBSql"; - private const string AzureBlobStorageValue = "AzureBlobStorage"; - - /// CosmosDBCassandra. - public static DataTransferComponent CosmosDBCassandra { get; } = new DataTransferComponent(CosmosDBCassandraValue); - /// CosmosDBMongo. - public static DataTransferComponent CosmosDBMongo { get; } = new DataTransferComponent(CosmosDBMongoValue); - /// CosmosDBMongoVCore. - public static DataTransferComponent CosmosDBMongoVCore { get; } = new DataTransferComponent(CosmosDBMongoVCoreValue); - /// CosmosDBSql. - public static DataTransferComponent CosmosDBSql { get; } = new DataTransferComponent(CosmosDBSqlValue); - /// AzureBlobStorage. - public static DataTransferComponent AzureBlobStorage { get; } = new DataTransferComponent(AzureBlobStorageValue); - /// Determines if two values are the same. - public static bool operator ==(DataTransferComponent left, DataTransferComponent right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DataTransferComponent left, DataTransferComponent right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator DataTransferComponent(string value) => new DataTransferComponent(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DataTransferComponent other && Equals(other); - /// - public bool Equals(DataTransferComponent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index ee74aa675171..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - [PersistableModelProxy(typeof(UnknownDataTransferDataSourceSink))] - public partial class DataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferDataSourceSink(document.RootElement, options); - } - - internal static DataTransferDataSourceSink DeserializeDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("component", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AzureBlobStorage": return AzureBlobDataTransferDataSourceSink.DeserializeAzureBlobDataTransferDataSourceSink(element, options); - case "BaseCosmosDataTransferDataSourceSink": return BaseCosmosDataTransferDataSourceSink.DeserializeBaseCosmosDataTransferDataSourceSink(element, options); - case "CosmosDBCassandra": return CosmosCassandraDataTransferDataSourceSink.DeserializeCosmosCassandraDataTransferDataSourceSink(element, options); - case "CosmosDBMongo": return CosmosMongoDataTransferDataSourceSink.DeserializeCosmosMongoDataTransferDataSourceSink(element, options); - case "CosmosDBMongoVCore": return CosmosMongoVCoreDataTransferDataSourceSink.DeserializeCosmosMongoVCoreDataTransferDataSourceSink(element, options); - case "CosmosDBSql": return CosmosSqlDataTransferDataSourceSink.DeserializeCosmosSqlDataTransferDataSourceSink(element, options); - } - } - return UnknownDataTransferDataSourceSink.DeserializeUnknownDataTransferDataSourceSink(element, options); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - DataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs deleted file mode 100644 index 1dab94d3fe59..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// - /// Base class for all DataTransfer source/sink - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - public abstract partial class DataTransferDataSourceSink - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - protected DataTransferDataSourceSink() - { - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal DataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData) - { - Component = component; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets or sets the component. - internal DataTransferComponent Component { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs deleted file mode 100644 index 91ddd9798ed8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class DataTransferJobFeedResults : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DataTransferJobFeedResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferJobFeedResults(document.RootElement, options); - } - - internal static DataTransferJobFeedResults DeserializeDataTransferJobFeedResults(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataTransferJobFeedResults(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support writing '{options.Format}' format."); - } - } - - DataTransferJobFeedResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDataTransferJobFeedResults(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.cs deleted file mode 100644 index fb232389dd51..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The List operation response, that contains the Data Transfer jobs and their properties. - internal partial class DataTransferJobFeedResults - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal DataTransferJobFeedResults() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of Data Transfer jobs and their properties. - /// URL to get the next set of Data Transfer job list results if there are any. - /// Keeps track of any properties unknown to the library. - internal DataTransferJobFeedResults(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of Data Transfer jobs and their properties. - public IReadOnlyList Value { get; } - /// URL to get the next set of Data Transfer job list results if there are any. - public string NextLink { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index 03831bd1712c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class DataTransferJobGetResultCreateOrUpdateContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - - DataTransferJobGetResultCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferJobGetResultCreateOrUpdateContent(document.RootElement, options); - } - - internal static DataTransferJobGetResultCreateOrUpdateContent DeserializeDataTransferJobGetResultCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DataTransferJobProperties properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - properties = DataTransferJobProperties.DeserializeDataTransferJobProperties(property.Value, options); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataTransferJobGetResultCreateOrUpdateContent( - id, - name, - type, - systemData, - properties, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" properties: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Properties)) - { - builder.Append(" properties: "); - BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support writing '{options.Format}' format."); - } - } - - DataTransferJobGetResultCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDataTransferJobGetResultCreateOrUpdateContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.cs deleted file mode 100644 index aa6b789a0c85..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Parameters to create Data Transfer Job. - public partial class DataTransferJobGetResultCreateOrUpdateContent : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Data Transfer Create Job Properties. - /// is null. - public DataTransferJobGetResultCreateOrUpdateContent(DataTransferJobProperties properties) - { - Argument.AssertNotNull(properties, nameof(properties)); - - Properties = properties; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Data Transfer Create Job Properties. - /// Keeps track of any properties unknown to the library. - internal DataTransferJobGetResultCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataTransferJobProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DataTransferJobGetResultCreateOrUpdateContent() - { - } - - /// Data Transfer Create Job Properties. - [WirePath("properties")] - public DataTransferJobProperties Properties { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobMode.cs deleted file mode 100644 index 0d208c16e658..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Mode of job execution. - public readonly partial struct DataTransferJobMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DataTransferJobMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OfflineValue = "Offline"; - private const string OnlineValue = "Online"; - - /// Offline. - public static DataTransferJobMode Offline { get; } = new DataTransferJobMode(OfflineValue); - /// Online. - public static DataTransferJobMode Online { get; } = new DataTransferJobMode(OnlineValue); - /// Determines if two values are the same. - public static bool operator ==(DataTransferJobMode left, DataTransferJobMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DataTransferJobMode left, DataTransferJobMode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator DataTransferJobMode(string value) => new DataTransferJobMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DataTransferJobMode other && Equals(other); - /// - public bool Equals(DataTransferJobMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs deleted file mode 100644 index 163883520fae..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs +++ /dev/null @@ -1,474 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class DataTransferJobProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsDefined(JobName)) - { - writer.WritePropertyName("jobName"u8); - writer.WriteStringValue(JobName); - } - writer.WritePropertyName("source"u8); - writer.WriteObjectValue(Source, options); - writer.WritePropertyName("destination"u8); - writer.WriteObjectValue(Destination, options); - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status); - } - if (options.Format != "W" && Optional.IsDefined(ProcessedCount)) - { - writer.WritePropertyName("processedCount"u8); - writer.WriteNumberValue(ProcessedCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(TotalCount)) - { - writer.WritePropertyName("totalCount"u8); - writer.WriteNumberValue(TotalCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(LastUpdatedUtcOn)) - { - writer.WritePropertyName("lastUpdatedUtcTime"u8); - writer.WriteStringValue(LastUpdatedUtcOn.Value, "O"); - } - if (Optional.IsDefined(WorkerCount)) - { - writer.WritePropertyName("workerCount"u8); - writer.WriteNumberValue(WorkerCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); - } - if (options.Format != "W" && Optional.IsDefined(Duration)) - { - writer.WritePropertyName("duration"u8); - writer.WriteStringValue(Duration.Value, "c"); - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DataTransferJobProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferJobProperties(document.RootElement, options); - } - - internal static DataTransferJobProperties DeserializeDataTransferJobProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string jobName = default; - DataTransferDataSourceSink source = default; - DataTransferDataSourceSink destination = default; - string status = default; - long? processedCount = default; - long? totalCount = default; - DateTimeOffset? lastUpdatedUtcTime = default; - int? workerCount = default; - CosmosDBErrorResult error = default; - TimeSpan? duration = default; - DataTransferJobMode? mode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("jobName"u8)) - { - jobName = property.Value.GetString(); - continue; - } - if (property.NameEquals("source"u8)) - { - source = DataTransferDataSourceSink.DeserializeDataTransferDataSourceSink(property.Value, options); - continue; - } - if (property.NameEquals("destination"u8)) - { - destination = DataTransferDataSourceSink.DeserializeDataTransferDataSourceSink(property.Value, options); - continue; - } - if (property.NameEquals("status"u8)) - { - status = property.Value.GetString(); - continue; - } - if (property.NameEquals("processedCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - processedCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("totalCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - totalCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("lastUpdatedUtcTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastUpdatedUtcTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("workerCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workerCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = CosmosDBErrorResult.DeserializeCosmosDBErrorResult(property.Value, options); - continue; - } - if (property.NameEquals("duration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - duration = property.Value.GetTimeSpan("c"); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new DataTransferJobMode(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataTransferJobProperties( - jobName, - source, - destination, - status, - processedCount, - totalCount, - lastUpdatedUtcTime, - workerCount, - error, - duration, - mode, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" jobName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(JobName)) - { - builder.Append(" jobName: "); - if (JobName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{JobName}'''"); - } - else - { - builder.AppendLine($"'{JobName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" source: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Source)) - { - builder.Append(" source: "); - BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destination), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" destination: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Destination)) - { - builder.Append(" destination: "); - BicepSerializationHelpers.AppendChildObject(builder, Destination, options, 2, false, " destination: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" status: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Status)) - { - builder.Append(" status: "); - if (Status.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Status}'''"); - } - else - { - builder.AppendLine($"'{Status}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" processedCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProcessedCount)) - { - builder.Append(" processedCount: "); - builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" totalCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(TotalCount)) - { - builder.Append(" totalCount: "); - builder.AppendLine($"'{TotalCount.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastUpdatedUtcOn), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" lastUpdatedUtcTime: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(LastUpdatedUtcOn)) - { - builder.Append(" lastUpdatedUtcTime: "); - var formattedDateTimeString = TypeFormatters.ToString(LastUpdatedUtcOn.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WorkerCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" workerCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(WorkerCount)) - { - builder.Append(" workerCount: "); - builder.AppendLine($"{WorkerCount.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" error: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Error)) - { - builder.Append(" error: "); - BicepSerializationHelpers.AppendChildObject(builder, Error, options, 2, false, " error: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Duration), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" duration: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Duration)) - { - builder.Append(" duration: "); - var formattedTimeSpan = TypeFormatters.ToString(Duration.Value, "P"); - builder.AppendLine($"'{formattedTimeSpan}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Mode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" mode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Mode)) - { - builder.Append(" mode: "); - builder.AppendLine($"'{Mode.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support writing '{options.Format}' format."); - } - } - - DataTransferJobProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDataTransferJobProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs deleted file mode 100644 index 24e7baae13c5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The properties of a DataTransfer Job. - public partial class DataTransferJobProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - /// or is null. - public DataTransferJobProperties(DataTransferDataSourceSink source, DataTransferDataSourceSink destination) - { - Argument.AssertNotNull(source, nameof(source)); - Argument.AssertNotNull(destination, nameof(destination)); - - Source = source; - Destination = destination; - } - - /// Initializes a new instance of . - /// Job Name. - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - /// Job Status. - /// Processed Count. - /// Total Count. - /// Last Updated Time (ISO-8601 format). - /// Worker count. - /// Error response for Faulted job. - /// Total Duration of Job. - /// Mode of job execution. - /// Keeps track of any properties unknown to the library. - internal DataTransferJobProperties(string jobName, DataTransferDataSourceSink source, DataTransferDataSourceSink destination, string status, long? processedCount, long? totalCount, DateTimeOffset? lastUpdatedUtcOn, int? workerCount, CosmosDBErrorResult error, TimeSpan? duration, DataTransferJobMode? mode, IDictionary serializedAdditionalRawData) - { - JobName = jobName; - Source = source; - Destination = destination; - Status = status; - ProcessedCount = processedCount; - TotalCount = totalCount; - LastUpdatedUtcOn = lastUpdatedUtcOn; - WorkerCount = workerCount; - Error = error; - Duration = duration; - Mode = mode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DataTransferJobProperties() - { - } - - /// Job Name. - [WirePath("jobName")] - public string JobName { get; } - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - [WirePath("source")] - public DataTransferDataSourceSink Source { get; set; } - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - [WirePath("destination")] - public DataTransferDataSourceSink Destination { get; set; } - /// Job Status. - [WirePath("status")] - public string Status { get; } - /// Processed Count. - [WirePath("processedCount")] - public long? ProcessedCount { get; } - /// Total Count. - [WirePath("totalCount")] - public long? TotalCount { get; } - /// Last Updated Time (ISO-8601 format). - [WirePath("lastUpdatedUtcTime")] - public DateTimeOffset? LastUpdatedUtcOn { get; } - /// Worker count. - [WirePath("workerCount")] - public int? WorkerCount { get; set; } - /// Error response for Faulted job. - [WirePath("error")] - public CosmosDBErrorResult Error { get; } - /// Total Duration of Job. - [WirePath("duration")] - public TimeSpan? Duration { get; } - /// Mode of job execution. - [WirePath("mode")] - public DataTransferJobMode? Mode { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DefaultPriorityLevel.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DefaultPriorityLevel.cs deleted file mode 100644 index e86d3758385b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DefaultPriorityLevel.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Enum to indicate default priorityLevel of requests. - public readonly partial struct DefaultPriorityLevel : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DefaultPriorityLevel(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string HighValue = "High"; - private const string LowValue = "Low"; - - /// High. - public static DefaultPriorityLevel High { get; } = new DefaultPriorityLevel(HighValue); - /// Low. - public static DefaultPriorityLevel Low { get; } = new DefaultPriorityLevel(LowValue); - /// Determines if two values are the same. - public static bool operator ==(DefaultPriorityLevel left, DefaultPriorityLevel right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DefaultPriorityLevel left, DefaultPriorityLevel right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator DefaultPriorityLevel(string value) => new DefaultPriorityLevel(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DefaultPriorityLevel other && Equals(other); - /// - public bool Equals(DefaultPriorityLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs deleted file mode 100644 index 050240204197..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class DiagnosticLogSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(EnableFullTextQuery)) - { - writer.WritePropertyName("enableFullTextQuery"u8); - writer.WriteStringValue(EnableFullTextQuery.Value.ToSerialString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - DiagnosticLogSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDiagnosticLogSettings(document.RootElement, options); - } - - internal static DiagnosticLogSettings DeserializeDiagnosticLogSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - EnableFullTextQuery? enableFullTextQuery = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enableFullTextQuery"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableFullTextQuery = property.Value.GetString().ToEnableFullTextQuery(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DiagnosticLogSettings(enableFullTextQuery, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableFullTextQuery), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enableFullTextQuery: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnableFullTextQuery)) - { - builder.Append(" enableFullTextQuery: "); - builder.AppendLine($"'{EnableFullTextQuery.Value.ToSerialString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support writing '{options.Format}' format."); - } - } - - DiagnosticLogSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDiagnosticLogSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.cs deleted file mode 100644 index b06a52a0eccd..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Indicates what diagnostic log settings are to be enabled. - internal partial class DiagnosticLogSettings - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public DiagnosticLogSettings() - { - } - - /// Initializes a new instance of . - /// Describe the level of detail with which queries are to be logged. - /// Keeps track of any properties unknown to the library. - internal DiagnosticLogSettings(EnableFullTextQuery? enableFullTextQuery, IDictionary serializedAdditionalRawData) - { - EnableFullTextQuery = enableFullTextQuery; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Describe the level of detail with which queries are to be logged. - [WirePath("enableFullTextQuery")] - public EnableFullTextQuery? EnableFullTextQuery { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.Serialization.cs deleted file mode 100644 index f17d5acd7bf8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal static partial class EnableFullTextQueryExtensions - { - public static string ToSerialString(this EnableFullTextQuery value) => value switch - { - EnableFullTextQuery.None => "None", - EnableFullTextQuery.True => "True", - EnableFullTextQuery.False => "False", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown EnableFullTextQuery value.") - }; - - public static EnableFullTextQuery ToEnableFullTextQuery(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "None")) return EnableFullTextQuery.None; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "True")) return EnableFullTextQuery.True; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "False")) return EnableFullTextQuery.False; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown EnableFullTextQuery value."); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.cs deleted file mode 100644 index e851f23ff12e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Describe the level of detail with which queries are to be logged. - public enum EnableFullTextQuery - { - /// None. - None, - /// True. - True, - /// False. - False - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs index 6a5afd63a592..4fab4f2815fd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs @@ -87,9 +87,9 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm long? analyticalStorageTtl = default; ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; - MaterializedViewDefinition materializedViewDefinition = default; IList computedProperties = default; VectorEmbeddingPolicy vectorEmbeddingPolicy = default; + FullTextPolicy fullTextPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -203,15 +203,6 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm createMode = new CosmosDBAccountCreateMode(property.Value.GetString()); continue; } - if (property.NameEquals("materializedViewDefinition"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value, options); - continue; - } if (property.NameEquals("computedProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -235,6 +226,15 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm vectorEmbeddingPolicy = VectorEmbeddingPolicy.DeserializeVectorEmbeddingPolicy(property.Value, options); continue; } + if (property.NameEquals("fullTextPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fullTextPolicy = FullTextPolicy.DeserializeFullTextPolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -252,9 +252,9 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties ?? new ChangeTrackingList(), vectorEmbeddingPolicy, + fullTextPolicy, serializedAdditionalRawData, rid, ts, @@ -486,21 +486,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaterializedViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" materializedViewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(MaterializedViewDefinition)) - { - builder.Append(" materializedViewDefinition: "); - BicepSerializationHelpers.AppendChildObject(builder, MaterializedViewDefinition, options, 2, false, " materializedViewDefinition: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComputedProperties), out propertyOverride); if (hasPropertyOverride) { @@ -542,6 +527,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FullTextPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" fullTextPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FullTextPolicy)) + { + builder.Append(" fullTextPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, FullTextPolicy, options, 2, false, " fullTextPolicy: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs index 9ab7b3339c3e..eff70e21cae1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs @@ -32,14 +32,14 @@ public ExtendedCosmosDBSqlContainerResourceInfo(string containerName) : base(con /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// The vector embedding policy for the container. + /// The FullText policy for the container. /// Keeps track of any properties unknown to the library. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. - internal ExtendedCosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList computedProperties, VectorEmbeddingPolicy vectorEmbeddingPolicy, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, computedProperties, vectorEmbeddingPolicy, serializedAdditionalRawData) + internal ExtendedCosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, IList computedProperties, VectorEmbeddingPolicy vectorEmbeddingPolicy, FullTextPolicy fullTextPolicy, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, computedProperties, vectorEmbeddingPolicy, fullTextPolicy, serializedAdditionalRawData) { Rid = rid; Timestamp = timestamp; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedThroughputSettingsResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedThroughputSettingsResourceInfo.Serialization.cs index 36b253913f3c..6c841471ff58 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedThroughputSettingsResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedThroughputSettingsResourceInfo.Serialization.cs @@ -8,7 +8,6 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; -using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -83,7 +82,6 @@ internal static ExtendedThroughputSettingsResourceInfo DeserializeExtendedThroug string offerReplacePending = default; string instantMaximumThroughput = default; string softAllowedMaximumThroughput = default; - IList throughputBuckets = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -149,20 +147,6 @@ internal static ExtendedThroughputSettingsResourceInfo DeserializeExtendedThroug softAllowedMaximumThroughput = property.Value.GetString(); continue; } - if (property.NameEquals("throughputBuckets"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CosmosDBThroughputBucket.DeserializeCosmosDBThroughputBucket(item, options)); - } - throughputBuckets = array; - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -176,7 +160,6 @@ internal static ExtendedThroughputSettingsResourceInfo DeserializeExtendedThroug offerReplacePending, instantMaximumThroughput, softAllowedMaximumThroughput, - throughputBuckets ?? new ChangeTrackingList(), serializedAdditionalRawData, rid, ts, @@ -369,29 +352,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ThroughputBuckets), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughputBuckets: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(ThroughputBuckets)) - { - if (ThroughputBuckets.Any()) - { - builder.Append(" throughputBuckets: "); - builder.AppendLine("["); - foreach (var item in ThroughputBuckets) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " throughputBuckets: "); - } - builder.AppendLine(" ]"); - } - } - } - builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedThroughputSettingsResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedThroughputSettingsResourceInfo.cs index e242531e3a18..df4bd6a98239 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedThroughputSettingsResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedThroughputSettingsResourceInfo.cs @@ -25,12 +25,11 @@ public ExtendedThroughputSettingsResourceInfo() /// The throughput replace is pending. /// The offer throughput value to instantly scale up without triggering splits. /// The maximum throughput value or the maximum maxThroughput value (for autoscale) that can be specified. - /// Array of Throughput Bucket limits to be applied to the Cosmos DB container. /// Keeps track of any properties unknown to the library. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. - internal ExtendedThroughputSettingsResourceInfo(int? throughput, AutoscaleSettingsResourceInfo autoscaleSettings, string minimumThroughput, string offerReplacePending, string instantMaximumThroughput, string softAllowedMaximumThroughput, IList throughputBuckets, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(throughput, autoscaleSettings, minimumThroughput, offerReplacePending, instantMaximumThroughput, softAllowedMaximumThroughput, throughputBuckets, serializedAdditionalRawData) + internal ExtendedThroughputSettingsResourceInfo(int? throughput, AutoscaleSettingsResourceInfo autoscaleSettings, string minimumThroughput, string offerReplacePending, string instantMaximumThroughput, string softAllowedMaximumThroughput, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(throughput, autoscaleSettings, minimumThroughput, offerReplacePending, instantMaximumThroughput, softAllowedMaximumThroughput, serializedAdditionalRawData) { Rid = rid; Timestamp = timestamp; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPath.Serialization.cs similarity index 60% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs rename to sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPath.Serialization.cs index a7886d64de2d..19c10fccd11a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPath.Serialization.cs @@ -8,18 +8,17 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; -using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; namespace Azure.ResourceManager.CosmosDB.Models { - internal partial class ListCommands : IUtf8JsonSerializable, IJsonModel + public partial class FullTextPath : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -30,21 +29,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ListCommands)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FullTextPath)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + if (Optional.IsDefined(Language)) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -63,19 +59,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ListCommands IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FullTextPath IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ListCommands)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FullTextPath)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeListCommands(document.RootElement, options); + return DeserializeFullTextPath(document.RootElement, options); } - internal static ListCommands DeserializeListCommands(JsonElement element, ModelReaderWriterOptions options = null) + internal static FullTextPath DeserializeFullTextPath(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,23 +79,20 @@ internal static ListCommands DeserializeListCommands(JsonElement element, ModelR { return null; } - IReadOnlyList value = default; + string path = default; + string language = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (property.NameEquals("path"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CassandraClusterCommand.DeserializeCassandraClusterCommand(item, options)); - } - value = array; + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); continue; } if (options.Format != "W") @@ -108,7 +101,7 @@ internal static ListCommands DeserializeListCommands(JsonElement element, ModelR } } serializedAdditionalRawData = rawDataDictionary; - return new ListCommands(value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new FullTextPath(path, language, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -122,25 +115,48 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Path), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" value: "); + builder.Append(" path: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsCollectionDefined(Value)) + if (Optional.IsDefined(Path)) { - if (Value.Any()) + builder.Append(" path: "); + if (Path.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Path}'''"); + } + else + { + builder.AppendLine($"'{Path}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Language), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" language: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Language)) + { + builder.Append(" language: "); + if (Language.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Language}'''"); + } + else { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); + builder.AppendLine($"'{Language}'"); } } } @@ -149,9 +165,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -160,26 +176,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions option case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ListCommands)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FullTextPath)} does not support writing '{options.Format}' format."); } } - ListCommands IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FullTextPath IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeListCommands(document.RootElement, options); + return DeserializeFullTextPath(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ListCommands)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FullTextPath)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPath.cs similarity index 57% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs rename to sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPath.cs index 966c4d6682bb..d58343551865 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPath.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// PhysicalPartitionThroughputInfo object. - public partial class PhysicalPartitionThroughputInfoResource + /// Represents the full text path specification. + public partial class FullTextPath { /// /// Keeps track of any properties unknown to the library. @@ -45,37 +45,37 @@ public partial class PhysicalPartitionThroughputInfoResource /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// Id of a physical partition. - /// is null. - public PhysicalPartitionThroughputInfoResource(string id) + /// Initializes a new instance of . + /// The path to the full text field in the document. + /// is null. + public FullTextPath(string path) { - Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(path, nameof(path)); - Id = id; + Path = path; } - /// Initializes a new instance of . - /// Id of a physical partition. - /// Throughput of a physical partition. + /// Initializes a new instance of . + /// The path to the full text field in the document. + /// The language of the full text field in the document. /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoResource(string id, double? throughput, IDictionary serializedAdditionalRawData) + internal FullTextPath(string path, string language, IDictionary serializedAdditionalRawData) { - Id = id; - Throughput = throughput; + Path = path; + Language = language; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal PhysicalPartitionThroughputInfoResource() + /// Initializes a new instance of for deserialization. + internal FullTextPath() { } - /// Id of a physical partition. - [WirePath("id")] - public string Id { get; set; } - /// Throughput of a physical partition. - [WirePath("throughput")] - public double? Throughput { get; set; } + /// The path to the full text field in the document. + [WirePath("path")] + public string Path { get; set; } + /// The language of the full text field in the document. + [WirePath("language")] + public string Language { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ChaosFaultListResponse.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPolicy.Serialization.cs similarity index 60% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ChaosFaultListResponse.Serialization.cs rename to sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPolicy.Serialization.cs index 3a73c7d21e2e..03cb919d60d3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ChaosFaultListResponse.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPolicy.Serialization.cs @@ -15,11 +15,11 @@ namespace Azure.ResourceManager.CosmosDB.Models { - internal partial class ChaosFaultListResponse : IUtf8JsonSerializable, IJsonModel + public partial class FullTextPolicy : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -30,27 +30,27 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ChaosFaultListResponse)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(FullTextPolicy)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + if (Optional.IsDefined(DefaultLanguage)) { - writer.WritePropertyName("value"u8); + writer.WritePropertyName("defaultLanguage"u8); + writer.WriteStringValue(DefaultLanguage); + } + if (Optional.IsCollectionDefined(FullTextPaths)) + { + writer.WritePropertyName("fullTextPaths"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (var item in FullTextPaths) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -68,19 +68,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ChaosFaultListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + FullTextPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ChaosFaultListResponse)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(FullTextPolicy)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChaosFaultListResponse(document.RootElement, options); + return DeserializeFullTextPolicy(document.RootElement, options); } - internal static ChaosFaultListResponse DeserializeChaosFaultListResponse(JsonElement element, ModelReaderWriterOptions options = null) + internal static FullTextPolicy DeserializeFullTextPolicy(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -88,29 +88,29 @@ internal static ChaosFaultListResponse DeserializeChaosFaultListResponse(JsonEle { return null; } - IReadOnlyList value = default; - string nextLink = default; + string defaultLanguage = default; + IList fullTextPaths = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (property.NameEquals("defaultLanguage"u8)) + { + defaultLanguage = property.Value.GetString(); + continue; + } + if (property.NameEquals("fullTextPaths"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(CosmosDBChaosFaultResourceData.DeserializeCosmosDBChaosFaultResourceData(item, options)); + array.Add(FullTextPath.DeserializeFullTextPath(item, options)); } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); + fullTextPaths = array; continue; } if (options.Format != "W") @@ -119,7 +119,7 @@ internal static ChaosFaultListResponse DeserializeChaosFaultListResponse(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new ChaosFaultListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new FullTextPolicy(defaultLanguage, fullTextPaths ?? new ChangeTrackingList(), serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -133,48 +133,48 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DefaultLanguage), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" value: "); + builder.Append(" defaultLanguage: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsCollectionDefined(Value)) + if (Optional.IsDefined(DefaultLanguage)) { - if (Value.Any()) + builder.Append(" defaultLanguage: "); + if (DefaultLanguage.Contains(Environment.NewLine)) { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); + builder.AppendLine("'''"); + builder.AppendLine($"{DefaultLanguage}'''"); + } + else + { + builder.AppendLine($"'{DefaultLanguage}'"); } } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FullTextPaths), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" nextLink: "); + builder.Append(" fullTextPaths: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(NextLink)) + if (Optional.IsCollectionDefined(FullTextPaths)) { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) + if (FullTextPaths.Any()) { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); + builder.Append(" fullTextPaths: "); + builder.AppendLine("["); + foreach (var item in FullTextPaths) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " fullTextPaths: "); + } + builder.AppendLine(" ]"); } } } @@ -183,9 +183,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -194,26 +194,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ChaosFaultListResponse)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(FullTextPolicy)} does not support writing '{options.Format}' format."); } } - ChaosFaultListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + FullTextPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeChaosFaultListResponse(document.RootElement, options); + return DeserializeFullTextPolicy(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ChaosFaultListResponse)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(FullTextPolicy)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPolicy.cs similarity index 63% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.cs rename to sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPolicy.cs index 960002eccee0..0dec4264e4c1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPolicy.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// The List operation response, that contains the Graph resource and their properties. - internal partial class GraphResourcesListResult + /// Cosmos DB FullText Policy. + public partial class FullTextPolicy { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +45,28 @@ internal partial class GraphResourcesListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal GraphResourcesListResult() + /// Initializes a new instance of . + public FullTextPolicy() { - Value = new ChangeTrackingList(); + FullTextPaths = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// List of Graph resource and their properties. + /// Initializes a new instance of . + /// The default language for a full text paths. + /// List of FullText Paths. /// Keeps track of any properties unknown to the library. - internal GraphResourcesListResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal FullTextPolicy(string defaultLanguage, IList fullTextPaths, IDictionary serializedAdditionalRawData) { - Value = value; + DefaultLanguage = defaultLanguage; + FullTextPaths = fullTextPaths; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Graph resource and their properties. - public IReadOnlyList Value { get; } + /// The default language for a full text paths. + [WirePath("defaultLanguage")] + public string DefaultLanguage { get; set; } + /// List of FullText Paths. + [WirePath("fullTextPaths")] + public IList FullTextPaths { get; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs deleted file mode 100644 index 9ee8710440cc..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class GraphResourceGetPropertiesOptions : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - GraphResourceGetPropertiesOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGraphResourceGetPropertiesOptions(document.RootElement, options); - } - - internal static GraphResourceGetPropertiesOptions DeserializeGraphResourceGetPropertiesOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? throughput = default; - AutoscaleSettings autoscaleSettings = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("throughput"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - throughput = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("autoscaleSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoscaleSettings = AutoscaleSettings.DeserializeAutoscaleSettings(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GraphResourceGetPropertiesOptions(throughput, autoscaleSettings, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Throughput), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughput: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Throughput)) - { - builder.Append(" throughput: "); - builder.AppendLine($"{Throughput.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("AutoscaleMaxThroughput", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" autoscaleSettings: "); - builder.AppendLine("{"); - builder.Append(" maxThroughput: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(AutoscaleSettings)) - { - builder.Append(" autoscaleSettings: "); - BicepSerializationHelpers.AppendChildObject(builder, AutoscaleSettings, options, 2, false, " autoscaleSettings: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support writing '{options.Format}' format."); - } - } - - GraphResourceGetPropertiesOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeGraphResourceGetPropertiesOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.cs deleted file mode 100644 index 666a18bb117a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The GraphResourceGetPropertiesOptions. - public partial class GraphResourceGetPropertiesOptions : CosmosDBBaseConfig - { - /// Initializes a new instance of . - public GraphResourceGetPropertiesOptions() - { - } - - /// Initializes a new instance of . - /// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. - /// Specifies the Autoscale settings. - /// Keeps track of any properties unknown to the library. - internal GraphResourceGetPropertiesOptions(int? throughput, AutoscaleSettings autoscaleSettings, IDictionary serializedAdditionalRawData) : base(throughput, autoscaleSettings, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index 892f2ff9e843..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class GraphResourceGetResultCreateOrUpdateContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("resource"u8); - JsonSerializer.Serialize(writer, Resource); - if (Optional.IsDefined(Options)) - { - writer.WritePropertyName("options"u8); - writer.WriteObjectValue(Options, options); - } - writer.WriteEndObject(); - } - - GraphResourceGetResultCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGraphResourceGetResultCreateOrUpdateContent(document.RootElement, options); - } - - internal static GraphResourceGetResultCreateOrUpdateContent DeserializeGraphResourceGetResultCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - WritableSubResource resource = default; - CosmosDBCreateUpdateConfig options0 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - resource = JsonSerializer.Deserialize(property0.Value.GetRawText()); - continue; - } - if (property0.NameEquals("options"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - options0 = CosmosDBCreateUpdateConfig.DeserializeCosmosDBCreateUpdateConfig(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GraphResourceGetResultCreateOrUpdateContent( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - options0, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResourceId", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine("{"); - builder.AppendLine(" resource: {"); - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" options: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Options)) - { - builder.Append(" options: "); - BicepSerializationHelpers.AppendChildObject(builder, Options, options, 4, false, " options: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support writing '{options.Format}' format."); - } - } - - GraphResourceGetResultCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeGraphResourceGetResultCreateOrUpdateContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.cs deleted file mode 100644 index b4b35b1e14d3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Parameters to create and update Cosmos DB Graph resource. - public partial class GraphResourceGetResultCreateOrUpdateContent : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The standard JSON format of a Graph resource. - /// is null. - public GraphResourceGetResultCreateOrUpdateContent(AzureLocation location, WritableSubResource resource) : base(location) - { - Argument.AssertNotNull(resource, nameof(resource)); - - Resource = resource; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a Graph resource. - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal GraphResourceGetResultCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, WritableSubResource resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Options = options; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GraphResourceGetResultCreateOrUpdateContent() - { - } - - /// The standard JSON format of a Graph resource. - internal WritableSubResource Resource { get; set; } - /// Gets or sets Id. - [WirePath("properties.resource.id")] - public ResourceIdentifier ResourceId - { - get => Resource is null ? default : Resource.Id; - set - { - if (Resource is null) - Resource = new WritableSubResource(); - Resource.Id = value; - } - } - - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - [WirePath("properties.options")] - public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs deleted file mode 100644 index 06e1c17293ad..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class GraphResourcesListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - GraphResourcesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGraphResourcesListResult(document.RootElement, options); - } - - internal static GraphResourcesListResult DeserializeGraphResourcesListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(GraphResourceGetResultData.DeserializeGraphResourceGetResultData(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GraphResourcesListResult(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support writing '{options.Format}' format."); - } - } - - GraphResourcesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeGraphResourcesListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs index c9e659706cdf..d734e903cfa1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -76,7 +70,6 @@ internal static GremlinDatabaseCreateOrUpdateContent DeserializeGremlinDatabaseC { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -89,16 +82,6 @@ internal static GremlinDatabaseCreateOrUpdateContent DeserializeGremlinDatabaseC Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,7 +166,6 @@ internal static GremlinDatabaseCreateOrUpdateContent DeserializeGremlinDatabaseC location, resource, options0, - identity, serializedAdditionalRawData); } @@ -270,21 +252,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.cs index b30d6c737abd..f3e7fbc4d1d9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public GremlinDatabaseCreateOrUpdateContent(AzureLocation location, GremlinDatab /// The location. /// The standard JSON format of a Gremlin database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal GremlinDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GremlinDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal GremlinDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GremlinDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal GremlinDatabaseCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs index 252bb897a88a..e00666778e6a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -76,7 +70,6 @@ internal static GremlinGraphCreateOrUpdateContent DeserializeGremlinGraphCreateO { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -89,16 +82,6 @@ internal static GremlinGraphCreateOrUpdateContent DeserializeGremlinGraphCreateO Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,7 +166,6 @@ internal static GremlinGraphCreateOrUpdateContent DeserializeGremlinGraphCreateO location, resource, options0, - identity, serializedAdditionalRawData); } @@ -270,21 +252,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.cs index 66f52d20662d..719404a9f423 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public GremlinGraphCreateOrUpdateContent(AzureLocation location, GremlinGraphRes /// The location. /// The standard JSON format of a Gremlin graph. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal GremlinGraphCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GremlinGraphResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal GremlinGraphCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GremlinGraphResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal GremlinGraphCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IssueType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IssueType.cs deleted file mode 100644 index 0f7e97e6ffb5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IssueType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Type of issue. - public readonly partial struct IssueType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IssueType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UnknownValue = "Unknown"; - private const string ConfigurationPropagationFailureValue = "ConfigurationPropagationFailure"; - private const string MissingPerimeterConfigurationValue = "MissingPerimeterConfiguration"; - private const string MissingIdentityConfigurationValue = "MissingIdentityConfiguration"; - - /// Unknown issue type. - public static IssueType Unknown { get; } = new IssueType(UnknownValue); - /// An error occurred while applying the network security perimeter (NSP) configuration. - public static IssueType ConfigurationPropagationFailure { get; } = new IssueType(ConfigurationPropagationFailureValue); - /// 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 IssueType MissingPerimeterConfiguration { get; } = new IssueType(MissingPerimeterConfigurationValue); - /// 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 IssueType MissingIdentityConfiguration { get; } = new IssueType(MissingIdentityConfigurationValue); - /// Determines if two values are the same. - public static bool operator ==(IssueType left, IssueType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IssueType left, IssueType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator IssueType(string value) => new IssueType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IssueType other && Equals(other); - /// - public bool Equals(IssueType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs deleted file mode 100644 index 93f66587a20f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class ListBackups : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ListBackups)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ListBackups IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ListBackups)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeListBackups(document.RootElement, options); - } - - internal static ListBackups DeserializeListBackups(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ListBackups(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ListBackups)} does not support writing '{options.Format}' format."); - } - } - - ListBackups IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeListBackups(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ListBackups)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.cs deleted file mode 100644 index c829eb59141a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// List of restorable backups for a Cassandra cluster. - internal partial class ListBackups - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ListBackups() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Container for array of backups. - /// Keeps track of any properties unknown to the library. - internal ListBackups(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Container for array of backups. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs deleted file mode 100644 index 3ea922477161..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// List of commands for cluster. - internal partial class ListCommands - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ListCommands() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Container for array of commands. - /// Keeps track of any properties unknown to the library. - internal ListCommands(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Container for array of commands. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs deleted file mode 100644 index 5414edf187ae..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class MaterializedViewDefinition : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsDefined(SourceCollectionRid)) - { - writer.WritePropertyName("sourceCollectionRid"u8); - writer.WriteStringValue(SourceCollectionRid); - } - writer.WritePropertyName("sourceCollectionId"u8); - writer.WriteStringValue(SourceCollectionId); - writer.WritePropertyName("definition"u8); - writer.WriteStringValue(Definition); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MaterializedViewDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMaterializedViewDefinition(document.RootElement, options); - } - - internal static MaterializedViewDefinition DeserializeMaterializedViewDefinition(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string sourceCollectionRid = default; - string sourceCollectionId = default; - string definition = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sourceCollectionRid"u8)) - { - sourceCollectionRid = property.Value.GetString(); - continue; - } - if (property.NameEquals("sourceCollectionId"u8)) - { - sourceCollectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("definition"u8)) - { - definition = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MaterializedViewDefinition(sourceCollectionRid, sourceCollectionId, definition, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceCollectionRid), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sourceCollectionRid: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SourceCollectionRid)) - { - builder.Append(" sourceCollectionRid: "); - if (SourceCollectionRid.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{SourceCollectionRid}'''"); - } - else - { - builder.AppendLine($"'{SourceCollectionRid}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceCollectionId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sourceCollectionId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SourceCollectionId)) - { - builder.Append(" sourceCollectionId: "); - if (SourceCollectionId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{SourceCollectionId}'''"); - } - else - { - builder.AppendLine($"'{SourceCollectionId}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Definition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" definition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Definition)) - { - builder.Append(" definition: "); - if (Definition.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Definition}'''"); - } - else - { - builder.AppendLine($"'{Definition}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support writing '{options.Format}' format."); - } - } - - MaterializedViewDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMaterializedViewDefinition(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs deleted file mode 100644 index b2e51f0324c1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Materialized View definition for the container. - public partial class MaterializedViewDefinition - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The name of the source container on which the Materialized View will be created. - /// 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. - /// or is null. - public MaterializedViewDefinition(string sourceCollectionId, string definition) - { - Argument.AssertNotNull(sourceCollectionId, nameof(sourceCollectionId)); - Argument.AssertNotNull(definition, nameof(definition)); - - SourceCollectionId = sourceCollectionId; - Definition = definition; - } - - /// Initializes a new instance of . - /// An unique identifier for the source collection. This is a system generated property. - /// The name of the source container on which the Materialized View will be created. - /// 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. - /// Keeps track of any properties unknown to the library. - internal MaterializedViewDefinition(string sourceCollectionRid, string sourceCollectionId, string definition, IDictionary serializedAdditionalRawData) - { - SourceCollectionRid = sourceCollectionRid; - SourceCollectionId = sourceCollectionId; - Definition = definition; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MaterializedViewDefinition() - { - } - - /// An unique identifier for the source collection. This is a system generated property. - [WirePath("sourceCollectionRid")] - public string SourceCollectionRid { get; } - /// The name of the source container on which the Materialized View will be created. - [WirePath("sourceCollectionId")] - public string SourceCollectionId { get; set; } - /// 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. - [WirePath("definition")] - public string Definition { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs deleted file mode 100644 index fd2fc66db75d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class MergeParameters : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MergeParameters)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(IsDryRun)) - { - writer.WritePropertyName("isDryRun"u8); - writer.WriteBooleanValue(IsDryRun.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MergeParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MergeParameters)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMergeParameters(document.RootElement, options); - } - - internal static MergeParameters DeserializeMergeParameters(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool? isDryRun = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("isDryRun"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isDryRun = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MergeParameters(isDryRun, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MergeParameters)} does not support writing '{options.Format}' format."); - } - } - - MergeParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMergeParameters(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MergeParameters)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.cs deleted file mode 100644 index 86efed3e5857..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The properties of an Azure Cosmos DB merge operations. - public partial class MergeParameters - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public MergeParameters() - { - } - - /// Initializes a new instance of . - /// Specifies whether the operation is a real merge operation or a simulation. - /// Keeps track of any properties unknown to the library. - internal MergeParameters(bool? isDryRun, IDictionary serializedAdditionalRawData) - { - IsDryRun = isDryRun; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Specifies whether the operation is a real merge operation or a simulation. - [WirePath("isDryRun")] - public bool? IsDryRun { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs index 0cd4b6f080fc..b4d50684d06c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -76,7 +70,6 @@ internal static MongoDBCollectionCreateOrUpdateContent DeserializeMongoDBCollect { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -89,16 +82,6 @@ internal static MongoDBCollectionCreateOrUpdateContent DeserializeMongoDBCollect Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,7 +166,6 @@ internal static MongoDBCollectionCreateOrUpdateContent DeserializeMongoDBCollect location, resource, options0, - identity, serializedAdditionalRawData); } @@ -270,21 +252,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.cs index aa5160f84cca..6fbc0d6a18e1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public MongoDBCollectionCreateOrUpdateContent(AzureLocation location, MongoDBCol /// The location. /// The standard JSON format of a MongoDB collection. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal MongoDBCollectionCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoDBCollectionResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoDBCollectionCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoDBCollectionResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal MongoDBCollectionCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs index cca1276dfcff..01ee85aee278 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -76,7 +70,6 @@ internal static MongoDBDatabaseCreateOrUpdateContent DeserializeMongoDBDatabaseC { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -89,16 +82,6 @@ internal static MongoDBDatabaseCreateOrUpdateContent DeserializeMongoDBDatabaseC Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,7 +166,6 @@ internal static MongoDBDatabaseCreateOrUpdateContent DeserializeMongoDBDatabaseC location, resource, options0, - identity, serializedAdditionalRawData); } @@ -270,21 +252,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.cs index 2b571cead553..3e49d095be97 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public MongoDBDatabaseCreateOrUpdateContent(AzureLocation location, MongoDBDatab /// The location. /// The standard JSON format of a MongoDB database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal MongoDBDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoDBDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoDBDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoDBDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal MongoDBDatabaseCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs deleted file mode 100644 index 4252049988d9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class NetworkSecurityPerimeter : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(PerimeterGuid)) - { - writer.WritePropertyName("perimeterGuid"u8); - writer.WriteStringValue(PerimeterGuid.Value); - } - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - NetworkSecurityPerimeter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeter(document.RootElement, options); - } - - internal static NetworkSecurityPerimeter DeserializeNetworkSecurityPerimeter(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - Guid? perimeterGuid = default; - AzureLocation? location = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("perimeterGuid"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - perimeterGuid = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeter(id, perimeterGuid, location, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PerimeterGuid), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" perimeterGuid: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(PerimeterGuid)) - { - builder.Append(" perimeterGuid: "); - builder.AppendLine($"'{PerimeterGuid.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Location)) - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityPerimeter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkSecurityPerimeter(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.cs deleted file mode 100644 index 9a38aee3d8f6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Information about a network security perimeter (NSP). - public partial class NetworkSecurityPerimeter - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NetworkSecurityPerimeter() - { - } - - /// Initializes a new instance of . - /// Fully qualified Azure resource ID of the NSP resource. - /// Universal unique ID (UUID) of the network security perimeter. - /// Location of the network security perimeter. - /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeter(ResourceIdentifier id, Guid? perimeterGuid, AzureLocation? location, IDictionary serializedAdditionalRawData) - { - Id = id; - PerimeterGuid = perimeterGuid; - Location = location; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Fully qualified Azure resource ID of the NSP resource. - [WirePath("id")] - public ResourceIdentifier Id { get; set; } - /// Universal unique ID (UUID) of the network security perimeter. - [WirePath("perimeterGuid")] - public Guid? PerimeterGuid { get; set; } - /// Location of the network security perimeter. - [WirePath("location")] - public AzureLocation? Location { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs deleted file mode 100644 index 033975238496..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class NetworkSecurityPerimeterConfigurationListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support writing '{format}' format."); - } - - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink.AbsoluteUri); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - NetworkSecurityPerimeterConfigurationListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement, options); - } - - internal static NetworkSecurityPerimeterConfigurationListResult DeserializeNetworkSecurityPerimeterConfigurationListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nextLink = new Uri(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeterConfigurationListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - builder.AppendLine($"'{NextLink.AbsoluteUri}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityPerimeterConfigurationListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs deleted file mode 100644 index fda9bc0d243f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Result of a list NSP (network security perimeter) configurations request. - internal partial class NetworkSecurityPerimeterConfigurationListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal NetworkSecurityPerimeterConfigurationListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Array of network security perimeter results. - /// The link used to get the next page of results. - /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeterConfigurationListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Array of network security perimeter results. - public IReadOnlyList Value { get; } - /// The link used to get the next page of results. - public Uri NextLink { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs deleted file mode 100644 index 44b0f27b2f34..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class NetworkSecurityPerimeterConfigurationProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsCollectionDefined(ProvisioningIssues)) - { - writer.WritePropertyName("provisioningIssues"u8); - writer.WriteStartArray(); - foreach (var item in ProvisioningIssues) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NetworkSecurityPerimeter)) - { - writer.WritePropertyName("networkSecurityPerimeter"u8); - writer.WriteObjectValue(NetworkSecurityPerimeter, options); - } - if (Optional.IsDefined(ResourceAssociation)) - { - writer.WritePropertyName("resourceAssociation"u8); - writer.WriteObjectValue(ResourceAssociation, options); - } - if (Optional.IsDefined(Profile)) - { - writer.WritePropertyName("profile"u8); - writer.WriteObjectValue(Profile, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - NetworkSecurityPerimeterConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeterConfigurationProperties(document.RootElement, options); - } - - internal static NetworkSecurityPerimeterConfigurationProperties DeserializeNetworkSecurityPerimeterConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState = default; - IReadOnlyList provisioningIssues = default; - NetworkSecurityPerimeter networkSecurityPerimeter = default; - ResourceAssociation resourceAssociation = default; - NetworkSecurityProfile profile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkSecurityPerimeterConfigurationProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("provisioningIssues"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ProvisioningIssue.DeserializeProvisioningIssue(item, options)); - } - provisioningIssues = array; - continue; - } - if (property.NameEquals("networkSecurityPerimeter"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkSecurityPerimeter = NetworkSecurityPerimeter.DeserializeNetworkSecurityPerimeter(property.Value, options); - continue; - } - if (property.NameEquals("resourceAssociation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resourceAssociation = ResourceAssociation.DeserializeResourceAssociation(property.Value, options); - continue; - } - if (property.NameEquals("profile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - profile = NetworkSecurityProfile.DeserializeNetworkSecurityProfile(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeterConfigurationProperties( - provisioningState, - provisioningIssues ?? new ChangeTrackingList(), - networkSecurityPerimeter, - resourceAssociation, - profile, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningIssues), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningIssues: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(ProvisioningIssues)) - { - if (ProvisioningIssues.Any()) - { - builder.Append(" provisioningIssues: "); - builder.AppendLine("["); - foreach (var item in ProvisioningIssues) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " provisioningIssues: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkSecurityPerimeter), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" networkSecurityPerimeter: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NetworkSecurityPerimeter)) - { - builder.Append(" networkSecurityPerimeter: "); - BicepSerializationHelpers.AppendChildObject(builder, NetworkSecurityPerimeter, options, 2, false, " networkSecurityPerimeter: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceAssociation), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resourceAssociation: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ResourceAssociation)) - { - builder.Append(" resourceAssociation: "); - BicepSerializationHelpers.AppendChildObject(builder, ResourceAssociation, options, 2, false, " resourceAssociation: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Profile), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" profile: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Profile)) - { - builder.Append(" profile: "); - BicepSerializationHelpers.AppendChildObject(builder, Profile, options, 2, false, " profile: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityPerimeterConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkSecurityPerimeterConfigurationProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs deleted file mode 100644 index 0ed13065c6b1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Network security configuration properties. - public partial class NetworkSecurityPerimeterConfigurationProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NetworkSecurityPerimeterConfigurationProperties() - { - ProvisioningIssues = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Provisioning state of a network security perimeter configuration that is being created or updated. - /// List of provisioning issues, if any. - /// Information about a network security perimeter (NSP). - /// Information about resource association. - /// Network security perimeter configuration profile. - /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeterConfigurationProperties(NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState, IReadOnlyList provisioningIssues, NetworkSecurityPerimeter networkSecurityPerimeter, ResourceAssociation resourceAssociation, NetworkSecurityProfile profile, IDictionary serializedAdditionalRawData) - { - ProvisioningState = provisioningState; - ProvisioningIssues = provisioningIssues; - NetworkSecurityPerimeter = networkSecurityPerimeter; - ResourceAssociation = resourceAssociation; - Profile = profile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Provisioning state of a network security perimeter configuration that is being created or updated. - [WirePath("provisioningState")] - public NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get; } - /// List of provisioning issues, if any. - [WirePath("provisioningIssues")] - public IReadOnlyList ProvisioningIssues { get; } - /// Information about a network security perimeter (NSP). - [WirePath("networkSecurityPerimeter")] - public NetworkSecurityPerimeter NetworkSecurityPerimeter { get; set; } - /// Information about resource association. - [WirePath("resourceAssociation")] - public ResourceAssociation ResourceAssociation { get; set; } - /// Network security perimeter configuration profile. - [WirePath("profile")] - public NetworkSecurityProfile Profile { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs deleted file mode 100644 index f5ce9755e824..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Provisioning state of a network security perimeter configuration that is being created or updated. - public readonly partial struct NetworkSecurityPerimeterConfigurationProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public NetworkSecurityPerimeterConfigurationProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SucceededValue = "Succeeded"; - private const string CreatingValue = "Creating"; - private const string UpdatingValue = "Updating"; - private const string DeletingValue = "Deleting"; - private const string AcceptedValue = "Accepted"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; - - /// Succeeded. - public static NetworkSecurityPerimeterConfigurationProvisioningState Succeeded { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(SucceededValue); - /// Creating. - public static NetworkSecurityPerimeterConfigurationProvisioningState Creating { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(CreatingValue); - /// Updating. - public static NetworkSecurityPerimeterConfigurationProvisioningState Updating { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(UpdatingValue); - /// Deleting. - public static NetworkSecurityPerimeterConfigurationProvisioningState Deleting { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(DeletingValue); - /// Accepted. - public static NetworkSecurityPerimeterConfigurationProvisioningState Accepted { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(AcceptedValue); - /// Failed. - public static NetworkSecurityPerimeterConfigurationProvisioningState Failed { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(FailedValue); - /// Canceled. - public static NetworkSecurityPerimeterConfigurationProvisioningState Canceled { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(CanceledValue); - /// Determines if two values are the same. - public static bool operator ==(NetworkSecurityPerimeterConfigurationProvisioningState left, NetworkSecurityPerimeterConfigurationProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(NetworkSecurityPerimeterConfigurationProvisioningState left, NetworkSecurityPerimeterConfigurationProvisioningState right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator NetworkSecurityPerimeterConfigurationProvisioningState(string value) => new NetworkSecurityPerimeterConfigurationProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is NetworkSecurityPerimeterConfigurationProvisioningState other && Equals(other); - /// - public bool Equals(NetworkSecurityPerimeterConfigurationProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs deleted file mode 100644 index f5b641e3636a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class NetworkSecurityProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(AccessRulesVersion)) - { - writer.WritePropertyName("accessRulesVersion"u8); - writer.WriteNumberValue(AccessRulesVersion.Value); - } - if (Optional.IsCollectionDefined(AccessRules)) - { - writer.WritePropertyName("accessRules"u8); - writer.WriteStartArray(); - foreach (var item in AccessRules) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(DiagnosticSettingsVersion)) - { - writer.WritePropertyName("diagnosticSettingsVersion"u8); - writer.WriteNumberValue(DiagnosticSettingsVersion.Value); - } - if (Optional.IsCollectionDefined(EnabledLogCategories)) - { - writer.WritePropertyName("enabledLogCategories"u8); - writer.WriteStartArray(); - foreach (var item in EnabledLogCategories) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - NetworkSecurityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityProfile(document.RootElement, options); - } - - internal static NetworkSecurityProfile DeserializeNetworkSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - int? accessRulesVersion = default; - IList accessRules = default; - int? diagnosticSettingsVersion = default; - IList enabledLogCategories = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("accessRulesVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accessRulesVersion = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("accessRules"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AccessRule.DeserializeAccessRule(item, options)); - } - accessRules = array; - continue; - } - if (property.NameEquals("diagnosticSettingsVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diagnosticSettingsVersion = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("enabledLogCategories"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - enabledLogCategories = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityProfile( - name, - accessRulesVersion, - accessRules ?? new ChangeTrackingList(), - diagnosticSettingsVersion, - enabledLogCategories ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessRulesVersion), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accessRulesVersion: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccessRulesVersion)) - { - builder.Append(" accessRulesVersion: "); - builder.AppendLine($"{AccessRulesVersion.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessRules), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accessRules: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(AccessRules)) - { - if (AccessRules.Any()) - { - builder.Append(" accessRules: "); - builder.AppendLine("["); - foreach (var item in AccessRules) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " accessRules: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DiagnosticSettingsVersion), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" diagnosticSettingsVersion: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DiagnosticSettingsVersion)) - { - builder.Append(" diagnosticSettingsVersion: "); - builder.AppendLine($"{DiagnosticSettingsVersion.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnabledLogCategories), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enabledLogCategories: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(EnabledLogCategories)) - { - if (EnabledLogCategories.Any()) - { - builder.Append(" enabledLogCategories: "); - builder.AppendLine("["); - foreach (var item in EnabledLogCategories) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkSecurityProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.cs deleted file mode 100644 index 7bef32097d83..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Network security perimeter configuration profile. - public partial class NetworkSecurityProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NetworkSecurityProfile() - { - AccessRules = new ChangeTrackingList(); - EnabledLogCategories = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Name of the profile. - /// Current access rules version. - /// List of Access Rules. - /// Current diagnostic settings version. - /// List of log categories that are enabled. - /// Keeps track of any properties unknown to the library. - internal NetworkSecurityProfile(string name, int? accessRulesVersion, IList accessRules, int? diagnosticSettingsVersion, IList enabledLogCategories, IDictionary serializedAdditionalRawData) - { - Name = name; - AccessRulesVersion = accessRulesVersion; - AccessRules = accessRules; - DiagnosticSettingsVersion = diagnosticSettingsVersion; - EnabledLogCategories = enabledLogCategories; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Name of the profile. - [WirePath("name")] - public string Name { get; set; } - /// Current access rules version. - [WirePath("accessRulesVersion")] - public int? AccessRulesVersion { get; set; } - /// List of Access Rules. - [WirePath("accessRules")] - public IList AccessRules { get; } - /// Current diagnostic settings version. - [WirePath("diagnosticSettingsVersion")] - public int? DiagnosticSettingsVersion { get; set; } - /// List of log categories that are enabled. - [WirePath("enabledLogCategories")] - public IList EnabledLogCategories { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs deleted file mode 100644 index 91bad665aa7a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PhysicalPartitionStorageInfo : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W" && Optional.IsDefined(StorageInKB)) - { - writer.WritePropertyName("storageInKB"u8); - writer.WriteNumberValue(StorageInKB.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - PhysicalPartitionStorageInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionStorageInfo(document.RootElement, options); - } - - internal static PhysicalPartitionStorageInfo DeserializePhysicalPartitionStorageInfo(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - double? storageInKB = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("storageInKB"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - storageInKB = property.Value.GetDouble(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionStorageInfo(id, storageInKB, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StorageInKB), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" storageInKB: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(StorageInKB)) - { - builder.Append(" storageInKB: "); - builder.AppendLine($"'{StorageInKB.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionStorageInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializePhysicalPartitionStorageInfo(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.cs deleted file mode 100644 index a2d430ffe7a2..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The storage of a physical partition. - public partial class PhysicalPartitionStorageInfo - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal PhysicalPartitionStorageInfo() - { - } - - /// Initializes a new instance of . - /// The unique identifier of the partition. - /// The storage in KB for the physical partition. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionStorageInfo(string id, double? storageInKB, IDictionary serializedAdditionalRawData) - { - Id = id; - StorageInKB = storageInKB; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The unique identifier of the partition. - [WirePath("id")] - public string Id { get; } - /// The storage in KB for the physical partition. - [WirePath("storageInKB")] - public double? StorageInKB { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs deleted file mode 100644 index a7e55fafc3fa..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PhysicalPartitionStorageInfoCollection : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsCollectionDefined(PhysicalPartitionStorageInfoCollectionValue)) - { - writer.WritePropertyName("physicalPartitionStorageInfoCollection"u8); - writer.WriteStartArray(); - foreach (var item in PhysicalPartitionStorageInfoCollectionValue) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - PhysicalPartitionStorageInfoCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionStorageInfoCollection(document.RootElement, options); - } - - internal static PhysicalPartitionStorageInfoCollection DeserializePhysicalPartitionStorageInfoCollection(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList physicalPartitionStorageInfoCollection = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("physicalPartitionStorageInfoCollection"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionStorageInfo.DeserializePhysicalPartitionStorageInfo(item, options)); - } - physicalPartitionStorageInfoCollection = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionStorageInfoCollection(physicalPartitionStorageInfoCollection ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhysicalPartitionStorageInfoCollectionValue), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" physicalPartitionStorageInfoCollection: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhysicalPartitionStorageInfoCollectionValue)) - { - if (PhysicalPartitionStorageInfoCollectionValue.Any()) - { - builder.Append(" physicalPartitionStorageInfoCollection: "); - builder.AppendLine("["); - foreach (var item in PhysicalPartitionStorageInfoCollectionValue) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " physicalPartitionStorageInfoCollection: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionStorageInfoCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializePhysicalPartitionStorageInfoCollection(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.cs deleted file mode 100644 index 0daaa283f1aa..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// List of physical partitions and their properties returned by a merge operation. - public partial class PhysicalPartitionStorageInfoCollection - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal PhysicalPartitionStorageInfoCollection() - { - PhysicalPartitionStorageInfoCollectionValue = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of physical partitions and their properties. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionStorageInfoCollection(IReadOnlyList physicalPartitionStorageInfoCollectionValue, IDictionary serializedAdditionalRawData) - { - PhysicalPartitionStorageInfoCollectionValue = physicalPartitionStorageInfoCollectionValue; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of physical partitions and their properties. - [WirePath("physicalPartitionStorageInfoCollection")] - public IReadOnlyList PhysicalPartitionStorageInfoCollectionValue { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs deleted file mode 100644 index fe31320e806c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class PhysicalPartitionThroughputInfoProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support writing '{format}' format."); - } - - if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) - { - writer.WritePropertyName("physicalPartitionThroughputInfo"u8); - writer.WriteStartArray(); - foreach (var item in PhysicalPartitionThroughputInfo) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - PhysicalPartitionThroughputInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionThroughputInfoProperties(document.RootElement, options); - } - - internal static PhysicalPartitionThroughputInfoProperties DeserializePhysicalPartitionThroughputInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList physicalPartitionThroughputInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("physicalPartitionThroughputInfo"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionThroughputInfoResource.DeserializePhysicalPartitionThroughputInfoResource(item, options)); - } - physicalPartitionThroughputInfo = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoProperties(physicalPartitionThroughputInfo ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhysicalPartitionThroughputInfo), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) - { - if (PhysicalPartitionThroughputInfo.Any()) - { - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine("["); - foreach (var item in PhysicalPartitionThroughputInfo) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " physicalPartitionThroughputInfo: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionThroughputInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializePhysicalPartitionThroughputInfoProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.cs deleted file mode 100644 index 97162b467507..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties object. - internal partial class PhysicalPartitionThroughputInfoProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public PhysicalPartitionThroughputInfoProperties() - { - PhysicalPartitionThroughputInfo = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Array of physical partition throughput info objects. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoProperties(IList physicalPartitionThroughputInfo, IDictionary serializedAdditionalRawData) - { - PhysicalPartitionThroughputInfo = physicalPartitionThroughputInfo; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Array of physical partition throughput info objects. - [WirePath("physicalPartitionThroughputInfo")] - public IList PhysicalPartitionThroughputInfo { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs deleted file mode 100644 index 9b4e85498019..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PhysicalPartitionThroughputInfoResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - PhysicalPartitionThroughputInfoResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionThroughputInfoResource(document.RootElement, options); - } - - internal static PhysicalPartitionThroughputInfoResource DeserializePhysicalPartitionThroughputInfoResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - double? throughput = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("throughput"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - throughput = property.Value.GetDouble(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoResource(id, throughput, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Throughput), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughput: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Throughput)) - { - builder.Append(" throughput: "); - builder.AppendLine($"'{Throughput.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionThroughputInfoResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializePhysicalPartitionThroughputInfoResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs deleted file mode 100644 index 824d6af02500..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs +++ /dev/null @@ -1,369 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PhysicalPartitionThroughputInfoResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Resource)) - { - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - } - writer.WriteEndObject(); - } - - PhysicalPartitionThroughputInfoResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionThroughputInfoResult(document.RootElement, options); - } - - internal static PhysicalPartitionThroughputInfoResult DeserializePhysicalPartitionThroughputInfoResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - PhysicalPartitionThroughputInfoResultPropertiesResource resource = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resource = PhysicalPartitionThroughputInfoResultPropertiesResource.DeserializePhysicalPartitionThroughputInfoResultPropertiesResource(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoResult( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResourcePhysicalPartitionThroughputInfo", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine("{"); - builder.AppendLine(" resource: {"); - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionThroughputInfoResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializePhysicalPartitionThroughputInfoResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.cs deleted file mode 100644 index 8bba9011413b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. - public partial class PhysicalPartitionThroughputInfoResult : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public PhysicalPartitionThroughputInfoResult(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// properties of physical partition throughput info. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, PhysicalPartitionThroughputInfoResultPropertiesResource resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal PhysicalPartitionThroughputInfoResult() - { - } - - /// properties of physical partition throughput info. - internal PhysicalPartitionThroughputInfoResultPropertiesResource Resource { get; set; } - /// Array of physical partition throughput info objects. - [WirePath("properties.resource.physicalPartitionThroughputInfo")] - public IList ResourcePhysicalPartitionThroughputInfo - { - get - { - if (Resource is null) - Resource = new PhysicalPartitionThroughputInfoResultPropertiesResource(); - return Resource.PhysicalPartitionThroughputInfo; - } - } - - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs deleted file mode 100644 index e37df62c899a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class PhysicalPartitionThroughputInfoResultPropertiesResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - PhysicalPartitionThroughputInfoResultPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionThroughputInfoResultPropertiesResource(document.RootElement, options); - } - - internal static PhysicalPartitionThroughputInfoResultPropertiesResource DeserializePhysicalPartitionThroughputInfoResultPropertiesResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList physicalPartitionThroughputInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("physicalPartitionThroughputInfo"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionThroughputInfoResource.DeserializePhysicalPartitionThroughputInfoResource(item, options)); - } - physicalPartitionThroughputInfo = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoResultPropertiesResource(physicalPartitionThroughputInfo ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhysicalPartitionThroughputInfo), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) - { - if (PhysicalPartitionThroughputInfo.Any()) - { - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine("["); - foreach (var item in PhysicalPartitionThroughputInfo) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " physicalPartitionThroughputInfo: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionThroughputInfoResultPropertiesResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializePhysicalPartitionThroughputInfoResultPropertiesResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.cs deleted file mode 100644 index ffa08db0780d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// properties of physical partition throughput info. - internal partial class PhysicalPartitionThroughputInfoResultPropertiesResource : PhysicalPartitionThroughputInfoProperties - { - /// Initializes a new instance of . - public PhysicalPartitionThroughputInfoResultPropertiesResource() - { - } - - /// Initializes a new instance of . - /// Array of physical partition throughput info objects. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoResultPropertiesResource(IList physicalPartitionThroughputInfo, IDictionary serializedAdditionalRawData) : base(physicalPartitionThroughputInfo, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs deleted file mode 100644 index 61869902a9d3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class ProvisioningIssue : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W" && Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ProvisioningIssue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProvisioningIssue(document.RootElement, options); - } - - internal static ProvisioningIssue DeserializeProvisioningIssue(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - ProvisioningIssueProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = ProvisioningIssueProperties.DeserializeProvisioningIssueProperties(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ProvisioningIssue(name, properties, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" properties: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Properties)) - { - builder.Append(" properties: "); - BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support writing '{options.Format}' format."); - } - } - - ProvisioningIssue IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeProvisioningIssue(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.cs deleted file mode 100644 index 4f32a2bb5d5f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Describes a provisioning issue for a network security perimeter configuration. - public partial class ProvisioningIssue - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ProvisioningIssue() - { - } - - /// Initializes a new instance of . - /// Name of the issue. - /// 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. - /// Keeps track of any properties unknown to the library. - internal ProvisioningIssue(string name, ProvisioningIssueProperties properties, IDictionary serializedAdditionalRawData) - { - Name = name; - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Name of the issue. - [WirePath("name")] - public string Name { get; } - /// 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. - [WirePath("properties")] - public ProvisioningIssueProperties Properties { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs deleted file mode 100644 index ca62a45a4adf..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs +++ /dev/null @@ -1,350 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class ProvisioningIssueProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsDefined(IssueType)) - { - writer.WritePropertyName("issueType"u8); - writer.WriteStringValue(IssueType.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(Severity)) - { - writer.WritePropertyName("severity"u8); - writer.WriteStringValue(Severity.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (options.Format != "W" && Optional.IsCollectionDefined(SuggestedResourceIds)) - { - writer.WritePropertyName("suggestedResourceIds"u8); - writer.WriteStartArray(); - foreach (var item in SuggestedResourceIds) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(SuggestedAccessRules)) - { - writer.WritePropertyName("suggestedAccessRules"u8); - writer.WriteStartArray(); - foreach (var item in SuggestedAccessRules) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ProvisioningIssueProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProvisioningIssueProperties(document.RootElement, options); - } - - internal static ProvisioningIssueProperties DeserializeProvisioningIssueProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IssueType? issueType = default; - Severity? severity = default; - string description = default; - IReadOnlyList suggestedResourceIds = default; - IReadOnlyList suggestedAccessRules = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("issueType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - issueType = new IssueType(property.Value.GetString()); - continue; - } - if (property.NameEquals("severity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - severity = new Severity(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("suggestedResourceIds"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - suggestedResourceIds = array; - continue; - } - if (property.NameEquals("suggestedAccessRules"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AccessRule.DeserializeAccessRule(item, options)); - } - suggestedAccessRules = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ProvisioningIssueProperties( - issueType, - severity, - description, - suggestedResourceIds ?? new ChangeTrackingList(), - suggestedAccessRules ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IssueType), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" issueType: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(IssueType)) - { - builder.Append(" issueType: "); - builder.AppendLine($"'{IssueType.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Severity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" severity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Severity)) - { - builder.Append(" severity: "); - builder.AppendLine($"'{Severity.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" description: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Description)) - { - builder.Append(" description: "); - if (Description.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Description}'''"); - } - else - { - builder.AppendLine($"'{Description}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SuggestedResourceIds), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" suggestedResourceIds: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(SuggestedResourceIds)) - { - if (SuggestedResourceIds.Any()) - { - builder.Append(" suggestedResourceIds: "); - builder.AppendLine("["); - foreach (var item in SuggestedResourceIds) - { - if (item == null) - { - builder.Append("null"); - continue; - } - builder.AppendLine($" '{item.ToString()}'"); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SuggestedAccessRules), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" suggestedAccessRules: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(SuggestedAccessRules)) - { - if (SuggestedAccessRules.Any()) - { - builder.Append(" suggestedAccessRules: "); - builder.AppendLine("["); - foreach (var item in SuggestedAccessRules) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " suggestedAccessRules: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support writing '{options.Format}' format."); - } - } - - ProvisioningIssueProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeProvisioningIssueProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.cs deleted file mode 100644 index bcbdbd08f583..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// 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. - public partial class ProvisioningIssueProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ProvisioningIssueProperties() - { - SuggestedResourceIds = new ChangeTrackingList(); - SuggestedAccessRules = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Type of issue. - /// Severity of the issue. - /// Description of the issue. - /// Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. - /// Access rules that can be added to the network security profile (NSP) to remediate the issue. - /// Keeps track of any properties unknown to the library. - internal ProvisioningIssueProperties(IssueType? issueType, Severity? severity, string description, IReadOnlyList suggestedResourceIds, IReadOnlyList suggestedAccessRules, IDictionary serializedAdditionalRawData) - { - IssueType = issueType; - Severity = severity; - Description = description; - SuggestedResourceIds = suggestedResourceIds; - SuggestedAccessRules = suggestedAccessRules; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Type of issue. - [WirePath("issueType")] - public IssueType? IssueType { get; } - /// Severity of the issue. - [WirePath("severity")] - public Severity? Severity { get; } - /// Description of the issue. - [WirePath("description")] - public string Description { get; } - /// Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. - [WirePath("suggestedResourceIds")] - public IReadOnlyList SuggestedResourceIds { get; } - /// Access rules that can be added to the network security profile (NSP) to remediate the issue. - [WirePath("suggestedAccessRules")] - public IReadOnlyList SuggestedAccessRules { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs deleted file mode 100644 index f6c391d26f2a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs +++ /dev/null @@ -1,357 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class RedistributeThroughputParameters : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - writer.WriteEndObject(); - } - - RedistributeThroughputParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRedistributeThroughputParameters(document.RootElement, options); - } - - internal static RedistributeThroughputParameters DeserializeRedistributeThroughputParameters(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - RedistributeThroughputPropertiesResource resource = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - resource = RedistributeThroughputPropertiesResource.DeserializeRedistributeThroughputPropertiesResource(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RedistributeThroughputParameters( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Resource), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support writing '{options.Format}' format."); - } - } - - RedistributeThroughputParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRedistributeThroughputParameters(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.cs deleted file mode 100644 index 57defd98b0ce..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Cosmos DB redistribute throughput parameters object. - public partial class RedistributeThroughputParameters : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The standard JSON format of a resource throughput. - /// is null. - public RedistributeThroughputParameters(AzureLocation location, RedistributeThroughputPropertiesResource resource) : base(location) - { - Argument.AssertNotNull(resource, nameof(resource)); - - Resource = resource; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a resource throughput. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal RedistributeThroughputParameters(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, RedistributeThroughputPropertiesResource resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RedistributeThroughputParameters() - { - } - - /// The standard JSON format of a resource throughput. - [WirePath("properties.resource")] - public RedistributeThroughputPropertiesResource Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs deleted file mode 100644 index ee4f79ba7019..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class RedistributeThroughputPropertiesResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("throughputPolicy"u8); - writer.WriteStringValue(ThroughputPolicy.ToString()); - writer.WritePropertyName("targetPhysicalPartitionThroughputInfo"u8); - writer.WriteStartArray(); - foreach (var item in TargetPhysicalPartitionThroughputInfo) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - writer.WritePropertyName("sourcePhysicalPartitionThroughputInfo"u8); - writer.WriteStartArray(); - foreach (var item in SourcePhysicalPartitionThroughputInfo) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - RedistributeThroughputPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRedistributeThroughputPropertiesResource(document.RootElement, options); - } - - internal static RedistributeThroughputPropertiesResource DeserializeRedistributeThroughputPropertiesResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ThroughputPolicyType throughputPolicy = default; - IList targetPhysicalPartitionThroughputInfo = default; - IList sourcePhysicalPartitionThroughputInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("throughputPolicy"u8)) - { - throughputPolicy = new ThroughputPolicyType(property.Value.GetString()); - continue; - } - if (property.NameEquals("targetPhysicalPartitionThroughputInfo"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionThroughputInfoResource.DeserializePhysicalPartitionThroughputInfoResource(item, options)); - } - targetPhysicalPartitionThroughputInfo = array; - continue; - } - if (property.NameEquals("sourcePhysicalPartitionThroughputInfo"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionThroughputInfoResource.DeserializePhysicalPartitionThroughputInfoResource(item, options)); - } - sourcePhysicalPartitionThroughputInfo = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RedistributeThroughputPropertiesResource(throughputPolicy, targetPhysicalPartitionThroughputInfo, sourcePhysicalPartitionThroughputInfo, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ThroughputPolicy), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughputPolicy: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" throughputPolicy: "); - builder.AppendLine($"'{ThroughputPolicy.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetPhysicalPartitionThroughputInfo), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" targetPhysicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(TargetPhysicalPartitionThroughputInfo)) - { - if (TargetPhysicalPartitionThroughputInfo.Any()) - { - builder.Append(" targetPhysicalPartitionThroughputInfo: "); - builder.AppendLine("["); - foreach (var item in TargetPhysicalPartitionThroughputInfo) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " targetPhysicalPartitionThroughputInfo: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourcePhysicalPartitionThroughputInfo), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sourcePhysicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(SourcePhysicalPartitionThroughputInfo)) - { - if (SourcePhysicalPartitionThroughputInfo.Any()) - { - builder.Append(" sourcePhysicalPartitionThroughputInfo: "); - builder.AppendLine("["); - foreach (var item in SourcePhysicalPartitionThroughputInfo) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " sourcePhysicalPartitionThroughputInfo: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support writing '{options.Format}' format."); - } - } - - RedistributeThroughputPropertiesResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRedistributeThroughputPropertiesResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.cs deleted file mode 100644 index 976ba582e211..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Resource to redistribute throughput for Azure Cosmos DB resource. - public partial class RedistributeThroughputPropertiesResource - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// ThroughputPolicy to apply for throughput redistribution. - /// Array of PhysicalPartitionThroughputInfoResource objects. - /// Array of PhysicalPartitionThroughputInfoResource objects. - /// or is null. - public RedistributeThroughputPropertiesResource(ThroughputPolicyType throughputPolicy, IEnumerable targetPhysicalPartitionThroughputInfo, IEnumerable sourcePhysicalPartitionThroughputInfo) - { - Argument.AssertNotNull(targetPhysicalPartitionThroughputInfo, nameof(targetPhysicalPartitionThroughputInfo)); - Argument.AssertNotNull(sourcePhysicalPartitionThroughputInfo, nameof(sourcePhysicalPartitionThroughputInfo)); - - ThroughputPolicy = throughputPolicy; - TargetPhysicalPartitionThroughputInfo = targetPhysicalPartitionThroughputInfo.ToList(); - SourcePhysicalPartitionThroughputInfo = sourcePhysicalPartitionThroughputInfo.ToList(); - } - - /// Initializes a new instance of . - /// ThroughputPolicy to apply for throughput redistribution. - /// Array of PhysicalPartitionThroughputInfoResource objects. - /// Array of PhysicalPartitionThroughputInfoResource objects. - /// Keeps track of any properties unknown to the library. - internal RedistributeThroughputPropertiesResource(ThroughputPolicyType throughputPolicy, IList targetPhysicalPartitionThroughputInfo, IList sourcePhysicalPartitionThroughputInfo, IDictionary serializedAdditionalRawData) - { - ThroughputPolicy = throughputPolicy; - TargetPhysicalPartitionThroughputInfo = targetPhysicalPartitionThroughputInfo; - SourcePhysicalPartitionThroughputInfo = sourcePhysicalPartitionThroughputInfo; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RedistributeThroughputPropertiesResource() - { - } - - /// ThroughputPolicy to apply for throughput redistribution. - [WirePath("throughputPolicy")] - public ThroughputPolicyType ThroughputPolicy { get; set; } - /// Array of PhysicalPartitionThroughputInfoResource objects. - [WirePath("targetPhysicalPartitionThroughputInfo")] - public IList TargetPhysicalPartitionThroughputInfo { get; } - /// Array of PhysicalPartitionThroughputInfoResource objects. - [WirePath("sourcePhysicalPartitionThroughputInfo")] - public IList SourcePhysicalPartitionThroughputInfo { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs deleted file mode 100644 index 03a520785a65..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class ResourceAssociation : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ResourceAssociation)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(AccessMode)) - { - writer.WritePropertyName("accessMode"u8); - writer.WriteStringValue(AccessMode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ResourceAssociation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ResourceAssociation)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceAssociation(document.RootElement, options); - } - - internal static ResourceAssociation DeserializeResourceAssociation(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - ResourceAssociationAccessMode? accessMode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("accessMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accessMode = new ResourceAssociationAccessMode(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceAssociation(name, accessMode, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accessMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccessMode)) - { - builder.Append(" accessMode: "); - builder.AppendLine($"'{AccessMode.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ResourceAssociation)} does not support writing '{options.Format}' format."); - } - } - - ResourceAssociation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeResourceAssociation(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ResourceAssociation)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.cs deleted file mode 100644 index f4875e8731e8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Information about resource association. - public partial class ResourceAssociation - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ResourceAssociation() - { - } - - /// Initializes a new instance of . - /// Name of the resource association. - /// Access mode of the resource association. - /// Keeps track of any properties unknown to the library. - internal ResourceAssociation(string name, ResourceAssociationAccessMode? accessMode, IDictionary serializedAdditionalRawData) - { - Name = name; - AccessMode = accessMode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Name of the resource association. - [WirePath("name")] - public string Name { get; set; } - /// Access mode of the resource association. - [WirePath("accessMode")] - public ResourceAssociationAccessMode? AccessMode { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociationAccessMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociationAccessMode.cs deleted file mode 100644 index 97198e642f4c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociationAccessMode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Access mode of the resource association. - public readonly partial struct ResourceAssociationAccessMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ResourceAssociationAccessMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnforcedValue = "Enforced"; - private const string LearningValue = "Learning"; - private const string AuditValue = "Audit"; - - /// Enforced access mode - traffic to the resource that failed access checks is blocked. - public static ResourceAssociationAccessMode Enforced { get; } = new ResourceAssociationAccessMode(EnforcedValue); - /// Learning access mode - traffic to the resource is enabled for analysis but not blocked. - public static ResourceAssociationAccessMode Learning { get; } = new ResourceAssociationAccessMode(LearningValue); - /// Audit access mode - traffic to the resource that fails access checks is logged but not blocked. - public static ResourceAssociationAccessMode Audit { get; } = new ResourceAssociationAccessMode(AuditValue); - /// Determines if two values are the same. - public static bool operator ==(ResourceAssociationAccessMode left, ResourceAssociationAccessMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ResourceAssociationAccessMode left, ResourceAssociationAccessMode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ResourceAssociationAccessMode(string value) => new ResourceAssociationAccessMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ResourceAssociationAccessMode other && Equals(other); - /// - public bool Equals(ResourceAssociationAccessMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs index f9d26414e0d9..62e3bff356ce 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs @@ -93,9 +93,9 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes long? analyticalStorageTtl = default; ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; - MaterializedViewDefinition materializedViewDefinition = default; IList computedProperties = default; VectorEmbeddingPolicy vectorEmbeddingPolicy = default; + FullTextPolicy fullTextPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -214,15 +214,6 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes createMode = new CosmosDBAccountCreateMode(property.Value.GetString()); continue; } - if (property.NameEquals("materializedViewDefinition"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value, options); - continue; - } if (property.NameEquals("computedProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -246,6 +237,15 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes vectorEmbeddingPolicy = VectorEmbeddingPolicy.DeserializeVectorEmbeddingPolicy(property.Value, options); continue; } + if (property.NameEquals("fullTextPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fullTextPolicy = FullTextPolicy.DeserializeFullTextPolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -263,9 +263,9 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties ?? new ChangeTrackingList(), vectorEmbeddingPolicy, + fullTextPolicy, serializedAdditionalRawData, self, rid, @@ -521,21 +521,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaterializedViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" materializedViewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(MaterializedViewDefinition)) - { - builder.Append(" materializedViewDefinition: "); - BicepSerializationHelpers.AppendChildObject(builder, MaterializedViewDefinition, options, 2, false, " materializedViewDefinition: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComputedProperties), out propertyOverride); if (hasPropertyOverride) { @@ -577,6 +562,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FullTextPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" fullTextPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FullTextPolicy)) + { + builder.Append(" fullTextPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, FullTextPolicy, options, 2, false, " fullTextPolicy: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs index 7671a046d572..36e31645f07e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs @@ -32,15 +32,15 @@ public RestorableSqlContainerPropertiesResourceContainer(string containerName) : /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// The vector embedding policy for the container. + /// The FullText policy for the container. /// Keeps track of any properties unknown to the library. /// A system generated property that specifies the addressable path of the container resource. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. - internal RestorableSqlContainerPropertiesResourceContainer(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList computedProperties, VectorEmbeddingPolicy vectorEmbeddingPolicy, IDictionary serializedAdditionalRawData, string self, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, computedProperties, vectorEmbeddingPolicy, serializedAdditionalRawData) + internal RestorableSqlContainerPropertiesResourceContainer(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, IList computedProperties, VectorEmbeddingPolicy vectorEmbeddingPolicy, FullTextPolicy fullTextPolicy, IDictionary serializedAdditionalRawData, string self, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, computedProperties, vectorEmbeddingPolicy, fullTextPolicy, serializedAdditionalRawData) { Self = self; Rid = rid; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs deleted file mode 100644 index be754946b814..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class RetrieveThroughputParameters : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - writer.WriteEndObject(); - } - - RetrieveThroughputParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRetrieveThroughputParameters(document.RootElement, options); - } - - internal static RetrieveThroughputParameters DeserializeRetrieveThroughputParameters(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - RetrieveThroughputPropertiesResource resource = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - resource = RetrieveThroughputPropertiesResource.DeserializeRetrieveThroughputPropertiesResource(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RetrieveThroughputParameters( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResourcePhysicalPartitionIds", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine("{"); - builder.AppendLine(" resource: {"); - builder.Append(" physicalPartitionIds: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support writing '{options.Format}' format."); - } - } - - RetrieveThroughputParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRetrieveThroughputParameters(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.cs deleted file mode 100644 index f9a7b72442b1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Cosmos DB retrieve throughput parameters object. - public partial class RetrieveThroughputParameters : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The standard JSON format of a resource throughput. - /// is null. - public RetrieveThroughputParameters(AzureLocation location, RetrieveThroughputPropertiesResource resource) : base(location) - { - Argument.AssertNotNull(resource, nameof(resource)); - - Resource = resource; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a resource throughput. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal RetrieveThroughputParameters(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, RetrieveThroughputPropertiesResource resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RetrieveThroughputParameters() - { - } - - /// The standard JSON format of a resource throughput. - internal RetrieveThroughputPropertiesResource Resource { get; set; } - /// Array of PhysicalPartitionId objects. - [WirePath("properties.resource.physicalPartitionIds")] - public IList ResourcePhysicalPartitionIds - { - get => Resource is null ? default : Resource.PhysicalPartitionIds; - set => Resource = new RetrieveThroughputPropertiesResource(value); - } - - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs deleted file mode 100644 index 6dd6ee19d644..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class RetrieveThroughputPropertiesResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("physicalPartitionIds"u8); - writer.WriteStartArray(); - foreach (var item in PhysicalPartitionIds) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - RetrieveThroughputPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRetrieveThroughputPropertiesResource(document.RootElement, options); - } - - internal static RetrieveThroughputPropertiesResource DeserializeRetrieveThroughputPropertiesResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList physicalPartitionIds = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("physicalPartitionIds"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - physicalPartitionIds = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RetrieveThroughputPropertiesResource(physicalPartitionIds, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhysicalPartitionIds), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" physicalPartitionIds: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhysicalPartitionIds)) - { - if (PhysicalPartitionIds.Any()) - { - builder.Append(" physicalPartitionIds: "); - builder.AppendLine("["); - foreach (var item in PhysicalPartitionIds) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " physicalPartitionIds: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support writing '{options.Format}' format."); - } - } - - RetrieveThroughputPropertiesResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRetrieveThroughputPropertiesResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.cs deleted file mode 100644 index c964fa9ca2b6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Resource to retrieve throughput information for Cosmos DB resource. - public partial class RetrieveThroughputPropertiesResource - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Array of PhysicalPartitionId objects. - /// is null. - public RetrieveThroughputPropertiesResource(IEnumerable physicalPartitionIds) - { - Argument.AssertNotNull(physicalPartitionIds, nameof(physicalPartitionIds)); - - PhysicalPartitionIds = physicalPartitionIds.ToList(); - } - - /// Initializes a new instance of . - /// Array of PhysicalPartitionId objects. - /// Keeps track of any properties unknown to the library. - internal RetrieveThroughputPropertiesResource(IList physicalPartitionIds, IDictionary serializedAdditionalRawData) - { - PhysicalPartitionIds = physicalPartitionIds; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RetrieveThroughputPropertiesResource() - { - } - - /// Array of PhysicalPartitionId objects. - [WirePath("physicalPartitionIds")] - public IList PhysicalPartitionIds { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ScheduledEventStrategy.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ScheduledEventStrategy.cs deleted file mode 100644 index e25796df7093..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ScheduledEventStrategy.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// How the nodes in the cluster react to scheduled events. - public readonly partial struct ScheduledEventStrategy : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScheduledEventStrategy(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string IgnoreValue = "Ignore"; - private const string StopAnyValue = "StopAny"; - private const string StopByRackValue = "StopByRack"; - - /// Ignore. - public static ScheduledEventStrategy Ignore { get; } = new ScheduledEventStrategy(IgnoreValue); - /// StopAny. - public static ScheduledEventStrategy StopAny { get; } = new ScheduledEventStrategy(StopAnyValue); - /// StopByRack. - public static ScheduledEventStrategy StopByRack { get; } = new ScheduledEventStrategy(StopByRackValue); - /// Determines if two values are the same. - public static bool operator ==(ScheduledEventStrategy left, ScheduledEventStrategy right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ScheduledEventStrategy left, ScheduledEventStrategy right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ScheduledEventStrategy(string value) => new ScheduledEventStrategy(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ScheduledEventStrategy other && Equals(other); - /// - public bool Equals(ScheduledEventStrategy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Severity.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Severity.cs deleted file mode 100644 index 24e5b3ddb068..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Severity.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Severity of the issue. - public readonly partial struct Severity : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public Severity(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string WarningValue = "Warning"; - private const string ErrorValue = "Error"; - - /// Warning. - public static Severity Warning { get; } = new Severity(WarningValue); - /// Error. - public static Severity Error { get; } = new Severity(ErrorValue); - /// Determines if two values are the same. - public static bool operator ==(Severity left, Severity right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Severity left, Severity right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator Severity(string value) => new Severity(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Severity other && Equals(other); - /// - public bool Equals(Severity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleAssignmentListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleAssignmentListResult.Serialization.cs deleted file mode 100644 index 30f6a411312d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleAssignmentListResult.Serialization.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class TableRoleAssignmentListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableRoleAssignmentListResult)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - TableRoleAssignmentListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableRoleAssignmentListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTableRoleAssignmentListResult(document.RootElement, options); - } - - internal static TableRoleAssignmentListResult DeserializeTableRoleAssignmentListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CosmosDBTableRoleAssignmentData.DeserializeCosmosDBTableRoleAssignmentData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TableRoleAssignmentListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(TableRoleAssignmentListResult)} does not support writing '{options.Format}' format."); - } - } - - TableRoleAssignmentListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeTableRoleAssignmentListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TableRoleAssignmentListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleAssignmentListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleAssignmentListResult.cs deleted file mode 100644 index 633a7bb62cb5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleAssignmentListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The relevant Role Assignments. - internal partial class TableRoleAssignmentListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal TableRoleAssignmentListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of Role Assignments and their properties. - /// The link used to get the next page of results. - /// Keeps track of any properties unknown to the library. - internal TableRoleAssignmentListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of Role Assignments and their properties. - public IReadOnlyList Value { get; } - /// The link used to get the next page of results. - public string NextLink { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleDefinitionListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleDefinitionListResult.Serialization.cs deleted file mode 100644 index c6a70db74830..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleDefinitionListResult.Serialization.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class TableRoleDefinitionListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableRoleDefinitionListResult)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - TableRoleDefinitionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(TableRoleDefinitionListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTableRoleDefinitionListResult(document.RootElement, options); - } - - internal static TableRoleDefinitionListResult DeserializeTableRoleDefinitionListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CosmosDBTableRoleDefinitionData.DeserializeCosmosDBTableRoleDefinitionData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new TableRoleDefinitionListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(TableRoleDefinitionListResult)} does not support writing '{options.Format}' format."); - } - } - - TableRoleDefinitionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeTableRoleDefinitionListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(TableRoleDefinitionListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleDefinitionListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleDefinitionListResult.cs deleted file mode 100644 index 997c33783839..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/TableRoleDefinitionListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The relevant Role Definitions. - internal partial class TableRoleDefinitionListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal TableRoleDefinitionListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of Role Definitions and their properties. - /// The link used to get the next page of results. - /// Keeps track of any properties unknown to the library. - internal TableRoleDefinitionListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of Role Definitions and their properties. - public IReadOnlyList Value { get; } - /// The link used to get the next page of results. - public string NextLink { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyType.cs deleted file mode 100644 index 153a5c103011..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// ThroughputPolicy to apply for throughput redistribution. - public readonly partial struct ThroughputPolicyType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ThroughputPolicyType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "none"; - private const string EqualValue = "equal"; - private const string CustomValue = "custom"; - - /// none. - public static ThroughputPolicyType None { get; } = new ThroughputPolicyType(NoneValue); - /// equal. - public static ThroughputPolicyType Equal { get; } = new ThroughputPolicyType(EqualValue); - /// custom. - public static ThroughputPolicyType Custom { get; } = new ThroughputPolicyType(CustomValue); - /// Determines if two values are the same. - public static bool operator ==(ThroughputPolicyType left, ThroughputPolicyType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ThroughputPolicyType left, ThroughputPolicyType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ThroughputPolicyType(string value) => new ThroughputPolicyType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ThroughputPolicyType other && Equals(other); - /// - public bool Equals(ThroughputPolicyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs deleted file mode 100644 index 83071295de1f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class ThroughputPoolAccountsListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ThroughputPoolAccountsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeThroughputPoolAccountsListResult(document.RootElement, options); - } - - internal static ThroughputPoolAccountsListResult DeserializeThroughputPoolAccountsListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ThroughputPoolAccountsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support writing '{options.Format}' format."); - } - } - - ThroughputPoolAccountsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeThroughputPoolAccountsListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.cs deleted file mode 100644 index e806ee3012a6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The List operation response, that contains the global database accounts and their properties. - internal partial class ThroughputPoolAccountsListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ThroughputPoolAccountsListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of global database accounts in a throughput pool and their properties. - /// The link used to get the next page of results. - /// Keeps track of any properties unknown to the library. - internal ThroughputPoolAccountsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of global database accounts in a throughput pool and their properties. - public IReadOnlyList Value { get; } - /// The link used to get the next page of results. - public string NextLink { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs deleted file mode 100644 index 97e58c3f8380..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class ThroughputPoolsListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support writing '{format}' format."); - } - - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ThroughputPoolsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeThroughputPoolsListResult(document.RootElement, options); - } - - internal static ThroughputPoolsListResult DeserializeThroughputPoolsListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ThroughputPoolsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support writing '{options.Format}' format."); - } - } - - ThroughputPoolsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeThroughputPoolsListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.cs deleted file mode 100644 index b6490a57da21..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The List operation response, that contains the throughput pools and their properties. - internal partial class ThroughputPoolsListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ThroughputPoolsListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of throughput pools and their properties. - /// The link used to get the next page of results. - /// Keeps track of any properties unknown to the library. - internal ThroughputPoolsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of throughput pools and their properties. - public IReadOnlyList Value { get; } - /// The link used to get the next page of results. - public string NextLink { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsResourceInfo.Serialization.cs index 9eba97b7624a..2b2022bb6902 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsResourceInfo.Serialization.cs @@ -8,7 +8,6 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; -using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -66,16 +65,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("softAllowedMaximumThroughput"u8); writer.WriteStringValue(SoftAllowedMaximumThroughput); } - if (Optional.IsCollectionDefined(ThroughputBuckets)) - { - writer.WritePropertyName("throughputBuckets"u8); - writer.WriteStartArray(); - foreach (var item in ThroughputBuckets) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -119,7 +108,6 @@ internal static ThroughputSettingsResourceInfo DeserializeThroughputSettingsReso string offerReplacePending = default; string instantMaximumThroughput = default; string softAllowedMaximumThroughput = default; - IList throughputBuckets = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -162,20 +150,6 @@ internal static ThroughputSettingsResourceInfo DeserializeThroughputSettingsReso softAllowedMaximumThroughput = property.Value.GetString(); continue; } - if (property.NameEquals("throughputBuckets"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CosmosDBThroughputBucket.DeserializeCosmosDBThroughputBucket(item, options)); - } - throughputBuckets = array; - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -189,7 +163,6 @@ internal static ThroughputSettingsResourceInfo DeserializeThroughputSettingsReso offerReplacePending, instantMaximumThroughput, softAllowedMaximumThroughput, - throughputBuckets ?? new ChangeTrackingList(), serializedAdditionalRawData); } @@ -326,29 +299,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ThroughputBuckets), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughputBuckets: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(ThroughputBuckets)) - { - if (ThroughputBuckets.Any()) - { - builder.Append(" throughputBuckets: "); - builder.AppendLine("["); - foreach (var item in ThroughputBuckets) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " throughputBuckets: "); - } - builder.AppendLine(" ]"); - } - } - } - builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsResourceInfo.cs index 0e5c9473c44c..3d0fd3d79232 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsResourceInfo.cs @@ -48,7 +48,6 @@ public partial class ThroughputSettingsResourceInfo /// Initializes a new instance of . public ThroughputSettingsResourceInfo() { - ThroughputBuckets = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -58,9 +57,8 @@ public ThroughputSettingsResourceInfo() /// The throughput replace is pending. /// The offer throughput value to instantly scale up without triggering splits. /// The maximum throughput value or the maximum maxThroughput value (for autoscale) that can be specified. - /// Array of Throughput Bucket limits to be applied to the Cosmos DB container. /// Keeps track of any properties unknown to the library. - internal ThroughputSettingsResourceInfo(int? throughput, AutoscaleSettingsResourceInfo autoscaleSettings, string minimumThroughput, string offerReplacePending, string instantMaximumThroughput, string softAllowedMaximumThroughput, IList throughputBuckets, IDictionary serializedAdditionalRawData) + internal ThroughputSettingsResourceInfo(int? throughput, AutoscaleSettingsResourceInfo autoscaleSettings, string minimumThroughput, string offerReplacePending, string instantMaximumThroughput, string softAllowedMaximumThroughput, IDictionary serializedAdditionalRawData) { Throughput = throughput; AutoscaleSettings = autoscaleSettings; @@ -68,7 +66,6 @@ internal ThroughputSettingsResourceInfo(int? throughput, AutoscaleSettingsResour OfferReplacePending = offerReplacePending; InstantMaximumThroughput = instantMaximumThroughput; SoftAllowedMaximumThroughput = softAllowedMaximumThroughput; - ThroughputBuckets = throughputBuckets; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -90,8 +87,5 @@ internal ThroughputSettingsResourceInfo(int? throughput, AutoscaleSettingsResour /// The maximum throughput value or the maximum maxThroughput value (for autoscale) that can be specified. [WirePath("softAllowedMaximumThroughput")] public string SoftAllowedMaximumThroughput { get; } - /// Array of Throughput Bucket limits to be applied to the Cosmos DB container. - [WirePath("throughputBuckets")] - public IList ThroughputBuckets { get; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs index 8073eb21f211..07ea107cc056 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs @@ -38,12 +38,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -71,7 +65,6 @@ internal static ThroughputSettingsUpdateData DeserializeThroughputSettingsUpdate { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -83,16 +76,6 @@ internal static ThroughputSettingsUpdateData DeserializeThroughputSettingsUpdate Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -167,7 +150,6 @@ internal static ThroughputSettingsUpdateData DeserializeThroughputSettingsUpdate tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -254,21 +236,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.cs index 499a10c81fc2..bbebf2c8ea00 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.cs @@ -66,12 +66,10 @@ public ThroughputSettingsUpdateData(AzureLocation location, ThroughputSettingsRe /// The tags. /// The location. /// The standard JSON format of a resource throughput. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal ThroughputSettingsUpdateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ThroughputSettingsResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ThroughputSettingsUpdateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ThroughputSettingsResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -83,8 +81,5 @@ internal ThroughputSettingsUpdateData() /// The standard JSON format of a resource throughput. [WirePath("properties.resource")] public ThroughputSettingsResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index 09bb5c1b0a48..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class UnknownDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - DataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferDataSourceSink(document.RootElement, options); - } - - internal static UnknownDataTransferDataSourceSink DeserializeUnknownDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DataTransferComponent component = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownDataTransferDataSourceSink(component, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - DataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.cs deleted file mode 100644 index a8a2c1cc8e3a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Unknown version of DataTransferDataSourceSink. - internal partial class UnknownDataTransferDataSourceSink : DataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal UnknownDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData) : base(component, serializedAdditionalRawData) - { - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal UnknownDataTransferDataSourceSink() - { - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs index adb1e95fd324..e7bd16650059 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string c /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string collectionName, Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string collectionName, Can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string collectionName, CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs index 125ad90ed1de..9f3eb5769fd8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -80,7 +74,6 @@ internal static MongoDBCollectionData DeserializeMongoDBCollectionData(JsonEleme { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -93,16 +86,6 @@ internal static MongoDBCollectionData DeserializeMongoDBCollectionData(JsonEleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -191,7 +174,6 @@ internal static MongoDBCollectionData DeserializeMongoDBCollectionData(JsonEleme location, resource, options0, - identity, serializedAdditionalRawData); } @@ -278,21 +260,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.cs index 452d855493a9..58cfa7149b2b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.cs @@ -66,13 +66,11 @@ public MongoDBCollectionData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal MongoDBCollectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedMongoDBCollectionResourceInfo resource, MongoDBCollectionPropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoDBCollectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedMongoDBCollectionResourceInfo resource, MongoDBCollectionPropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal MongoDBCollectionData() /// Gets or sets the options. [WirePath("properties.options")] public MongoDBCollectionPropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs index d4bd1a0085b4..3599ca04aa35 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs @@ -111,7 +111,7 @@ public virtual MongoDBCollectionThroughputSettingResource GetMongoDBCollectionTh /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,98 +354,6 @@ public virtual ArmOperation Update(WaitUntil waitUnti } } - /// - /// Merges the partitions of a MongoDB Collection - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge - /// - /// - /// Operation Id - /// MongoDBResources_ListMongoDBCollectionPartitionMerge - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> GetMongoDBCollectionPartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _mongoDBCollectionMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionResource.GetMongoDBCollectionPartitionMerge"); - scope.Start(); - try - { - var response = await _mongoDBCollectionMongoDBResourcesRestClient.ListMongoDBCollectionPartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBCollectionMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionMongoDBResourcesRestClient.CreateListMongoDBCollectionPartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Merges the partitions of a MongoDB Collection - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge - /// - /// - /// Operation Id - /// MongoDBResources_ListMongoDBCollectionPartitionMerge - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation GetMongoDBCollectionPartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _mongoDBCollectionMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionResource.GetMongoDBCollectionPartitionMerge"); - scope.Start(); - try - { - var response = _mongoDBCollectionMongoDBResourcesRestClient.ListMongoDBCollectionPartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBCollectionMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionMongoDBResourcesRestClient.CreateListMongoDBCollectionPartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Retrieves continuous backup information for a Mongodb collection. /// @@ -459,7 +367,7 @@ public virtual ArmOperation GetMongoDBCo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -505,7 +413,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -551,7 +459,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -613,7 +521,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -675,7 +583,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -732,7 +640,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -789,7 +697,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -849,7 +757,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs index 2b8d05b8eb57..36be9b020df7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -263,190 +263,6 @@ public virtual ArmOperation CreateOr } } - /// - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBContainerRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB container. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBContainerRetrieveThroughputDistributionAsync(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionThroughputSettingResource.MongoDBContainerRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = await _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.MongoDBContainerRetrieveThroughputDistributionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.CreateMongoDBContainerRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBContainerRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB container. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBContainerRetrieveThroughputDistribution(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionThroughputSettingResource.MongoDBContainerRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.MongoDBContainerRetrieveThroughputDistribution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.CreateMongoDBContainerRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB MongoDB container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBContainerRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current MongoDB container. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBContainerRedistributeThroughputAsync(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionThroughputSettingResource.MongoDBContainerRedistributeThroughput"); - scope.Start(); - try - { - var response = await _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.MongoDBContainerRedistributeThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.CreateMongoDBContainerRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB MongoDB container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBContainerRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current MongoDB container. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBContainerRedistributeThroughput(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionThroughputSettingResource.MongoDBContainerRedistributeThroughput"); - scope.Start(); - try - { - var response = _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.MongoDBContainerRedistributeThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.CreateMongoDBContainerRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale /// @@ -460,7 +276,7 @@ public virtual ArmOperation MongoDBContai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -502,7 +318,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -544,7 +360,7 @@ public virtual ArmOperation MigrateM /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -586,7 +402,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -628,7 +444,7 @@ public virtual ArmOperation MigrateM /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -690,7 +506,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -752,7 +568,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -809,7 +625,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -866,7 +682,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -926,7 +742,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs index 6d223c3dc0aa..4761b3383675 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string dat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs index 30553e81d640..922302520591 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -80,7 +74,6 @@ internal static MongoDBDatabaseData DeserializeMongoDBDatabaseData(JsonElement e { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -93,16 +86,6 @@ internal static MongoDBDatabaseData DeserializeMongoDBDatabaseData(JsonElement e Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -191,7 +174,6 @@ internal static MongoDBDatabaseData DeserializeMongoDBDatabaseData(JsonElement e location, resource, options0, - identity, serializedAdditionalRawData); } @@ -278,21 +260,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.cs index 3963cf6b2ff2..fb4d46632fa2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.cs @@ -66,13 +66,11 @@ public MongoDBDatabaseData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal MongoDBDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedMongoDBDatabaseResourceInfo resource, MongoDBDatabasePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoDBDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedMongoDBDatabaseResourceInfo resource, MongoDBDatabasePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal MongoDBDatabaseData() /// Gets or sets the options. [WirePath("properties.options")] public MongoDBDatabasePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs index 704bf735c21b..7d7fb7ef311c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs @@ -117,7 +117,7 @@ public virtual MongoDBCollectionCollection GetMongoDBCollections() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetMongoDBCollect /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual Response GetMongoDBCollection(string c /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -389,7 +389,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -422,98 +422,6 @@ public virtual ArmOperation Update(WaitUntil waitUntil, } } - /// - /// Merges the partitions of a MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabasePartitionMerge - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBDatabasePartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _mongoDBDatabaseMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseResource.MongoDBDatabasePartitionMerge"); - scope.Start(); - try - { - var response = await _mongoDBDatabaseMongoDBResourcesRestClient.MongoDBDatabasePartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBDatabaseMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseMongoDBResourcesRestClient.CreateMongoDBDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Merges the partitions of a MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabasePartitionMerge - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBDatabasePartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _mongoDBDatabaseMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseResource.MongoDBDatabasePartitionMerge"); - scope.Start(); - try - { - var response = _mongoDBDatabaseMongoDBResourcesRestClient.MongoDBDatabasePartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBDatabaseMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseMongoDBResourcesRestClient.CreateMongoDBDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -527,7 +435,7 @@ public virtual ArmOperation MongoDBDatab /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -589,7 +497,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -651,7 +559,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -708,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -765,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -825,7 +733,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs index aede05af362e..380699148d80 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateMon /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -430,190 +430,6 @@ public virtual ArmOperation MigrateMon } } - /// - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabaseRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB database. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBDatabaseRetrieveThroughputDistributionAsync(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseThroughputSettingResource.MongoDBDatabaseRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = await _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.MongoDBDatabaseRetrieveThroughputDistributionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabaseRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB database. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBDatabaseRetrieveThroughputDistribution(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseThroughputSettingResource.MongoDBDatabaseRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.MongoDBDatabaseRetrieveThroughputDistribution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabaseRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current MongoDB database. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBDatabaseRedistributeThroughputAsync(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseThroughputSettingResource.MongoDBDatabaseRedistributeThroughput"); - scope.Start(); - try - { - var response = await _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.MongoDBDatabaseRedistributeThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.CreateMongoDBDatabaseRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabaseRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current MongoDB database. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBDatabaseRedistributeThroughput(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseThroughputSettingResource.MongoDBDatabaseRedistributeThroughput"); - scope.Start(); - try - { - var response = _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.MongoDBDatabaseRedistributeThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.CreateMongoDBDatabaseRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -627,7 +443,7 @@ public virtual ArmOperation MongoDBDataba /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -689,7 +505,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -751,7 +567,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -808,7 +624,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -865,7 +681,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -925,7 +741,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs index 2fd4babf1d68..8346a4ece9c3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mongoRoleDefin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string mongoRoleDefinition /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string mongoRoleDefinitionId, CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs index 4d9d9cde587d..834fc2fe1da0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs index 9429a41cf6e8..da6e43fd26be 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mongoUserDefin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string mongoUserDefinition /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string mongoUserDefinitionId, CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs index d9ff020ccc8e..04ffdda217c7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs deleted file mode 100644 index 6331452c40a1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetNetworkSecurityPerimeterConfigurations method from an instance of . - /// - public partial class NetworkSecurityPerimeterConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _networkSecurityPerimeterConfigurationClientDiagnostics; - private readonly NetworkSecurityPerimeterConfigurationsRestOperations _networkSecurityPerimeterConfigurationRestClient; - - /// Initializes a new instance of the class for mocking. - protected NetworkSecurityPerimeterConfigurationCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal NetworkSecurityPerimeterConfigurationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _networkSecurityPerimeterConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", NetworkSecurityPerimeterConfigurationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(NetworkSecurityPerimeterConfigurationResource.ResourceType, out string networkSecurityPerimeterConfigurationApiVersion); - _networkSecurityPerimeterConfigurationRestClient = new NetworkSecurityPerimeterConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, networkSecurityPerimeterConfigurationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Get"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Get"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_List - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _networkSecurityPerimeterConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkSecurityPerimeterConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityPerimeterConfigurationResource(Client, NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(e)), _networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, "NetworkSecurityPerimeterConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_List - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _networkSecurityPerimeterConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkSecurityPerimeterConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityPerimeterConfigurationResource(Client, NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(e)), _networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, "NetworkSecurityPerimeterConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Exists"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Exists"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.GetIfExists"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs deleted file mode 100644 index e39edb97dab6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class NetworkSecurityPerimeterConfigurationData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - } - - NetworkSecurityPerimeterConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement, options); - } - - internal static NetworkSecurityPerimeterConfigurationData DeserializeNetworkSecurityPerimeterConfigurationData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - NetworkSecurityPerimeterConfigurationProperties properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = NetworkSecurityPerimeterConfigurationProperties.DeserializeNetworkSecurityPerimeterConfigurationProperties(property.Value, options); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeterConfigurationData( - id, - name, - type, - systemData, - properties, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" properties: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Properties)) - { - builder.Append(" properties: "); - BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityPerimeterConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.cs deleted file mode 100644 index 930f80e24c35..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the NetworkSecurityPerimeterConfiguration data model. - /// Network security perimeter (NSP) configuration resource - /// - public partial class NetworkSecurityPerimeterConfigurationData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NetworkSecurityPerimeterConfigurationData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Network security configuration properties. - /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NetworkSecurityPerimeterConfigurationProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Network security configuration properties. - [WirePath("properties")] - public NetworkSecurityPerimeterConfigurationProperties Properties { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs deleted file mode 100644 index cccb44eece95..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class NetworkSecurityPerimeterConfigurationResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - NetworkSecurityPerimeterConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - NetworkSecurityPerimeterConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs deleted file mode 100644 index 02efbcedde73..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a NetworkSecurityPerimeterConfiguration along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetNetworkSecurityPerimeterConfigurationResource method. - /// Otherwise you can get one from its parent resource using the GetNetworkSecurityPerimeterConfiguration method. - /// - public partial class NetworkSecurityPerimeterConfigurationResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The networkSecurityPerimeterConfigurationName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _networkSecurityPerimeterConfigurationClientDiagnostics; - private readonly NetworkSecurityPerimeterConfigurationsRestOperations _networkSecurityPerimeterConfigurationRestClient; - private readonly NetworkSecurityPerimeterConfigurationData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/networkSecurityPerimeterConfigurations"; - - /// Initializes a new instance of the class for mocking. - protected NetworkSecurityPerimeterConfigurationResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal NetworkSecurityPerimeterConfigurationResource(ArmClient client, NetworkSecurityPerimeterConfigurationData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal NetworkSecurityPerimeterConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _networkSecurityPerimeterConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string networkSecurityPerimeterConfigurationApiVersion); - _networkSecurityPerimeterConfigurationRestClient = new NetworkSecurityPerimeterConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, networkSecurityPerimeterConfigurationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual NetworkSecurityPerimeterConfigurationData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Get"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Get"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Refreshes any information about the association. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Reconcile - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task ReconcileAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Reconcile"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.ReconcileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, _networkSecurityPerimeterConfigurationRestClient.CreateReconcileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Refreshes any information about the association. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Reconcile - /// - /// - /// Default Api Version - /// 2024-12-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Reconcile(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Reconcile"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Reconcile(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, _networkSecurityPerimeterConfigurationRestClient.CreateReconcileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs index 0fa8232d6cae..47f011f86de0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs @@ -32,7 +32,7 @@ public CassandraClustersRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -65,7 +65,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// List all managed Cassandra clusters in this subscription. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ public async Task> ListBySubscriptionAsync( } /// List all managed Cassandra clusters in this subscription. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -147,7 +147,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// List all managed Cassandra clusters in this resource group. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -174,7 +174,7 @@ public async Task> ListByResourceGroupAsync } /// List all managed Cassandra clusters in this resource group. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -235,7 +235,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the properties of a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -266,7 +266,7 @@ public async Task> GetAsync(string subscriptionId } /// Get the properties of a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -331,7 +331,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -356,7 +356,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -419,7 +419,7 @@ internal HttpMessage CreateCreateUpdateRequest(string subscriptionId, string res } /// Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The properties specifying the desired state of the managed Cassandra cluster. @@ -446,7 +446,7 @@ public async Task CreateUpdateAsync(string subscriptionId, string reso } /// Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The properties specifying the desired state of the managed Cassandra cluster. @@ -511,7 +511,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates some of the properties of a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Parameters to provide for specifying the managed Cassandra cluster. @@ -538,7 +538,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates some of the properties of a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Parameters to provide for specifying the managed Cassandra cluster. @@ -605,7 +605,7 @@ internal HttpMessage CreateInvokeCommandRequest(string subscriptionId, string re } /// Invoke a command like nodetool for cassandra maintenance. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Specification which command to run where. @@ -631,7 +631,7 @@ public async Task InvokeCommandAsync(string subscriptionId, string res } /// Invoke a command like nodetool for cassandra maintenance. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Specification which command to run where. @@ -656,395 +656,7 @@ public Response InvokeCommand(string subscriptionId, string resourceGroupName, s } } - internal RequestUriBuilder CreateListCommandRequestUri(string subscriptionId, string resourceGroupName, string clusterName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/commands", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListCommandRequest(string subscriptionId, string resourceGroupName, string clusterName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/commands", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all commands currently running on ring info. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListCommandAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - using var message = CreateListCommandRequest(subscriptionId, resourceGroupName, clusterName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ListCommands value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ListCommands.DeserializeListCommands(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all commands currently running on ring info. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListCommand(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - using var message = CreateListCommandRequest(subscriptionId, resourceGroupName, clusterName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ListCommands value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ListCommands.DeserializeListCommands(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetCommandAsyncRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string commandId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/commands/", false); - uri.AppendPath(commandId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetCommandAsyncRequest(string subscriptionId, string resourceGroupName, string clusterName, string commandId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/commands/", false); - uri.AppendPath(commandId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get details about a specified command that was run asynchronously. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// Managed Cassandra cluster command id. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetCommandAsyncAsync(string subscriptionId, string resourceGroupName, string clusterName, string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var message = CreateGetCommandAsyncRequest(subscriptionId, resourceGroupName, clusterName, commandId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CassandraClusterCommand value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CassandraClusterCommand.DeserializeCassandraClusterCommand(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get details about a specified command that was run asynchronously. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// Managed Cassandra cluster command id. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetCommandAsync(string subscriptionId, string resourceGroupName, string clusterName, string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var message = CreateGetCommandAsyncRequest(subscriptionId, resourceGroupName, clusterName, commandId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CassandraClusterCommand value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CassandraClusterCommand.DeserializeCassandraClusterCommand(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBackupsRequestUri(string subscriptionId, string resourceGroupName, string clusterName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/backups", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListBackupsRequest(string subscriptionId, string resourceGroupName, string clusterName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/backups", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List the backups of this cluster that are available to restore. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListBackupsAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - using var message = CreateListBackupsRequest(subscriptionId, resourceGroupName, clusterName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ListBackups value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = Models.ListBackups.DeserializeListBackups(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List the backups of this cluster that are available to restore. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListBackups(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - using var message = CreateListBackupsRequest(subscriptionId, resourceGroupName, clusterName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ListBackups value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = Models.ListBackups.DeserializeListBackups(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetBackupRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string backupId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/backups/", false); - uri.AppendPath(backupId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetBackupRequest(string subscriptionId, string resourceGroupName, string clusterName, string backupId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false); - uri.AppendPath(clusterName, true); - uri.AppendPath("/backups/", false); - uri.AppendPath(backupId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get the properties of an individual backup of this cluster that is available to restore. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// Id of a restorable backup of a Cassandra cluster. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetBackupAsync(string subscriptionId, string resourceGroupName, string clusterName, string backupId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(backupId, nameof(backupId)); - - using var message = CreateGetBackupRequest(subscriptionId, resourceGroupName, clusterName, backupId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CassandraClusterBackupResourceInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get the properties of an individual backup of this cluster that is available to restore. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// Id of a restorable backup of a Cassandra cluster. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetBackup(string subscriptionId, string resourceGroupName, string clusterName, string backupId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(backupId, nameof(backupId)); - - using var message = CreateGetBackupRequest(subscriptionId, resourceGroupName, clusterName, backupId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CassandraClusterBackupResourceInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeallocateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string xMsForceDeallocate) + internal RequestUriBuilder CreateDeallocateRequestUri(string subscriptionId, string resourceGroupName, string clusterName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1059,7 +671,7 @@ internal RequestUriBuilder CreateDeallocateRequestUri(string subscriptionId, str return uri; } - internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resourceGroupName, string clusterName, string xMsForceDeallocate) + internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resourceGroupName, string clusterName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1075,30 +687,25 @@ internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resou uri.AppendPath("/deallocate", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - if (xMsForceDeallocate != null) - { - request.Headers.Add("x-ms-force-deallocate", xMsForceDeallocate); - } request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } /// 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. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. - /// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeallocateAsync(string subscriptionId, string resourceGroupName, string clusterName, string xMsForceDeallocate = null, CancellationToken cancellationToken = default) + public async Task DeallocateAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName, xMsForceDeallocate); + using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1110,20 +717,19 @@ public async Task DeallocateAsync(string subscriptionId, string resour } /// 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. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. - /// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Deallocate(string subscriptionId, string resourceGroupName, string clusterName, string xMsForceDeallocate = null, CancellationToken cancellationToken = default) + public Response Deallocate(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName, xMsForceDeallocate); + using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1171,7 +777,7 @@ internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGr } /// 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. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -1195,7 +801,7 @@ public async Task StartAsync(string subscriptionId, string resourceGro } /// 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. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -1255,7 +861,7 @@ internal HttpMessage CreateStatusRequest(string subscriptionId, string resourceG } /// Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -1284,7 +890,7 @@ public async Task> StatusAsync(string sub } /// Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs index 28c299f942c8..689217528c22 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs @@ -32,7 +32,7 @@ public CassandraDataCentersRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List all data centers in a particular managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(string subs } /// List all data centers in a particular managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the properties of a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -202,7 +202,7 @@ public async Task> GetAsync(string subscriptio } /// Get the properties of a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -273,7 +273,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -300,7 +300,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -369,7 +369,7 @@ internal HttpMessage CreateCreateUpdateRequest(string subscriptionId, string res } /// Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -398,7 +398,7 @@ public async Task CreateUpdateAsync(string subscriptionId, string reso } /// Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -469,7 +469,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Update some of the properties of a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -498,7 +498,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Update some of the properties of a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs index 1b73499c7471..5e0f82cae440 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs @@ -32,7 +32,7 @@ public CassandraResourcesRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListCassandraKeyspacesRequest(string subscriptionId, } /// Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListCassandraKeyspacesA } /// Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetCassandraKeyspaceRequest(string subscriptionId, st } /// Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -202,7 +202,7 @@ public async Task> GetCassandraKeyspaceAsync(str } /// Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateCassandraKeyspaceRequest(string subscript } /// Create or update an Azure Cosmos DB Cassandra keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -306,7 +306,7 @@ public async Task CreateUpdateCassandraKeyspaceAsync(string subscripti } /// Create or update an Azure Cosmos DB Cassandra keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteCassandraKeyspaceRequest(string subscriptionId, } /// Deletes an existing Azure Cosmos DB Cassandra keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -399,7 +399,7 @@ public async Task DeleteCassandraKeyspaceAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB Cassandra keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetCassandraKeyspaceThroughputRequest(string subscrip } /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -499,7 +499,7 @@ public async Task> GetCassandraKeyspaceThroughpu } /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateCassandraKeyspaceThroughputRequest(string subsc } /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -605,7 +605,7 @@ public async Task UpdateCassandraKeyspaceThroughputAsync(string subscr } /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateCassandraKeyspaceToAutoscaleRequest(string sub } /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -701,7 +701,7 @@ public async Task MigrateCassandraKeyspaceToAutoscaleAsync(string subs } /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateCassandraKeyspaceToManualThroughputRequest(str } /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -795,7 +795,7 @@ public async Task MigrateCassandraKeyspaceToManualThroughputAsync(stri } /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -862,7 +862,7 @@ internal HttpMessage CreateListCassandraTablesRequest(string subscriptionId, str } /// Lists the Cassandra table under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -893,7 +893,7 @@ public async Task> ListCassandraTablesAsync(s } /// Lists the Cassandra table under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -966,7 +966,7 @@ internal HttpMessage CreateGetCassandraTableRequest(string subscriptionId, strin } /// Gets the Cassandra table under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1001,7 +1001,7 @@ public async Task> GetCassandraTableAsync(string su } /// Gets the Cassandra table under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1082,7 +1082,7 @@ internal HttpMessage CreateCreateUpdateCassandraTableRequest(string subscription } /// Create or update an Azure Cosmos DB Cassandra Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1113,7 +1113,7 @@ public async Task CreateUpdateCassandraTableAsync(string subscriptionI } /// Create or update an Azure Cosmos DB Cassandra Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1185,7 +1185,7 @@ internal HttpMessage CreateDeleteCassandraTableRequest(string subscriptionId, st } /// Deletes an existing Azure Cosmos DB Cassandra table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1214,7 +1214,7 @@ public async Task DeleteCassandraTableAsync(string subscriptionId, str } /// Deletes an existing Azure Cosmos DB Cassandra table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1287,7 +1287,7 @@ internal HttpMessage CreateGetCassandraTableThroughputRequest(string subscriptio } /// Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1322,7 +1322,7 @@ public async Task> GetCassandraTableThroughputAs } /// Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1405,7 +1405,7 @@ internal HttpMessage CreateUpdateCassandraTableThroughputRequest(string subscrip } /// Update RUs per second of an Azure Cosmos DB Cassandra table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1436,7 +1436,7 @@ public async Task UpdateCassandraTableThroughputAsync(string subscript } /// Update RUs per second of an Azure Cosmos DB Cassandra table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1511,7 +1511,7 @@ internal HttpMessage CreateMigrateCassandraTableToAutoscaleRequest(string subscr } /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1540,7 +1540,7 @@ public async Task MigrateCassandraTableToAutoscaleAsync(string subscri } /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1613,7 +1613,7 @@ internal HttpMessage CreateMigrateCassandraTableToManualThroughputRequest(string } /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1642,7 +1642,7 @@ public async Task MigrateCassandraTableToManualThroughputAsync(string } /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1669,856 +1669,5 @@ public Response MigrateCassandraTableToManualThroughput(string subscriptionId, s throw new RequestFailedException(message.Response); } } - - internal RequestUriBuilder CreateListCassandraViewsRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListCassandraViewsRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListCassandraViewsAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - - using var message = CreateListCassandraViewsRequest(subscriptionId, resourceGroupName, accountName, keyspaceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CassandraViewListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CassandraViewListResult.DeserializeCassandraViewListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListCassandraViews(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - - using var message = CreateListCassandraViewsRequest(subscriptionId, resourceGroupName, accountName, keyspaceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CassandraViewListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CassandraViewListResult.DeserializeCassandraViewListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetCassandraViewRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetCassandraViewRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetCassandraViewAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateGetCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CassandraViewGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CassandraViewGetResultData.DeserializeCassandraViewGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CassandraViewGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response GetCassandraView(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateGetCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CassandraViewGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CassandraViewGetResultData.DeserializeCassandraViewGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CassandraViewGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateUpdateCassandraViewRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewGetResultCreateOrUpdateContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateUpdateCassandraViewRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewGetResultCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update an Azure Cosmos DB Cassandra View. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateCassandraViewAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update an Azure Cosmos DB Cassandra View. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateCassandraView(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteCassandraViewRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteCassandraViewRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB Cassandra view. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteCassandraViewAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateDeleteCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB Cassandra view. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response DeleteCassandraView(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateDeleteCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetCassandraViewThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetCassandraViewThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetCassandraViewThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateGetCassandraViewThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ThroughputSettingData.DeserializeThroughputSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ThroughputSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response GetCassandraViewThroughput(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateGetCassandraViewThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ThroughputSettingData.DeserializeThroughputSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ThroughputSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateCassandraViewThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateCassandraViewThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Update RUs per second of an Azure Cosmos DB Cassandra view. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The RUs per second of the parameters to provide for the current Cassandra view. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task UpdateCassandraViewThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateCassandraViewThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update RUs per second of an Azure Cosmos DB Cassandra view. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The RUs per second of the parameters to provide for the current Cassandra view. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response UpdateCassandraViewThroughput(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateCassandraViewThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMigrateCassandraViewToAutoscaleRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMigrateCassandraViewToAutoscaleRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task MigrateCassandraViewToAutoscaleAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateMigrateCassandraViewToAutoscaleRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response MigrateCassandraViewToAutoscale(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateMigrateCassandraViewToAutoscaleRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMigrateCassandraViewToManualThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMigrateCassandraViewToManualThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/cassandraKeyspaces/", false); - uri.AppendPath(keyspaceName, true); - uri.AppendPath("/views/", false); - uri.AppendPath(viewName, true); - uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task MigrateCassandraViewToManualThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateMigrateCassandraViewToManualThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB keyspace name. - /// Cosmos DB view name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response MigrateCassandraViewToManualThroughput(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateMigrateCassandraViewToManualThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ChaosFaultRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ChaosFaultRestOperations.cs deleted file mode 100644 index d1514156a838..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ChaosFaultRestOperations.cs +++ /dev/null @@ -1,421 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ChaosFaultRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ChaosFaultRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ChaosFaultRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/chaosFaults", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/chaosFaults", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List Chaos Faults for CosmosDB account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ChaosFaultListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ChaosFaultListResponse.DeserializeChaosFaultListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List Chaos Faults for CosmosDB account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ChaosFaultListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ChaosFaultListResponse.DeserializeChaosFaultListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateEnableDisableRequestUri(string subscriptionId, string resourceGroupName, string accountName, string chaosFault, CosmosDBChaosFaultResourceData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/chaosFaults/", false); - uri.AppendPath(chaosFault, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateEnableDisableRequest(string subscriptionId, string resourceGroupName, string accountName, string chaosFault, CosmosDBChaosFaultResourceData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/chaosFaults/", false); - uri.AppendPath(chaosFault, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Enable, disable Chaos Fault in a CosmosDB account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name of the ChaosFault. - /// A request object to enable/disable the chaos fault. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task EnableDisableAsync(string subscriptionId, string resourceGroupName, string accountName, string chaosFault, CosmosDBChaosFaultResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(chaosFault, nameof(chaosFault)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateEnableDisableRequest(subscriptionId, resourceGroupName, accountName, chaosFault, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Enable, disable Chaos Fault in a CosmosDB account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name of the ChaosFault. - /// A request object to enable/disable the chaos fault. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response EnableDisable(string subscriptionId, string resourceGroupName, string accountName, string chaosFault, CosmosDBChaosFaultResourceData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(chaosFault, nameof(chaosFault)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateEnableDisableRequest(subscriptionId, resourceGroupName, accountName, chaosFault, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string chaosFault) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/chaosFaults/", false); - uri.AppendPath(chaosFault, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string chaosFault) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/chaosFaults/", false); - uri.AppendPath(chaosFault, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name of the ChaosFault. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accountName, string chaosFault, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(chaosFault, nameof(chaosFault)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, chaosFault); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CosmosDBChaosFaultResourceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CosmosDBChaosFaultResourceData.DeserializeCosmosDBChaosFaultResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBChaosFaultResourceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name of the ChaosFault. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string accountName, string chaosFault, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(chaosFault, nameof(chaosFault)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, chaosFault); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CosmosDBChaosFaultResourceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CosmosDBChaosFaultResourceData.DeserializeCosmosDBChaosFaultResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBChaosFaultResourceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List Chaos Faults for CosmosDB account. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ChaosFaultListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ChaosFaultListResponse.DeserializeChaosFaultListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List Chaos Faults for CosmosDB account. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ChaosFaultListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ChaosFaultListResponse.DeserializeChaosFaultListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs index 18fb4f635a7e..469114ec04ba 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionPartitionRegionRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given collection and region, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -124,7 +124,7 @@ public async Task> ListMetricsAsync(string s } /// Retrieves the metrics determined by the given filter for the given collection and region, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs index 23991a6972a3..43cc0500e3ed 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionPartitionRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -83,7 +83,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given collection, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -118,7 +118,7 @@ public async Task> ListMetricsAsync(string s } /// Retrieves the metrics determined by the given filter for the given collection, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -205,7 +205,7 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Retrieves the usages (most recent storage data) for the given collection, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -239,7 +239,7 @@ public async Task> ListUsagesAsync(string subscr } /// Retrieves the usages (most recent storage data) for the given collection, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs index 3be6408b09ea..ea0c5534ae05 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionRegionRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account, collection and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -124,7 +124,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account, collection and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs index e2ebc243955d..ed6e16c886ed 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -83,7 +83,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account and collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -118,7 +118,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account and collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -205,7 +205,7 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Retrieves the usages (most recent storage data) for the given collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -239,7 +239,7 @@ public async Task> ListUsagesAsync(string subscri } /// Retrieves the usages (most recent storage data) for the given collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -317,7 +317,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string subscriptionId, s } /// Retrieves metric definitions for the given collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -350,7 +350,7 @@ public async Task> ListMetricDefin } /// Retrieves metric definitions for the given collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs deleted file mode 100644 index e09d9c27deb7..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs +++ /dev/null @@ -1,837 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class DataTransferJobsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DataTransferJobsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public DataTransferJobsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName, DataTransferJobGetResultCreateOrUpdateContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName, DataTransferJobGetResultCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Creates a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The to use. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, jobName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The to use. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string accountName, string jobName, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, jobName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DataTransferJobGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DataTransferJobGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreatePauseRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/pause", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreatePauseRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/pause", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Pause a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> PauseAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreatePauseRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Pause a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Pause(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreatePauseRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateResumeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/resume", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateResumeRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/resume", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Resumes a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ResumeAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateResumeRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Resumes a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Resume(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateResumeRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCancelRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/cancel", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/cancel", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Cancels a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CancelAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Cancels a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Cancel(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCompleteRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/complete", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCompleteRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/complete", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Completes a Data Transfer Online Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CompleteAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateCompleteRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Completes a Data Transfer Online Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Complete(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateCompleteRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByDatabaseAccountRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByDatabaseAccountRequest(string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/dataTransferJobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of Data Transfer jobs. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDatabaseAccountAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListByDatabaseAccountRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobFeedResults value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DataTransferJobFeedResults.DeserializeDataTransferJobFeedResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of Data Transfer jobs. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDatabaseAccount(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListByDatabaseAccountRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobFeedResults value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DataTransferJobFeedResults.DeserializeDataTransferJobFeedResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByDatabaseAccountNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByDatabaseAccountNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of Data Transfer jobs. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDatabaseAccountNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListByDatabaseAccountNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobFeedResults value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DataTransferJobFeedResults.DeserializeDataTransferJobFeedResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of Data Transfer jobs. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDatabaseAccountNextPage(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListByDatabaseAccountNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobFeedResults value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DataTransferJobFeedResults.DeserializeDataTransferJobFeedResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs index 2e55e0fb1628..fe96d8fab603 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs @@ -32,7 +32,7 @@ public DatabaseAccountRegionRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -79,7 +79,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -112,7 +112,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs index 8d69790b942f..ede17771e950 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs @@ -32,7 +32,7 @@ public DatabaseAccountsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -71,7 +71,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Retrieves the properties of an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> GetAsync(string subscriptionId, } /// Retrieves the properties of an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -171,7 +171,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates the properties of an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The parameters to provide for the current database account. @@ -197,7 +197,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates the properties of an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The parameters to provide for the current database account. @@ -261,7 +261,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The parameters to provide for the current database account. @@ -287,7 +287,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The parameters to provide for the current database account. @@ -346,7 +346,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -371,7 +371,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -435,7 +435,7 @@ internal HttpMessage CreateFailoverPriorityChangeRequest(string subscriptionId, } /// Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The new failover policies for the database account. @@ -462,7 +462,7 @@ public async Task FailoverPriorityChangeAsync(string subscriptionId, s } /// Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The new failover policies for the database account. @@ -517,7 +517,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) } /// Lists all the Azure Cosmos DB database accounts available under the subscription. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -542,7 +542,7 @@ public async Task> ListAsync(string subscri } /// Lists all the Azure Cosmos DB database accounts available under the subscription. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -599,7 +599,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Lists all the Azure Cosmos DB database accounts available under the given resource group. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -626,7 +626,7 @@ public async Task> ListByResourceGroupAsync } /// Lists all the Azure Cosmos DB database accounts available under the given resource group. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -689,7 +689,7 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc } /// Lists the access keys for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -718,7 +718,7 @@ public async Task> ListKeysAsync(string subscri } /// Lists the access keys for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -783,7 +783,7 @@ internal HttpMessage CreateListConnectionStringsRequest(string subscriptionId, s } /// Lists the connection strings for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -812,7 +812,7 @@ public async Task> ListConn } /// Lists the connection strings for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -881,7 +881,7 @@ internal HttpMessage CreateOfflineRegionRequest(string subscriptionId, string re } /// Offline the specified region for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region to offline for the database account. @@ -908,7 +908,7 @@ public async Task OfflineRegionAsync(string subscriptionId, string res } /// Offline the specified region for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region to offline for the database account. @@ -975,7 +975,7 @@ internal HttpMessage CreateOnlineRegionRequest(string subscriptionId, string res } /// Online the specified region for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region to online for the database account. @@ -1002,7 +1002,7 @@ public async Task OnlineRegionAsync(string subscriptionId, string reso } /// Online the specified region for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region to online for the database account. @@ -1065,7 +1065,7 @@ internal HttpMessage CreateListReadOnlyKeysRequest(string subscriptionId, string } /// Lists the read-only access keys for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -1094,7 +1094,7 @@ public async Task> ListReadOnlyKeysAsyn } /// Lists the read-only access keys for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -1162,7 +1162,7 @@ internal HttpMessage CreateRegenerateKeyRequest(string subscriptionId, string re } /// Regenerates an access key for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the key to regenerate. @@ -1189,7 +1189,7 @@ public async Task RegenerateKeyAsync(string subscriptionId, string res } /// Regenerates an access key for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the key to regenerate. @@ -1335,7 +1335,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -1366,7 +1366,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -1441,7 +1441,7 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Retrieves the usages (most recent data) for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @@ -1471,7 +1471,7 @@ public async Task> ListUsagesAsync(string subscri } /// Retrieves the usages (most recent data) for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @@ -1537,7 +1537,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string subscriptionId, s } /// Retrieves metric definitions for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -1566,7 +1566,7 @@ public async Task> ListMetricDefin } /// Retrieves metric definitions for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs index 332de1da49e4..31d74795b422 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs @@ -32,7 +32,7 @@ public DatabaseRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -79,7 +79,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account and database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -112,7 +112,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account and database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -193,7 +193,7 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Retrieves the usages (most recent data) for the given database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -225,7 +225,7 @@ public async Task> ListUsagesAsync(string subscri } /// Retrieves the usages (most recent data) for the given database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -297,7 +297,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string subscriptionId, s } /// Retrieves metric definitions for the given database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -328,7 +328,7 @@ public async Task> ListMetricDefin } /// Retrieves metric definitions for the given database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs deleted file mode 100644 index 08b9a4a4744b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs +++ /dev/null @@ -1,430 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class GraphResourcesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of GraphResourcesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public GraphResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListGraphsRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListGraphsRequest(string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the graphs under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListGraphsAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListGraphsRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GraphResourcesListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = GraphResourcesListResult.DeserializeGraphResourcesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the graphs under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListGraphs(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListGraphsRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GraphResourcesListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = GraphResourcesListResult.DeserializeGraphResourcesListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetGraphRequestUri(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetGraphRequest(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetGraphAsync(string subscriptionId, string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var message = CreateGetGraphRequest(subscriptionId, resourceGroupName, accountName, graphName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GraphResourceGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = GraphResourceGetResultData.DeserializeGraphResourceGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((GraphResourceGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetGraph(string subscriptionId, string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var message = CreateGetGraphRequest(subscriptionId, resourceGroupName, accountName, graphName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GraphResourceGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = GraphResourceGetResultData.DeserializeGraphResourceGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((GraphResourceGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateUpdateGraphRequestUri(string subscriptionId, string resourceGroupName, string accountName, string graphName, GraphResourceGetResultCreateOrUpdateContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateUpdateGraphRequest(string subscriptionId, string resourceGroupName, string accountName, string graphName, GraphResourceGetResultCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update an Azure Cosmos DB Graph. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB graph resource name. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateGraphAsync(string subscriptionId, string resourceGroupName, string accountName, string graphName, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateGraphRequest(subscriptionId, resourceGroupName, accountName, graphName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update an Azure Cosmos DB Graph. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB graph resource name. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateGraph(string subscriptionId, string resourceGroupName, string accountName, string graphName, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateGraphRequest(subscriptionId, resourceGroupName, accountName, graphName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteGraphResourceRequestUri(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteGraphResourceRequest(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB Graph Resource. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteGraphResourceAsync(string subscriptionId, string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var message = CreateDeleteGraphResourceRequest(subscriptionId, resourceGroupName, accountName, graphName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB Graph Resource. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response DeleteGraphResource(string subscriptionId, string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var message = CreateDeleteGraphResourceRequest(subscriptionId, resourceGroupName, accountName, graphName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs index abb3d79d51b0..3ac348476698 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs @@ -32,7 +32,7 @@ public GremlinResourcesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListGremlinDatabasesRequest(string subscriptionId, st } /// Lists the Gremlin databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListGremlinDatabasesAsync } /// Lists the Gremlin databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetGremlinDatabaseRequest(string subscriptionId, stri } /// Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -202,7 +202,7 @@ public async Task> GetGremlinDatabaseAsync(string } /// Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateGremlinDatabaseRequest(string subscriptio } /// Create or update an Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -306,7 +306,7 @@ public async Task CreateUpdateGremlinDatabaseAsync(string subscription } /// Create or update an Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteGremlinDatabaseRequest(string subscriptionId, s } /// Deletes an existing Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -399,7 +399,7 @@ public async Task DeleteGremlinDatabaseAsync(string subscriptionId, st } /// Deletes an existing Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetGremlinDatabaseThroughputRequest(string subscripti } /// Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -499,7 +499,7 @@ public async Task> GetGremlinDatabaseThroughputA } /// Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateGremlinDatabaseThroughputRequest(string subscri } /// Update RUs per second of an Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -605,7 +605,7 @@ public async Task UpdateGremlinDatabaseThroughputAsync(string subscrip } /// Update RUs per second of an Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateGremlinDatabaseToAutoscaleRequest(string subsc } /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -701,7 +701,7 @@ public async Task MigrateGremlinDatabaseToAutoscaleAsync(string subscr } /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateGremlinDatabaseToManualThroughputRequest(strin } /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -795,7 +795,7 @@ public async Task MigrateGremlinDatabaseToManualThroughputAsync(string } /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -862,7 +862,7 @@ internal HttpMessage CreateListGremlinGraphsRequest(string subscriptionId, strin } /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -893,7 +893,7 @@ public async Task> ListGremlinGraphsAsync(strin } /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -966,7 +966,7 @@ internal HttpMessage CreateGetGremlinGraphRequest(string subscriptionId, string } /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1001,7 +1001,7 @@ public async Task> GetGremlinGraphAsync(string subscr } /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1082,7 +1082,7 @@ internal HttpMessage CreateCreateUpdateGremlinGraphRequest(string subscriptionId } /// Create or update an Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1113,7 +1113,7 @@ public async Task CreateUpdateGremlinGraphAsync(string subscriptionId, } /// Create or update an Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1185,7 +1185,7 @@ internal HttpMessage CreateDeleteGremlinGraphRequest(string subscriptionId, stri } /// Deletes an existing Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1214,7 +1214,7 @@ public async Task DeleteGremlinGraphAsync(string subscriptionId, strin } /// Deletes an existing Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1287,7 +1287,7 @@ internal HttpMessage CreateGetGremlinGraphThroughputRequest(string subscriptionI } /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1322,7 +1322,7 @@ public async Task> GetGremlinGraphThroughputAsyn } /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1405,7 +1405,7 @@ internal HttpMessage CreateUpdateGremlinGraphThroughputRequest(string subscripti } /// Update RUs per second of an Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1436,7 +1436,7 @@ public async Task UpdateGremlinGraphThroughputAsync(string subscriptio } /// Update RUs per second of an Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1511,7 +1511,7 @@ internal HttpMessage CreateMigrateGremlinGraphToAutoscaleRequest(string subscrip } /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1540,7 +1540,7 @@ public async Task MigrateGremlinGraphToAutoscaleAsync(string subscript } /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1613,7 +1613,7 @@ internal HttpMessage CreateMigrateGremlinGraphToManualThroughputRequest(string s } /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1642,7 +1642,7 @@ public async Task MigrateGremlinGraphToManualThroughputAsync(string su } /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1719,7 +1719,7 @@ internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string sub } /// Retrieves continuous backup information for a gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1750,7 +1750,7 @@ public async Task RetrieveContinuousBackupInformationAsync(string subs } /// Retrieves continuous backup information for a gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs index d1b742c42c56..860bc589b324 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs @@ -32,7 +32,7 @@ public LocationsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -65,7 +65,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) } /// List Cosmos DB locations and their properties. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ public async Task> ListAsync(string subscri } /// List Cosmos DB locations and their properties. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -145,7 +145,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation locat } /// Get the properties of an existing Cosmos DB location. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The cancellation token to use. /// is null. @@ -173,7 +173,7 @@ public async Task> GetAsync(string subscriptionId } /// Get the properties of an existing Cosmos DB location. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The cancellation token to use. /// is null. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs index bf36184e7106..5411b5b9b8d1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs @@ -32,7 +32,7 @@ public MongoDBResourcesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListMongoDBDatabasesRequest(string subscriptionId, st } /// Lists the MongoDB databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListMongoDBDatabasesAsync } /// Lists the MongoDB databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetMongoDBDatabaseRequest(string subscriptionId, stri } /// Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -202,7 +202,7 @@ public async Task> GetMongoDBDatabaseAsync(string } /// Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateMongoDBDatabaseRequest(string subscriptio } /// Create or updates Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -306,7 +306,7 @@ public async Task CreateUpdateMongoDBDatabaseAsync(string subscription } /// Create or updates Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteMongoDBDatabaseRequest(string subscriptionId, s } /// Deletes an existing Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -399,7 +399,7 @@ public async Task DeleteMongoDBDatabaseAsync(string subscriptionId, st } /// Deletes an existing Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetMongoDBDatabaseThroughputRequest(string subscripti } /// Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -499,7 +499,7 @@ public async Task> GetMongoDBDatabaseThroughputA } /// Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateMongoDBDatabaseThroughputRequest(string subscri } /// Update RUs per second of the an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -605,7 +605,7 @@ public async Task UpdateMongoDBDatabaseThroughputAsync(string subscrip } /// Update RUs per second of the an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateMongoDBDatabaseToAutoscaleRequest(string subsc } /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -701,7 +701,7 @@ public async Task MigrateMongoDBDatabaseToAutoscaleAsync(string subscr } /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateMongoDBDatabaseToManualThroughputRequest(strin } /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -795,7 +795,7 @@ public async Task MigrateMongoDBDatabaseToManualThroughputAsync(string } /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -821,430 +821,6 @@ public Response MigrateMongoDBDatabaseToManualThroughput(string subscriptionId, } } - internal RequestUriBuilder CreateMongoDBDatabaseRetrieveThroughputDistributionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(retrieveThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBDatabaseRetrieveThroughputDistributionAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, retrieveThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response MongoDBDatabaseRetrieveThroughputDistribution(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, retrieveThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMongoDBDatabaseRedistributeThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBDatabaseRedistributeThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(redistributeThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Redistribute throughput for an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for redistributing throughput for the current MongoDB database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBDatabaseRedistributeThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var message = CreateMongoDBDatabaseRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, redistributeThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Redistribute throughput for an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for redistributing throughput for the current MongoDB database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response MongoDBDatabaseRedistributeThroughput(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var message = CreateMongoDBDatabaseRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, redistributeThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMongoDBContainerRetrieveThroughputDistributionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RetrieveThroughputParameters retrieveThroughputParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBContainerRetrieveThroughputDistributionRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RetrieveThroughputParameters retrieveThroughputParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(retrieveThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBContainerRetrieveThroughputDistributionAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateMongoDBContainerRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response MongoDBContainerRetrieveThroughputDistribution(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateMongoDBContainerRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMongoDBContainerRedistributeThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RedistributeThroughputParameters redistributeThroughputParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBContainerRedistributeThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RedistributeThroughputParameters redistributeThroughputParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(redistributeThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Redistribute throughput for an Azure Cosmos DB MongoDB container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters to provide for redistributing throughput for the current MongoDB container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBContainerRedistributeThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var message = CreateMongoDBContainerRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Redistribute throughput for an Azure Cosmos DB MongoDB container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters to provide for redistributing throughput for the current MongoDB container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response MongoDBContainerRedistributeThroughput(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var message = CreateMongoDBContainerRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListMongoDBCollectionsRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName) { var uri = new RawRequestUriBuilder(); @@ -1286,7 +862,7 @@ internal HttpMessage CreateListMongoDBCollectionsRequest(string subscriptionId, } /// Lists the MongoDB collection under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1317,7 +893,7 @@ public async Task> ListMongoDBCollectionsA } /// Lists the MongoDB collection under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1390,7 +966,7 @@ internal HttpMessage CreateGetMongoDBCollectionRequest(string subscriptionId, st } /// Gets the MongoDB collection under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1425,7 +1001,7 @@ public async Task> GetMongoDBCollectionAsync(str } /// Gets the MongoDB collection under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1506,7 +1082,7 @@ internal HttpMessage CreateCreateUpdateMongoDBCollectionRequest(string subscript } /// Create or update an Azure Cosmos DB MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1537,7 +1113,7 @@ public async Task CreateUpdateMongoDBCollectionAsync(string subscripti } /// Create or update an Azure Cosmos DB MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1609,7 +1185,7 @@ internal HttpMessage CreateDeleteMongoDBCollectionRequest(string subscriptionId, } /// Deletes an existing Azure Cosmos DB MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1638,7 +1214,7 @@ public async Task DeleteMongoDBCollectionAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1666,218 +1242,6 @@ public Response DeleteMongoDBCollection(string subscriptionId, string resourceGr } } - internal RequestUriBuilder CreateMongoDBDatabasePartitionMergeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBDatabasePartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(mergeParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Merges the partitions of a MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBDatabasePartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var message = CreateMongoDBDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Merges the partitions of a MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response MongoDBDatabasePartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var message = CreateMongoDBDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListMongoDBCollectionPartitionMergeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListMongoDBCollectionPartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(mergeParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Merges the partitions of a MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task ListMongoDBCollectionPartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var message = CreateListMongoDBCollectionPartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, mergeParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Merges the partitions of a MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListMongoDBCollectionPartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var message = CreateListMongoDBCollectionPartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, mergeParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateGetMongoDBCollectionThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName) { var uri = new RawRequestUriBuilder(); @@ -1923,7 +1287,7 @@ internal HttpMessage CreateGetMongoDBCollectionThroughputRequest(string subscrip } /// Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1958,7 +1322,7 @@ public async Task> GetMongoDBCollectionThroughpu } /// Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2041,7 +1405,7 @@ internal HttpMessage CreateUpdateMongoDBCollectionThroughputRequest(string subsc } /// Update the RUs per second of an Azure Cosmos DB MongoDB collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2072,7 +1436,7 @@ public async Task UpdateMongoDBCollectionThroughputAsync(string subscr } /// Update the RUs per second of an Azure Cosmos DB MongoDB collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2147,7 +1511,7 @@ internal HttpMessage CreateMigrateMongoDBCollectionToAutoscaleRequest(string sub } /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2176,7 +1540,7 @@ public async Task MigrateMongoDBCollectionToAutoscaleAsync(string subs } /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2249,7 +1613,7 @@ internal HttpMessage CreateMigrateMongoDBCollectionToManualThroughputRequest(str } /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2278,7 +1642,7 @@ public async Task MigrateMongoDBCollectionToManualThroughputAsync(stri } /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2345,7 +1709,7 @@ internal HttpMessage CreateGetMongoRoleDefinitionRequest(string subscriptionId, } /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2378,7 +1742,7 @@ public async Task> GetMongoRoleDefinitionAsy } /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2453,7 +1817,7 @@ internal HttpMessage CreateCreateUpdateMongoRoleDefinitionRequest(string subscri } /// Creates or updates an Azure Cosmos DB Mongo Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2482,7 +1846,7 @@ public async Task CreateUpdateMongoRoleDefinitionAsync(string subscrip } /// Creates or updates an Azure Cosmos DB Mongo Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2549,7 +1913,7 @@ internal HttpMessage CreateDeleteMongoRoleDefinitionRequest(string subscriptionI } /// Deletes an existing Azure Cosmos DB Mongo Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2577,7 +1941,7 @@ public async Task DeleteMongoRoleDefinitionAsync(string subscriptionId } /// Deletes an existing Azure Cosmos DB Mongo Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2641,7 +2005,7 @@ internal HttpMessage CreateListMongoRoleDefinitionsRequest(string subscriptionId } /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -2670,7 +2034,7 @@ public async Task> ListMongoRoleDefini } /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -2737,7 +2101,7 @@ internal HttpMessage CreateGetMongoUserDefinitionRequest(string subscriptionId, } /// Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2770,7 +2134,7 @@ public async Task> GetMongoUserDefinitionAsy } /// Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2845,7 +2209,7 @@ internal HttpMessage CreateCreateUpdateMongoUserDefinitionRequest(string subscri } /// Creates or updates an Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2874,7 +2238,7 @@ public async Task CreateUpdateMongoUserDefinitionAsync(string subscrip } /// Creates or updates an Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2941,7 +2305,7 @@ internal HttpMessage CreateDeleteMongoUserDefinitionRequest(string subscriptionI } /// Deletes an existing Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2969,7 +2333,7 @@ public async Task DeleteMongoUserDefinitionAsync(string subscriptionId } /// Deletes an existing Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -3033,7 +2397,7 @@ internal HttpMessage CreateListMongoUserDefinitionsRequest(string subscriptionId } /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -3062,7 +2426,7 @@ public async Task> ListMongoUserDefini } /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -3139,7 +2503,7 @@ internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string sub } /// Retrieves continuous backup information for a Mongodb collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3170,7 +2534,7 @@ public async Task RetrieveContinuousBackupInformationAsync(string subs } /// Retrieves continuous backup information for a Mongodb collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs deleted file mode 100644 index e6c0e1ae2121..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs +++ /dev/null @@ -1,413 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class NetworkSecurityPerimeterConfigurationsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of NetworkSecurityPerimeterConfigurationsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public NetworkSecurityPerimeterConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/networkSecurityPerimeterConfigurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/networkSecurityPerimeterConfigurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkSecurityPerimeterConfigurationListResult.DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkSecurityPerimeterConfigurationListResult.DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); - uri.AppendPath(networkSecurityPerimeterConfigurationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); - uri.AppendPath(networkSecurityPerimeterConfigurationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets effective Network Security Perimeter Configuration for association. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NetworkSecurityPerimeterConfigurationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets effective Network Security Perimeter Configuration for association. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NetworkSecurityPerimeterConfigurationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateReconcileRequestUri(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); - uri.AppendPath(networkSecurityPerimeterConfigurationName, true); - uri.AppendPath("/reconcile", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateReconcileRequest(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); - uri.AppendPath(networkSecurityPerimeterConfigurationName, true); - uri.AppendPath("/reconcile", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Refreshes any information about the association. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task ReconcileAsync(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var message = CreateReconcileRequest(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Refreshes any information about the association. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Reconcile(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var message = CreateReconcileRequest(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NetworkSecurityPerimeterConfigurationListResult.DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NetworkSecurityPerimeterConfigurationListResult.DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs index 3ca7174ecf26..48d94003d106 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs @@ -32,7 +32,7 @@ public PartitionKeyRangeIdRegionRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -91,7 +91,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given partition key range id and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -130,7 +130,7 @@ public async Task> ListMetricsAsync(string s } /// Retrieves the metrics determined by the given filter for the given partition key range id and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs index 2d9e1a0d7fce..ee36cdfcbb67 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs @@ -32,7 +32,7 @@ public PartitionKeyRangeIdRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given partition key range id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -124,7 +124,7 @@ public async Task> ListMetricsAsync(string s } /// Retrieves the metrics determined by the given filter for the given partition key range id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs index 636f8fa7c522..9dbdc853a193 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs @@ -32,7 +32,7 @@ public PercentileRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -75,7 +75,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -106,7 +106,7 @@ public async Task> ListMetricsAsync(string } /// Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs index 2928508f2e77..ec7700082902 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs @@ -32,7 +32,7 @@ public PercentileSourceTargetRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -83,7 +83,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. @@ -118,7 +118,7 @@ public async Task> ListMetricsAsync(string } /// Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs index d079cbe33eb9..d76cc982cebe 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs @@ -32,7 +32,7 @@ public PercentileTargetRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -79,7 +79,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. @@ -112,7 +112,7 @@ public async Task> ListMetricsAsync(string } /// Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index c53cbe3f23c9..76f10e4c341a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListByDatabaseAccountRequest(string subscriptionId, s } /// List all private endpoint connections on a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListByD } /// List all private endpoint connections on a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets a private endpoint connection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -202,7 +202,7 @@ public async Task> GetAsync(stri } /// Gets a private endpoint connection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Approve or reject a private endpoint connection with a given name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -306,7 +306,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Approve or reject a private endpoint connection with a given name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -373,7 +373,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a private endpoint connection with a given name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -400,7 +400,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a private endpoint connection with a given name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 682c3039433e..f1d3782aaa74 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListByDatabaseAccountRequest(string subscriptionId, s } /// Gets the private link resources that need to be created for a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListByDatabas } /// Gets the private link resources that need to be created for a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the private link resources that need to be created for a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private link resource. @@ -202,7 +202,7 @@ public async Task> GetAsync(string sub } /// Gets the private link resources that need to be created for a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private link resource. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs index 0860fe0c3e7e..7d63c8957070 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs @@ -32,7 +32,7 @@ public RestorableDatabaseAccountsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -69,7 +69,7 @@ internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLoc } /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The cancellation token to use. /// is null. @@ -95,7 +95,7 @@ public async Task> ListByLocation } /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The cancellation token to use. /// is null. @@ -149,7 +149,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) } /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -174,7 +174,7 @@ public async Task> ListAsync(stri } /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -233,7 +233,7 @@ internal HttpMessage CreateGetByLocationRequest(string subscriptionId, AzureLoca } /// Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. @@ -262,7 +262,7 @@ public async Task> GetByLocationAsync(st } /// Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs index 52967b713292..3747dccf52a5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableGremlinDatabasesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. @@ -100,7 +100,7 @@ public async Task> ListAsync(stri } /// Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs index 43c84a6bc852..a2c14519a4e4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs @@ -32,7 +32,7 @@ public RestorableGremlinGraphsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -97,7 +97,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the Gremlin database. @@ -127,7 +127,7 @@ public async Task> ListAsync(string } /// Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the Gremlin database. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs index bc85fae89e46..10a972b689bd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableGremlinResourcesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. @@ -118,7 +118,7 @@ public async Task> ListAsync(stri } /// Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs index 9a0ca979b002..7ffbb53c4d7f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs @@ -32,7 +32,7 @@ public RestorableMongodbCollectionsRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -97,7 +97,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the MongoDB database. @@ -127,7 +127,7 @@ public async Task> ListAsync(st } /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the MongoDB database. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs index 9153f94b0844..bcf213046cfc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableMongodbDatabasesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. @@ -100,7 +100,7 @@ public async Task> ListAsync(stri } /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs index ac2f7ca3302f..95c49273bdf7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableMongodbResourcesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. @@ -118,7 +118,7 @@ public async Task> ListAsync(stri } /// Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs index 76655bac0dbf..249dcc80f3a8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs @@ -32,7 +32,7 @@ public RestorableSqlContainersRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -97,7 +97,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the SQL database. @@ -127,7 +127,7 @@ public async Task> ListAsync(string } /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the SQL database. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs index ef6bfd00ef1d..b88c0558bf96 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableSqlDatabasesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. @@ -100,7 +100,7 @@ public async Task> ListAsync(string s } /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs index 09c48c29f763..5b3434708131 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableSqlResourcesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. @@ -118,7 +118,7 @@ public async Task> ListAsync(string s } /// Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs index 4242b73b8959..5db55248b399 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableTableResourcesRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. @@ -118,7 +118,7 @@ public async Task> ListAsync(string } /// Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs index 5d11e7d33221..76b72c02c7ed 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableTablesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// Restorable Tables event feed start time. @@ -118,7 +118,7 @@ public async Task> ListAsync(string subscri } /// Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// Restorable Tables event feed start time. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs index 66c90107b34d..d16e2378b32d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs @@ -32,7 +32,7 @@ public ServiceRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Gets the status of service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(string subscrip } /// Gets the status of service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -173,7 +173,7 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -202,7 +202,7 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates a service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -269,7 +269,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the status of service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -302,7 +302,7 @@ public async Task> GetAsync(string subscriptionId, } /// Gets the status of service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -373,7 +373,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes service with the given serviceName. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -401,7 +401,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes service with the given serviceName. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs index c5bf3b036816..c67ea08fb78a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs @@ -32,7 +32,7 @@ public SqlResourcesRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListSqlDatabasesRequest(string subscriptionId, string } /// Lists the SQL databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListSqlDatabasesAsync } /// Lists the SQL databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetSqlDatabaseRequest(string subscriptionId, string r } /// Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -202,7 +202,7 @@ public async Task> GetSqlDatabaseAsync(string } /// Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateSqlDatabaseRequest(string subscriptionId, } /// Create or update an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -306,7 +306,7 @@ public async Task CreateUpdateSqlDatabaseAsync(string subscriptionId, } /// Create or update an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteSqlDatabaseRequest(string subscriptionId, strin } /// Deletes an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -399,7 +399,7 @@ public async Task DeleteSqlDatabaseAsync(string subscriptionId, string } /// Deletes an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetSqlDatabaseThroughputRequest(string subscriptionId } /// Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -499,7 +499,7 @@ public async Task> GetSqlDatabaseThroughputAsync } /// Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateSqlDatabaseThroughputRequest(string subscriptio } /// Update RUs per second of an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -605,7 +605,7 @@ public async Task UpdateSqlDatabaseThroughputAsync(string subscription } /// Update RUs per second of an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateSqlDatabaseToAutoscaleRequest(string subscript } /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -701,7 +701,7 @@ public async Task MigrateSqlDatabaseToAutoscaleAsync(string subscripti } /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateSqlDatabaseToManualThroughputRequest(string su } /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -795,7 +795,7 @@ public async Task MigrateSqlDatabaseToManualThroughputAsync(string sub } /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -821,328 +821,6 @@ public Response MigrateSqlDatabaseToManualThroughput(string subscriptionId, stri } } - internal RequestUriBuilder CreateListClientEncryptionKeysRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListClientEncryptionKeysRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListClientEncryptionKeysAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - - using var message = CreateListClientEncryptionKeysRequest(subscriptionId, resourceGroupName, accountName, databaseName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ClientEncryptionKeysListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ClientEncryptionKeysListResult.DeserializeClientEncryptionKeysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListClientEncryptionKeys(string subscriptionId, string resourceGroupName, string accountName, string databaseName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - - using var message = CreateListClientEncryptionKeysRequest(subscriptionId, resourceGroupName, accountName, databaseName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ClientEncryptionKeysListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ClientEncryptionKeysListResult.DeserializeClientEncryptionKeysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetClientEncryptionKeyRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys/", false); - uri.AppendPath(clientEncryptionKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetClientEncryptionKeyRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys/", false); - uri.AppendPath(clientEncryptionKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB ClientEncryptionKey name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetClientEncryptionKeyAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - - using var message = CreateGetClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CosmosDBSqlClientEncryptionKeyData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CosmosDBSqlClientEncryptionKeyData.DeserializeCosmosDBSqlClientEncryptionKeyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBSqlClientEncryptionKeyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB ClientEncryptionKey name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response GetClientEncryptionKey(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - - using var message = CreateGetClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CosmosDBSqlClientEncryptionKeyData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CosmosDBSqlClientEncryptionKeyData.DeserializeCosmosDBSqlClientEncryptionKeyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBSqlClientEncryptionKeyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateUpdateClientEncryptionKeyRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys/", false); - uri.AppendPath(clientEncryptionKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateUpdateClientEncryptionKeyRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys/", false); - uri.AppendPath(clientEncryptionKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB ClientEncryptionKey name. - /// The parameters to provide for the client encryption key. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateClientEncryptionKeyAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB ClientEncryptionKey name. - /// The parameters to provide for the client encryption key. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateClientEncryptionKey(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListSqlContainersRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName) { var uri = new RawRequestUriBuilder(); @@ -1184,7 +862,7 @@ internal HttpMessage CreateListSqlContainersRequest(string subscriptionId, strin } /// Lists the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1215,7 +893,7 @@ public async Task> ListSqlContainersAsy } /// Lists the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1288,7 +966,7 @@ internal HttpMessage CreateGetSqlContainerRequest(string subscriptionId, string } /// Gets the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1323,7 +1001,7 @@ public async Task> GetSqlContainerAsync(strin } /// Gets the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1395,237 +1073,34 @@ internal HttpMessage CreateCreateUpdateSqlContainerRequest(string subscriptionId uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for the current SQL container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateSqlContainerAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CosmosDBSqlContainerCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for the current SQL container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateSqlContainer(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CosmosDBSqlContainerCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteSqlContainerRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteSqlContainerRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB container name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteSqlContainerAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - - using var message = CreateDeleteSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB container name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response DeleteSqlContainer(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - - using var message = CreateDeleteSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateSqlDatabasePartitionMergeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateSqlDatabasePartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(mergeParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Merges the partitions of a SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// Create or update an Azure Cosmos DB SQL container. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// The parameters for the merge operation. + /// Cosmos DB container name. + /// The parameters to provide for the current SQL container. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task SqlDatabasePartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateSqlContainerAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CosmosDBSqlContainerCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateSqlDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); + using var message = CreateCreateUpdateSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1637,24 +1112,26 @@ public async Task SqlDatabasePartitionMergeAsync(string subscriptionId } } - /// Merges the partitions of a SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// Create or update an Azure Cosmos DB SQL container. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// The parameters for the merge operation. + /// Cosmos DB container name. + /// The parameters to provide for the current SQL container. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response SqlDatabasePartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdateSqlContainer(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CosmosDBSqlContainerCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateSqlDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); + using var message = CreateCreateUpdateSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1666,7 +1143,7 @@ public Response SqlDatabasePartitionMerge(string subscriptionId, string resource } } - internal RequestUriBuilder CreateListSqlContainerPartitionMergeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters) + internal RequestUriBuilder CreateDeleteSqlContainerRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1680,16 +1157,15 @@ internal RequestUriBuilder CreateListSqlContainerPartitionMergeRequestUri(string uri.AppendPath(databaseName, true); uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); - uri.AppendPath("/partitionMerge", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListSqlContainerPartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters) + internal HttpMessage CreateDeleteSqlContainerRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -1702,74 +1178,64 @@ internal HttpMessage CreateListSqlContainerPartitionMergeRequest(string subscrip uri.AppendPath(databaseName, true); uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); - uri.AppendPath("/partitionMerge", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(mergeParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Merges the partitions of a SQL Container. - /// The ID of the target subscription. The value must be an UUID. + /// Deletes an existing Azure Cosmos DB SQL container. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. /// Cosmos DB container name. - /// The parameters for the merge operation. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task ListSqlContainerPartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + public async Task DeleteSqlContainerAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - using var message = CreateListSqlContainerPartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, mergeParameters); + using var message = CreateDeleteSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Merges the partitions of a SQL Container. - /// The ID of the target subscription. The value must be an UUID. + /// Deletes an existing Azure Cosmos DB SQL container. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. /// Cosmos DB container name. - /// The parameters for the merge operation. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response ListSqlContainerPartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + public Response DeleteSqlContainer(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - using var message = CreateListSqlContainerPartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, mergeParameters); + using var message = CreateDeleteSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); @@ -1821,7 +1287,7 @@ internal HttpMessage CreateGetSqlContainerThroughputRequest(string subscriptionI } /// Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1856,7 +1322,7 @@ public async Task> GetSqlContainerThroughputAsyn } /// Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1939,7 +1405,7 @@ internal HttpMessage CreateUpdateSqlContainerThroughputRequest(string subscripti } /// Update RUs per second of an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1970,7 +1436,7 @@ public async Task UpdateSqlContainerThroughputAsync(string subscriptio } /// Update RUs per second of an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2045,7 +1511,7 @@ internal HttpMessage CreateMigrateSqlContainerToAutoscaleRequest(string subscrip } /// Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2074,7 +1540,7 @@ public async Task MigrateSqlContainerToAutoscaleAsync(string subscript } /// Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2147,7 +1613,7 @@ internal HttpMessage CreateMigrateSqlContainerToManualThroughputRequest(string s } /// Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2176,7 +1642,7 @@ public async Task MigrateSqlContainerToManualThroughputAsync(string su } /// Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2204,109 +1670,7 @@ public Response MigrateSqlContainerToManualThroughput(string subscriptionId, str } } - internal RequestUriBuilder CreateSqlDatabaseRetrieveThroughputDistributionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateSqlDatabaseRetrieveThroughputDistributionRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(retrieveThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Retrieve throughput distribution for an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for retrieving throughput distribution for the current SQL database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task SqlDatabaseRetrieveThroughputDistributionAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateSqlDatabaseRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, retrieveThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieve throughput distribution for an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for retrieving throughput distribution for the current SQL database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response SqlDatabaseRetrieveThroughputDistribution(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateSqlDatabaseRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, retrieveThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateSqlDatabaseRedistributeThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters) + internal RequestUriBuilder CreateListClientEncryptionKeysRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -2318,16 +1682,16 @@ internal RequestUriBuilder CreateSqlDatabaseRedistributeThroughputRequestUri(str uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); + uri.AppendPath("/clientEncryptionKeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateSqlDatabaseRedistributeThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters) + internal HttpMessage CreateListClientEncryptionKeysRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -2338,77 +1702,77 @@ internal HttpMessage CreateSqlDatabaseRedistributeThroughputRequest(string subsc uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); + uri.AppendPath("/clientEncryptionKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(redistributeThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Redistribute throughput for an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// The parameters to provide for redistributing throughput for the current SQL database. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task SqlDatabaseRedistributeThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) + public async Task> ListClientEncryptionKeysAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - using var message = CreateSqlDatabaseRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, redistributeThroughputParameters); + using var message = CreateListClientEncryptionKeysRequest(subscriptionId, resourceGroupName, accountName, databaseName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + ClientEncryptionKeysListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ClientEncryptionKeysListResult.DeserializeClientEncryptionKeysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Redistribute throughput for an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// The parameters to provide for redistributing throughput for the current SQL database. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response SqlDatabaseRedistributeThroughput(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) + public Response ListClientEncryptionKeys(string subscriptionId, string resourceGroupName, string accountName, string databaseName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - using var message = CreateSqlDatabaseRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, redistributeThroughputParameters); + using var message = CreateListClientEncryptionKeysRequest(subscriptionId, resourceGroupName, accountName, databaseName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + ClientEncryptionKeysListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ClientEncryptionKeysListResult.DeserializeClientEncryptionKeysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateSqlContainerRetrieveThroughputDistributionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RetrieveThroughputParameters retrieveThroughputParameters) + internal RequestUriBuilder CreateGetClientEncryptionKeyRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -2420,18 +1784,17 @@ internal RequestUriBuilder CreateSqlContainerRetrieveThroughputDistributionReque uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); + uri.AppendPath("/clientEncryptionKeys/", false); + uri.AppendPath(clientEncryptionKeyName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateSqlContainerRetrieveThroughputDistributionRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RetrieveThroughputParameters retrieveThroughputParameters) + internal HttpMessage CreateGetClientEncryptionKeyRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -2442,83 +1805,86 @@ internal HttpMessage CreateSqlContainerRetrieveThroughputDistributionRequest(str uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); + uri.AppendPath("/clientEncryptionKeys/", false); + uri.AppendPath(clientEncryptionKeyName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(retrieveThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Retrieve throughput distribution for an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for retrieving throughput distribution for the current SQL container. + /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task SqlContainerRetrieveThroughputDistributionAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetClientEncryptionKeyAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); + Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - using var message = CreateSqlContainerRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters); + using var message = CreateGetClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + CosmosDBSqlClientEncryptionKeyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CosmosDBSqlClientEncryptionKeyData.DeserializeCosmosDBSqlClientEncryptionKeyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CosmosDBSqlClientEncryptionKeyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Retrieve throughput distribution for an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for retrieving throughput distribution for the current SQL container. + /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response SqlContainerRetrieveThroughputDistribution(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response GetClientEncryptionKey(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); + Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - using var message = CreateSqlContainerRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters); + using var message = CreateGetClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + CosmosDBSqlClientEncryptionKeyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CosmosDBSqlClientEncryptionKeyData.DeserializeCosmosDBSqlClientEncryptionKeyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CosmosDBSqlClientEncryptionKeyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateSqlContainerRedistributeThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RedistributeThroughputParameters redistributeThroughputParameters) + internal RequestUriBuilder CreateCreateUpdateClientEncryptionKeyRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -2530,18 +1896,17 @@ internal RequestUriBuilder CreateSqlContainerRedistributeThroughputRequestUri(st uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); + uri.AppendPath("/clientEncryptionKeys/", false); + uri.AppendPath(clientEncryptionKeyName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateSqlContainerRedistributeThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RedistributeThroughputParameters redistributeThroughputParameters) + internal HttpMessage CreateCreateUpdateClientEncryptionKeyRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -2552,40 +1917,39 @@ internal HttpMessage CreateSqlContainerRedistributeThroughputRequest(string subs uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); + uri.AppendPath("/clientEncryptionKeys/", false); + uri.AppendPath(clientEncryptionKeyName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(redistributeThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Redistribute throughput for an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for redistributing throughput for the current SQL container. + /// Cosmos DB ClientEncryptionKey name. + /// The parameters to provide for the client encryption key. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task SqlContainerRedistributeThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateClientEncryptionKeyAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); + Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateSqlContainerRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, redistributeThroughputParameters); + using var message = CreateCreateUpdateClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -2597,26 +1961,26 @@ public async Task SqlContainerRedistributeThroughputAsync(string subsc } } - /// Redistribute throughput for an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for redistributing throughput for the current SQL container. + /// Cosmos DB ClientEncryptionKey name. + /// The parameters to provide for the client encryption key. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response SqlContainerRedistributeThroughput(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdateClientEncryptionKey(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); + Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateSqlContainerRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, redistributeThroughputParameters); + using var message = CreateCreateUpdateClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -2673,7 +2037,7 @@ internal HttpMessage CreateListSqlStoredProceduresRequest(string subscriptionId, } /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2706,7 +2070,7 @@ public async Task> ListSqlStoredP } /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2785,7 +2149,7 @@ internal HttpMessage CreateGetSqlStoredProcedureRequest(string subscriptionId, s } /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2822,7 +2186,7 @@ public async Task> GetSqlStoredProcedur } /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2909,7 +2273,7 @@ internal HttpMessage CreateCreateUpdateSqlStoredProcedureRequest(string subscrip } /// Create or update an Azure Cosmos DB SQL storedProcedure. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2942,7 +2306,7 @@ public async Task CreateUpdateSqlStoredProcedureAsync(string subscript } /// Create or update an Azure Cosmos DB SQL storedProcedure. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3020,7 +2384,7 @@ internal HttpMessage CreateDeleteSqlStoredProcedureRequest(string subscriptionId } /// Deletes an existing Azure Cosmos DB SQL storedProcedure. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3051,7 +2415,7 @@ public async Task DeleteSqlStoredProcedureAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL storedProcedure. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3126,7 +2490,7 @@ internal HttpMessage CreateListSqlUserDefinedFunctionsRequest(string subscriptio } /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3159,7 +2523,7 @@ public async Task> ListSqlUse } /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3238,7 +2602,7 @@ internal HttpMessage CreateGetSqlUserDefinedFunctionRequest(string subscriptionI } /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3275,7 +2639,7 @@ public async Task> GetSqlUserDefine } /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3362,7 +2726,7 @@ internal HttpMessage CreateCreateUpdateSqlUserDefinedFunctionRequest(string subs } /// Create or update an Azure Cosmos DB SQL userDefinedFunction. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3395,7 +2759,7 @@ public async Task CreateUpdateSqlUserDefinedFunctionAsync(string subsc } /// Create or update an Azure Cosmos DB SQL userDefinedFunction. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3473,7 +2837,7 @@ internal HttpMessage CreateDeleteSqlUserDefinedFunctionRequest(string subscripti } /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3504,7 +2868,7 @@ public async Task DeleteSqlUserDefinedFunctionAsync(string subscriptio } /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3579,7 +2943,7 @@ internal HttpMessage CreateListSqlTriggersRequest(string subscriptionId, string } /// Lists the SQL trigger under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3612,7 +2976,7 @@ public async Task> ListSqlTriggersAsync(s } /// Lists the SQL trigger under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3691,7 +3055,7 @@ internal HttpMessage CreateGetSqlTriggerRequest(string subscriptionId, string re } /// Gets the SQL trigger under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3728,7 +3092,7 @@ public async Task> GetSqlTriggerAsync(string su } /// Gets the SQL trigger under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3815,7 +3179,7 @@ internal HttpMessage CreateCreateUpdateSqlTriggerRequest(string subscriptionId, } /// Create or update an Azure Cosmos DB SQL trigger. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3848,7 +3212,7 @@ public async Task CreateUpdateSqlTriggerAsync(string subscriptionId, s } /// Create or update an Azure Cosmos DB SQL trigger. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3926,7 +3290,7 @@ internal HttpMessage CreateDeleteSqlTriggerRequest(string subscriptionId, string } /// Deletes an existing Azure Cosmos DB SQL trigger. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3957,7 +3321,7 @@ public async Task DeleteSqlTriggerAsync(string subscriptionId, string } /// Deletes an existing Azure Cosmos DB SQL trigger. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -4026,7 +3390,7 @@ internal HttpMessage CreateGetSqlRoleDefinitionRequest(string subscriptionId, st } /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4059,7 +3423,7 @@ public async Task> GetSqlRoleDefinitionA } /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4134,7 +3498,7 @@ internal HttpMessage CreateCreateUpdateSqlRoleDefinitionRequest(string subscript } /// Creates or updates an Azure Cosmos DB SQL Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4163,7 +3527,7 @@ public async Task CreateUpdateSqlRoleDefinitionAsync(string subscripti } /// Creates or updates an Azure Cosmos DB SQL Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4230,7 +3594,7 @@ internal HttpMessage CreateDeleteSqlRoleDefinitionRequest(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4258,7 +3622,7 @@ public async Task DeleteSqlRoleDefinitionAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4322,7 +3686,7 @@ internal HttpMessage CreateListSqlRoleDefinitionsRequest(string subscriptionId, } /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -4351,7 +3715,7 @@ public async Task> ListSqlRoleDefinition } /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -4418,7 +3782,7 @@ internal HttpMessage CreateGetSqlRoleAssignmentRequest(string subscriptionId, st } /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4451,7 +3815,7 @@ public async Task> GetSqlRoleAssignmentA } /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4526,7 +3890,7 @@ internal HttpMessage CreateCreateUpdateSqlRoleAssignmentRequest(string subscript } /// Creates or updates an Azure Cosmos DB SQL Role Assignment. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4555,7 +3919,7 @@ public async Task CreateUpdateSqlRoleAssignmentAsync(string subscripti } /// Creates or updates an Azure Cosmos DB SQL Role Assignment. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4622,7 +3986,7 @@ internal HttpMessage CreateDeleteSqlRoleAssignmentRequest(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL Role Assignment. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4650,7 +4014,7 @@ public async Task DeleteSqlRoleAssignmentAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL Role Assignment. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4714,7 +4078,7 @@ internal HttpMessage CreateListSqlRoleAssignmentsRequest(string subscriptionId, } /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -4743,7 +4107,7 @@ public async Task> ListSqlRoleAssignment } /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -4820,7 +4184,7 @@ internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string sub } /// Retrieves continuous backup information for a container resource. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -4851,7 +4215,7 @@ public async Task RetrieveContinuousBackupInformationAsync(string subs } /// Retrieves continuous backup information for a container resource. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs index e24377b30eaf..67ffed8c95be 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs @@ -32,7 +32,7 @@ public TableResourcesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-04-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListTablesRequest(string subscriptionId, string resou } /// Lists the Tables under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListTablesAsync(string subs } /// Lists the Tables under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetTableRequest(string subscriptionId, string resourc } /// Gets the Tables under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -202,7 +202,7 @@ public async Task> GetTableAsync(string subscription } /// Gets the Tables under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateTableRequest(string subscriptionId, strin } /// Create or update an Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -306,7 +306,7 @@ public async Task CreateUpdateTableAsync(string subscriptionId, string } /// Create or update an Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteTableRequest(string subscriptionId, string reso } /// Deletes an existing Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -399,7 +399,7 @@ public async Task DeleteTableAsync(string subscriptionId, string resou } /// Deletes an existing Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetTableThroughputRequest(string subscriptionId, stri } /// Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -499,7 +499,7 @@ public async Task> GetTableThroughputAsync(strin } /// Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateTableThroughputRequest(string subscriptionId, s } /// Update RUs per second of an Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -605,7 +605,7 @@ public async Task UpdateTableThroughputAsync(string subscriptionId, st } /// Update RUs per second of an Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateTableToAutoscaleRequest(string subscriptionId, } /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -701,7 +701,7 @@ public async Task MigrateTableToAutoscaleAsync(string subscriptionId, } /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateTableToManualThroughputRequest(string subscrip } /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -795,7 +795,7 @@ public async Task MigrateTableToManualThroughputAsync(string subscript } /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -866,7 +866,7 @@ internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string sub } /// Retrieves continuous backup information for a table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -895,7 +895,7 @@ public async Task RetrieveContinuousBackupInformationAsync(string subs } /// Retrieves continuous backup information for a table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -922,789 +922,5 @@ public Response RetrieveContinuousBackupInformation(string subscriptionId, strin throw new RequestFailedException(message.Response); } } - - internal RequestUriBuilder CreateGetTableRoleDefinitionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleDefinitions/", false); - uri.AppendPath(roleDefinitionId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetTableRoleDefinitionRequest(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleDefinitions/", false); - uri.AppendPath(roleDefinitionId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The GUID for the Role Definition. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetTableRoleDefinitionAsync(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - - using var message = CreateGetTableRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CosmosDBTableRoleDefinitionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CosmosDBTableRoleDefinitionData.DeserializeCosmosDBTableRoleDefinitionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBTableRoleDefinitionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The GUID for the Role Definition. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetTableRoleDefinition(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - - using var message = CreateGetTableRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CosmosDBTableRoleDefinitionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CosmosDBTableRoleDefinitionData.DeserializeCosmosDBTableRoleDefinitionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBTableRoleDefinitionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateUpdateTableRoleDefinitionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CosmosDBTableRoleDefinitionData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleDefinitions/", false); - uri.AppendPath(roleDefinitionId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateUpdateTableRoleDefinitionRequest(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CosmosDBTableRoleDefinitionData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleDefinitions/", false); - uri.AppendPath(roleDefinitionId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates an Azure Cosmos DB Table Role Definition. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The GUID for the Role Definition. - /// The properties required to create or update a Role Definition. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateTableRoleDefinitionAsync(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CosmosDBTableRoleDefinitionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateUpdateTableRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates an Azure Cosmos DB Table Role Definition. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The GUID for the Role Definition. - /// The properties required to create or update a Role Definition. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateTableRoleDefinition(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CosmosDBTableRoleDefinitionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateUpdateTableRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteTableRoleDefinitionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleDefinitions/", false); - uri.AppendPath(roleDefinitionId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteTableRoleDefinitionRequest(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleDefinitions/", false); - uri.AppendPath(roleDefinitionId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB Table Role Definition. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The GUID for the Role Definition. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteTableRoleDefinitionAsync(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - - using var message = CreateDeleteTableRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB Table Role Definition. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The GUID for the Role Definition. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response DeleteTableRoleDefinition(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); - - using var message = CreateDeleteTableRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListTableRoleDefinitionsRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleDefinitions", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListTableRoleDefinitionsRequest(string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleDefinitions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListTableRoleDefinitionsAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListTableRoleDefinitionsRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TableRoleDefinitionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = TableRoleDefinitionListResult.DeserializeTableRoleDefinitionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListTableRoleDefinitions(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListTableRoleDefinitionsRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TableRoleDefinitionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = TableRoleDefinitionListResult.DeserializeTableRoleDefinitionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetTableRoleAssignmentRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleAssignments/", false); - uri.AppendPath(roleAssignmentId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetTableRoleAssignmentRequest(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleAssignments/", false); - uri.AppendPath(roleAssignmentId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The GUID for the Role Assignment. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetTableRoleAssignmentAsync(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - - using var message = CreateGetTableRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CosmosDBTableRoleAssignmentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CosmosDBTableRoleAssignmentData.DeserializeCosmosDBTableRoleAssignmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBTableRoleAssignmentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The GUID for the Role Assignment. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetTableRoleAssignment(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - - using var message = CreateGetTableRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CosmosDBTableRoleAssignmentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CosmosDBTableRoleAssignmentData.DeserializeCosmosDBTableRoleAssignmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBTableRoleAssignmentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateUpdateTableRoleAssignmentRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CosmosDBTableRoleAssignmentData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleAssignments/", false); - uri.AppendPath(roleAssignmentId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateUpdateTableRoleAssignmentRequest(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CosmosDBTableRoleAssignmentData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleAssignments/", false); - uri.AppendPath(roleAssignmentId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates an Azure Cosmos DB Table Role Assignment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The GUID for the Role Assignment. - /// The properties required to create or update a Role Assignment. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateTableRoleAssignmentAsync(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CosmosDBTableRoleAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateUpdateTableRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates an Azure Cosmos DB Table Role Assignment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The GUID for the Role Assignment. - /// The properties required to create or update a Role Assignment. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateTableRoleAssignment(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CosmosDBTableRoleAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateUpdateTableRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteTableRoleAssignmentRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleAssignments/", false); - uri.AppendPath(roleAssignmentId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteTableRoleAssignmentRequest(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleAssignments/", false); - uri.AppendPath(roleAssignmentId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB Table Role Assignment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The GUID for the Role Assignment. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteTableRoleAssignmentAsync(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - - using var message = CreateDeleteTableRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB Table Role Assignment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The GUID for the Role Assignment. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response DeleteTableRoleAssignment(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); - - using var message = CreateDeleteTableRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListTableRoleAssignmentsRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleAssignments", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListTableRoleAssignmentsRequest(string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendPath("/tableRoleAssignments", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListTableRoleAssignmentsAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListTableRoleAssignmentsRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TableRoleAssignmentListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = TableRoleAssignmentListResult.DeserializeTableRoleAssignmentListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListTableRoleAssignments(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListTableRoleAssignmentsRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TableRoleAssignmentListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = TableRoleAssignmentListResult.DeserializeTableRoleAssignmentListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs deleted file mode 100644 index 17099ca199e9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ThroughputPoolAccountRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ThroughputPoolAccountRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ThroughputPoolAccountRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CosmosDBThroughputPoolAccountData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBThroughputPoolAccountData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CosmosDBThroughputPoolAccountData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBThroughputPoolAccountData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Removes an existing Azure Cosmos DB database account from a throughput pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Removes an existing Azure Cosmos DB database account from a throughput pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs deleted file mode 100644 index 35df7b033059..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ThroughputPoolAccountsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ThroughputPoolAccountsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ThroughputPoolAccountsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, throughputPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolAccountsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolAccountsListResult.DeserializeThroughputPoolAccountsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, throughputPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolAccountsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ThroughputPoolAccountsListResult.DeserializeThroughputPoolAccountsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, throughputPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolAccountsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolAccountsListResult.DeserializeThroughputPoolAccountsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, throughputPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolAccountsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ThroughputPoolAccountsListResult.DeserializeThroughputPoolAccountsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs deleted file mode 100644 index 7e8d70c8c466..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ThroughputPoolRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ThroughputPoolRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ThroughputPoolRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, throughputPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CosmosDBThroughputPoolData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBThroughputPoolData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, throughputPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CosmosDBThroughputPoolData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBThroughputPoolData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current ThroughputPool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, throughputPoolName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current ThroughputPool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, throughputPoolName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolPatch patch) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolPatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, throughputPoolName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, throughputPoolName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, throughputPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, throughputPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs deleted file mode 100644 index c798a66ba0bf..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ThroughputPoolsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ThroughputPoolsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ThroughputPoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the ThroughputPools in a given resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the ThroughputPools in a given resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the ThroughputPools in a given resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the ThroughputPools in a given resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs index bafed9410c62..b72a2a5d3142 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -105,7 +105,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(Guid instanceId, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -175,7 +175,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -204,7 +204,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -243,7 +243,7 @@ public virtual async Task> ExistsAsync(Guid instanceId, Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual Response Exists(Guid instanceId, CancellationToken cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -323,7 +323,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs index ac884fcecb20..3b21f4044cf6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs @@ -56,16 +56,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("creationTime"u8); writer.WriteStringValue(CreatedOn.Value, "O"); } - if (Optional.IsDefined(OldestRestorableOn)) - { - writer.WritePropertyName("oldestRestorableTime"u8); - writer.WriteStringValue(OldestRestorableOn.Value, "O"); - } if (Optional.IsDefined(DeletedOn)) { writer.WritePropertyName("deletionTime"u8); writer.WriteStringValue(DeletedOn.Value, "O"); } + if (Optional.IsDefined(OldestRestorableOn)) + { + writer.WritePropertyName("oldestRestorableTime"u8); + writer.WriteStringValue(OldestRestorableOn.Value, "O"); + } if (options.Format != "W" && Optional.IsDefined(ApiType)) { writer.WritePropertyName("apiType"u8); @@ -111,8 +111,8 @@ internal static RestorableCosmosDBAccountData DeserializeRestorableCosmosDBAccou SystemData systemData = default; string accountName = default; DateTimeOffset? creationTime = default; - DateTimeOffset? oldestRestorableTime = default; DateTimeOffset? deletionTime = default; + DateTimeOffset? oldestRestorableTime = default; CosmosDBApiType? apiType = default; IReadOnlyList restorableLocations = default; IDictionary serializedAdditionalRawData = default; @@ -175,22 +175,22 @@ internal static RestorableCosmosDBAccountData DeserializeRestorableCosmosDBAccou creationTime = property0.Value.GetDateTimeOffset("O"); continue; } - if (property0.NameEquals("oldestRestorableTime"u8)) + if (property0.NameEquals("deletionTime"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - oldestRestorableTime = property0.Value.GetDateTimeOffset("O"); + deletionTime = property0.Value.GetDateTimeOffset("O"); continue; } - if (property0.NameEquals("deletionTime"u8)) + if (property0.NameEquals("oldestRestorableTime"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - deletionTime = property0.Value.GetDateTimeOffset("O"); + oldestRestorableTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("apiType"u8)) @@ -233,8 +233,8 @@ internal static RestorableCosmosDBAccountData DeserializeRestorableCosmosDBAccou location, accountName, creationTime, - oldestRestorableTime, deletionTime, + oldestRestorableTime, apiType, restorableLocations ?? new ChangeTrackingList(), serializedAdditionalRawData); @@ -360,34 +360,34 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OldestRestorableOn), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeletedOn), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" oldestRestorableTime: "); + builder.Append(" deletionTime: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(OldestRestorableOn)) + if (Optional.IsDefined(DeletedOn)) { - builder.Append(" oldestRestorableTime: "); - var formattedDateTimeString = TypeFormatters.ToString(OldestRestorableOn.Value, "o"); + builder.Append(" deletionTime: "); + var formattedDateTimeString = TypeFormatters.ToString(DeletedOn.Value, "o"); builder.AppendLine($"'{formattedDateTimeString}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeletedOn), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OldestRestorableOn), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" deletionTime: "); + builder.Append(" oldestRestorableTime: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(DeletedOn)) + if (Optional.IsDefined(OldestRestorableOn)) { - builder.Append(" deletionTime: "); - var formattedDateTimeString = TypeFormatters.ToString(DeletedOn.Value, "o"); + builder.Append(" oldestRestorableTime: "); + var formattedDateTimeString = TypeFormatters.ToString(OldestRestorableOn.Value, "o"); builder.AppendLine($"'{formattedDateTimeString}'"); } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.cs index 297199d694ad..e0792a9e8cbb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.cs @@ -65,18 +65,18 @@ internal RestorableCosmosDBAccountData() /// The location of the resource group to which the resource belongs. /// The name of the global database account. /// The creation time of the restorable database account (ISO-8601 format). - /// The least recent time at which the database account can be restored to (ISO-8601 format). /// The time at which the restorable database account has been deleted (ISO-8601 format). + /// The least recent time at which the database account can be restored to (ISO-8601 format). /// The API type of the restorable database account. /// List of regions where the of the database account can be restored from. /// Keeps track of any properties unknown to the library. - internal RestorableCosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, string accountName, DateTimeOffset? createdOn, DateTimeOffset? oldestRestorableOn, DateTimeOffset? deletedOn, CosmosDBApiType? apiType, IReadOnlyList restorableLocations, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal RestorableCosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, string accountName, DateTimeOffset? createdOn, DateTimeOffset? deletedOn, DateTimeOffset? oldestRestorableOn, CosmosDBApiType? apiType, IReadOnlyList restorableLocations, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Location = location; AccountName = accountName; CreatedOn = createdOn; - OldestRestorableOn = oldestRestorableOn; DeletedOn = deletedOn; + OldestRestorableOn = oldestRestorableOn; ApiType = apiType; RestorableLocations = restorableLocations; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -91,12 +91,12 @@ internal RestorableCosmosDBAccountData(ResourceIdentifier id, string name, Resou /// The creation time of the restorable database account (ISO-8601 format). [WirePath("properties.creationTime")] public DateTimeOffset? CreatedOn { get; } - /// The least recent time at which the database account can be restored to (ISO-8601 format). - [WirePath("properties.oldestRestorableTime")] - public DateTimeOffset? OldestRestorableOn { get; } /// The time at which the restorable database account has been deleted (ISO-8601 format). [WirePath("properties.deletionTime")] public DateTimeOffset? DeletedOn { get; } + /// The least recent time at which the database account can be restored to (ISO-8601 format). + [WirePath("properties.oldestRestorableTime")] + public DateTimeOffset? OldestRestorableOn { get; } /// The API type of the restorable database account. [WirePath("properties.apiType")] public CosmosDBApiType? ApiType { get; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs index 0f8ee3410b0e..6f180c661c9f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs @@ -146,7 +146,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -186,7 +186,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -251,7 +251,7 @@ public virtual AsyncPageable GetRestorableSqlDatabasesAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -276,7 +276,7 @@ public virtual Pageable GetRestorableSqlDatabases(Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -304,7 +304,7 @@ public virtual AsyncPageable GetRestorableSqlContainersA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -332,7 +332,7 @@ public virtual Pageable GetRestorableSqlContainers(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -359,7 +359,7 @@ public virtual AsyncPageable GetAllRestorableSqlResou /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -386,7 +386,7 @@ public virtual Pageable GetAllRestorableSqlResourceDa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -411,7 +411,7 @@ public virtual AsyncPageable GetRestorableMongoDBData /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -436,7 +436,7 @@ public virtual Pageable GetRestorableMongoDBDatabases /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -464,7 +464,7 @@ public virtual AsyncPageable GetRestorableMongoDBCo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -492,7 +492,7 @@ public virtual Pageable GetRestorableMongoDBCollect /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -519,7 +519,7 @@ public virtual AsyncPageable GetAllRestorableMong /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -546,7 +546,7 @@ public virtual Pageable GetAllRestorableMongoDBRe /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -571,7 +571,7 @@ public virtual AsyncPageable GetRestorableGremlinData /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -596,7 +596,7 @@ public virtual Pageable GetRestorableGremlinDatabases /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -624,7 +624,7 @@ public virtual AsyncPageable GetRestorableGremlinGraphsA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -652,7 +652,7 @@ public virtual Pageable GetRestorableGremlinGraphs(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -679,7 +679,7 @@ public virtual AsyncPageable GetRestorableGremlin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -706,7 +706,7 @@ public virtual Pageable GetRestorableGremlinResou /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -733,7 +733,7 @@ public virtual AsyncPageable GetRestorableTablesAsync(string st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -760,7 +760,7 @@ public virtual Pageable GetRestorableTables(string startTime = /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// @@ -787,7 +787,7 @@ public virtual AsyncPageable GetRestorableTableReso /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-04-15 /// /// /// diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs index 3ade988a6d74..98eec6f24b5d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs @@ -39,12 +39,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -75,7 +69,6 @@ internal static ThroughputSettingData DeserializeThroughputSettingData(JsonEleme { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -87,16 +80,6 @@ internal static ThroughputSettingData DeserializeThroughputSettingData(JsonEleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -175,7 +158,6 @@ internal static ThroughputSettingData DeserializeThroughputSettingData(JsonEleme tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -262,21 +244,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.cs index f2525edc1e55..4646f03bcf37 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.cs @@ -65,12 +65,10 @@ public ThroughputSettingData(AzureLocation location) : base(location) /// The tags. /// The location. /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal ThroughputSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedThroughputSettingsResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ThroughputSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedThroughputSettingsResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,8 +80,5 @@ internal ThroughputSettingData() /// Gets or sets the resource. [WirePath("properties.resource")] public ExtendedThroughputSettingsResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md index e254f2744d2b..0ca19298a950 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md @@ -10,7 +10,7 @@ csharp: true library-name: CosmosDB namespace: Azure.ResourceManager.CosmosDB #tag: package-preview-2024-12-01 -require: https://github.com/Azure/azure-rest-api-specs/blob/2afa5b356adf6cf51209d2cf28d38644c69d9832/specification/cosmos-db/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/