From 71814ca0b8ffa46f132d3b5855be91340049f595 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 8 Nov 2024 23:59:55 +0000 Subject: [PATCH] CodeGen from PR 31010 in Azure/azure-rest-api-specs Merge ded6306d00ae294c24211e5069c1f56b15ba8ef5 into d19ac181fe93dce43d698722c30161b6bdf50f07 --- sdk/advisor/ci.mgmt.yml | 13 + sdk/agrifood/ci.mgmt.yml | 13 + sdk/alertsmanagement/ci.mgmt.yml | 13 + sdk/analysisservices/ci.mgmt.yml | 13 + sdk/apicenter/ci.mgmt.yml | 13 + sdk/apimanagement/ci.mgmt.yml | 13 + sdk/appcomplianceautomation/ci.mgmt.yml | 13 + sdk/appconfiguration/ci.mgmt.yml | 13 + sdk/applicationinsights/ci.mgmt.yml | 13 + sdk/appplatform/ci.mgmt.yml | 13 + sdk/arc-scvmm/ci.mgmt.yml | 13 + sdk/astronomer/ci.mgmt.yml | 13 + sdk/attestation/ci.mgmt.yml | 13 + sdk/authorization/ci.mgmt.yml | 13 + sdk/automanage/ci.mgmt.yml | 13 + sdk/automation/ci.mgmt.yml | 13 + sdk/avs/ci.mgmt.yml | 13 + sdk/azurelargeinstance/ci.mgmt.yml | 13 + sdk/azurestackhci/ci.mgmt.yml | 13 + sdk/batch/ci.mgmt.yml | 13 + sdk/billing/ci.mgmt.yml | 13 + sdk/billingbenefits/ci.mgmt.yml | 13 + sdk/blueprint/ci.mgmt.yml | 13 + sdk/botservice/ci.mgmt.yml | 13 + sdk/cdn/ci.mgmt.yml | 13 + sdk/changeanalysis/ci.mgmt.yml | 13 + sdk/chaos/ci.mgmt.yml | 13 + sdk/cognitiveservices/ci.mgmt.yml | 13 + sdk/communication/ci.mgmt.yml | 13 + sdk/compute/ci.mgmt.yml | 13 + sdk/computefleet/ci.mgmt.yml | 13 + sdk/computeschedule/ci.mgmt.yml | 13 + sdk/confidentialledger/ci.mgmt.yml | 13 + sdk/confluent/ci.mgmt.yml | 13 + sdk/connectedvmwarevsphere/ci.mgmt.yml | 13 + sdk/consumption/ci.mgmt.yml | 13 + sdk/containerapps/ci.mgmt.yml | 13 + sdk/containerinstance/ci.mgmt.yml | 13 + sdk/containerorchestratorruntime/ci.mgmt.yml | 13 + sdk/containerregistry/ci.mgmt.yml | 13 + sdk/containerservice/ci.mgmt.yml | 13 + .../Sample_CassandraClusterCollection.cs | 12 +- .../Sample_CassandraClusterResource.cs | 151 +-- .../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_CassandraViewGetResultCollection.cs | 212 ----- .../Sample_CassandraViewGetResultResource.cs | 121 --- ..._CassandraViewThroughputSettingResource.cs | 162 ---- .../Sample_CosmosDBAccountCollection.cs | 36 +- .../Samples/Sample_CosmosDBAccountResource.cs | 72 +- .../Sample_CosmosDBChaosFaultResource.cs | 90 -- ...le_CosmosDBChaosFaultResourceCollection.cs | 207 ---- .../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 | 151 +-- .../Sample_CosmosDBSqlContainerResource.cs | 177 +--- ...DBSqlContainerThroughputSettingResource.cs | 95 +- .../Sample_CosmosDBSqlDatabaseCollection.cs | 62 +- .../Sample_CosmosDBSqlDatabaseResource.cs | 88 +- ...sDBSqlDatabaseThroughputSettingResource.cs | 93 +- ...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 +- ...CosmosDBThroughputPoolAccountCollection.cs | 204 ---- ...e_CosmosDBThroughputPoolAccountResource.cs | 115 --- ...Sample_CosmosDBThroughputPoolCollection.cs | 202 ---- .../Sample_CosmosDBThroughputPoolResource.cs | 145 --- ...le_CosmosTableThroughputSettingResource.cs | 8 +- ...mple_DataTransferJobGetResultCollection.cs | 204 ---- ...Sample_DataTransferJobGetResultResource.cs | 215 ----- ...Sample_GraphResourceGetResultCollection.cs | 211 ----- .../Sample_GraphResourceGetResultResource.cs | 122 --- .../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 | 64 +- .../Sample_MongoDBCollectionResource.cs | 93 +- ...goDBCollectionThroughputSettingResource.cs | 95 +- .../Sample_MongoDBDatabaseCollection.cs | 62 +- .../Samples/Sample_MongoDBDatabaseResource.cs | 88 +- ...ongoDBDatabaseThroughputSettingResource.cs | 93 +- .../Sample_MongoDBRoleDefinitionCollection.cs | 10 +- .../Sample_MongoDBRoleDefinitionResource.cs | 6 +- .../Sample_MongoDBUserDefinitionCollection.cs | 10 +- .../Sample_MongoDBUserDefinitionResource.cs | 6 +- ...ecurityPerimeterConfigurationCollection.cs | 163 ---- ...kSecurityPerimeterConfigurationResource.cs | 77 -- ...ple_RestorableCosmosDBAccountCollection.cs | 8 +- ...ample_RestorableCosmosDBAccountResource.cs | 26 +- .../src/Generated/ArmCosmosDBModelFactory.cs | 832 ++--------------- .../Generated/CassandraClusterCollection.cs | 20 +- .../src/Generated/CassandraClusterResource.cs | 397 +------- .../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 | 72 +- .../src/Generated/CosmosDBAccountResource.cs | 452 ++------- ...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 +- ...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 | 369 +------- .../Extensions/MockableCosmosDBArmClient.cs | 120 +-- .../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 | 38 - ...draViewThroughputSettingOperationSource.cs | 38 - ...smosDBChaosFaultResourceOperationSource.cs | 38 - ...ntainerThroughputSettingOperationSource.cs | 1 - ...atabaseThroughputSettingOperationSource.cs | 1 - ...sDBThroughputPoolAccountOperationSource.cs | 38 - .../CosmosDBThroughputPoolOperationSource.cs | 38 - ...osTableThroughputSettingOperationSource.cs | 1 - .../GraphResourceGetResultOperationSource.cs | 38 - ...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 - .../CassandraCommandPostBody.Serialization.cs | 14 +- .../Models/CassandraCommandPostBody.cs | 10 +- ...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 -- .../ChaosFaultListResponse.Serialization.cs | 219 ----- .../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 +- .../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 -- .../CosmosDBIndexingPolicy.Serialization.cs | 49 + .../Models/CosmosDBIndexingPolicy.cs | 8 +- .../Models/CosmosDBMinimalTlsVersion.cs | 2 +- ...inerCreateOrUpdateContent.Serialization.cs | 33 - ...smosDBSqlContainerCreateOrUpdateContent.cs | 7 +- ...BSqlContainerResourceInfo.Serialization.cs | 65 +- .../CosmosDBSqlContainerResourceInfo.cs | 22 +- ...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 +- ...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 -- .../src/Generated/Models/DistanceFunction.cs | 54 ++ .../EnableFullTextQuery.Serialization.cs | 30 - .../Generated/Models/EnableFullTextQuery.cs | 20 - ...BSqlContainerResourceInfo.Serialization.cs | 55 +- ...xtendedCosmosDBSqlContainerResourceInfo.cs | 4 +- ...ourceGetPropertiesOptions.Serialization.cs | 175 ---- .../GraphResourceGetPropertiesOptions.cs | 29 - ...sultCreateOrUpdateContent.Serialization.cs | 394 -------- ...hResourceGetResultCreateOrUpdateContent.cs | 108 --- .../GraphResourcesListResult.Serialization.cs | 185 ---- .../Models/GraphResourcesListResult.cs | 66 -- ...baseCreateOrUpdateContent.Serialization.cs | 33 - .../GremlinDatabaseCreateOrUpdateContent.cs | 7 +- ...raphCreateOrUpdateContent.Serialization.cs | 33 - .../GremlinGraphCreateOrUpdateContent.cs | 7 +- .../src/Generated/Models/IssueType.cs | 57 -- .../src/Generated/Models/ListBackups.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 +- .../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 | 55 +- ...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 - .../Generated/Models/ThroughputPolicyType.cs | 54 -- ...putPoolAccountsListResult.Serialization.cs | 219 ----- .../ThroughputPoolAccountsListResult.cs | 70 -- ...ThroughputPoolsListResult.Serialization.cs | 219 ----- .../Models/ThroughputPoolsListResult.cs | 70 -- ...oughputSettingsUpdateData.Serialization.cs | 33 - .../Models/ThroughputSettingsUpdateData.cs | 7 +- ...ataTransferDataSourceSink.Serialization.cs | 140 --- .../UnknownDataTransferDataSourceSink.cs | 29 - .../src/Generated/Models/VectorDataType.cs | 54 ++ ...on.cs => VectorEmbedding.Serialization.cs} | 149 +-- .../src/Generated/Models/VectorEmbedding.cs | 97 ++ ...=> VectorEmbeddingPolicy.Serialization.cs} | 68 +- ...stCommands.cs => VectorEmbeddingPolicy.cs} | 24 +- ...zation.cs => VectorIndex.Serialization.cs} | 108 +-- ...roughputInfoResource.cs => VectorIndex.cs} | 46 +- .../src/Generated/Models/VectorIndexType.cs | 54 ++ .../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 | 408 +------- .../CassandraDataCentersRestOperations.cs | 2 +- .../CassandraResourcesRestOperations.cs | 853 +---------------- .../ChaosFaultRestOperations.cs | 421 --------- ...CollectionPartitionRegionRestOperations.cs | 2 +- .../CollectionPartitionRestOperations.cs | 2 +- .../CollectionRegionRestOperations.cs | 2 +- .../CollectionRestOperations.cs | 2 +- .../DataTransferJobsRestOperations.cs | 837 ----------------- .../DatabaseAccountRegionRestOperations.cs | 2 +- .../DatabaseAccountsRestOperations.cs | 2 +- .../RestOperations/DatabaseRestOperations.cs | 2 +- .../GraphResourcesRestOperations.cs | 430 --------- .../GremlinResourcesRestOperations.cs | 2 +- .../RestOperations/LocationsRestOperations.cs | 2 +- .../MongoDBResourcesRestOperations.cs | 638 +------------ ...tyPerimeterConfigurationsRestOperations.cs | 413 -------- ...PartitionKeyRangeIdRegionRestOperations.cs | 2 +- .../PartitionKeyRangeIdRestOperations.cs | 2 +- .../PercentileRestOperations.cs | 2 +- .../PercentileSourceTargetRestOperations.cs | 2 +- .../PercentileTargetRestOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- ...estorableDatabaseAccountsRestOperations.cs | 2 +- ...estorableGremlinDatabasesRestOperations.cs | 2 +- .../RestorableGremlinGraphsRestOperations.cs | 2 +- ...estorableGremlinResourcesRestOperations.cs | 2 +- ...torableMongodbCollectionsRestOperations.cs | 2 +- ...estorableMongodbDatabasesRestOperations.cs | 2 +- ...estorableMongodbResourcesRestOperations.cs | 2 +- .../RestorableSqlContainersRestOperations.cs | 2 +- .../RestorableSqlDatabasesRestOperations.cs | 2 +- .../RestorableSqlResourcesRestOperations.cs | 2 +- .../RestorableTableResourcesRestOperations.cs | 2 +- .../RestorableTablesRestOperations.cs | 2 +- .../RestOperations/ServiceRestOperations.cs | 2 +- .../SqlResourcesRestOperations.cs | 884 +++--------------- .../TableResourcesRestOperations.cs | 2 +- .../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/cosmosdb/ci.mgmt.yml | 13 + sdk/cosmosdbforpostgresql/ci.mgmt.yml | 13 + sdk/costmanagement/ci.mgmt.yml | 13 + sdk/customer-insights/ci.mgmt.yml | 13 + sdk/databox/ci.mgmt.yml | 13 + sdk/databoxedge/ci.mgmt.yml | 13 + sdk/datadog/ci.mgmt.yml | 13 + sdk/datafactory/ci.mgmt.yml | 13 + sdk/datalake-analytics/ci.mgmt.yml | 13 + sdk/datalake-store/ci.mgmt.yml | 13 + sdk/datamigration/ci.mgmt.yml | 13 + sdk/dataprotection/ci.mgmt.yml | 13 + sdk/datashare/ci.mgmt.yml | 13 + sdk/defendereasm/ci.mgmt.yml | 13 + sdk/desktopvirtualization/ci.mgmt.yml | 13 + sdk/devcenter/ci.mgmt.yml | 13 + sdk/deviceprovisioningservices/ci.mgmt.yml | 13 + sdk/deviceregistry/ci.mgmt.yml | 13 + sdk/deviceupdate/ci.mgmt.yml | 13 + sdk/devopsinfrastructure/ci.mgmt.yml | 13 + sdk/devspaces/ci.mgmt.yml | 13 + sdk/devtestlabs/ci.mgmt.yml | 13 + sdk/digitaltwins/ci.mgmt.yml | 13 + sdk/dns/ci.mgmt.yml | 13 + sdk/dnsresolver/ci.mgmt.yml | 13 + sdk/dynatrace/ci.mgmt.yml | 13 + sdk/edgeorder/ci.mgmt.yml | 13 + sdk/edgezones/ci.mgmt.yml | 13 + sdk/elastic/ci.mgmt.yml | 13 + sdk/elasticsan/ci.mgmt.yml | 13 + sdk/eventgrid/ci.mgmt.yml | 13 + sdk/eventhub/ci.mgmt.yml | 13 + sdk/extendedlocation/ci.mgmt.yml | 13 + sdk/fabric/ci.mgmt.yml | 13 + sdk/fleet/ci.mgmt.yml | 13 + sdk/fluidrelay/ci.mgmt.yml | 13 + sdk/frontdoor/ci.mgmt.yml | 13 + sdk/grafana/ci.mgmt.yml | 13 + sdk/graphservices/ci.mgmt.yml | 13 + sdk/guestconfiguration/ci.mgmt.yml | 13 + sdk/hardwaresecuritymodules/ci.mgmt.yml | 13 + sdk/hdinsight/ci.mgmt.yml | 13 + sdk/hdinsightcontainers/ci.mgmt.yml | 13 + sdk/healthbot/ci.mgmt.yml | 13 + sdk/healthcareapis/ci.mgmt.yml | 13 + sdk/healthdataaiservices/ci.mgmt.yml | 13 + sdk/hybridaks/ci.mgmt.yml | 13 + sdk/hybridcompute/ci.mgmt.yml | 13 + sdk/hybridconnectivity/ci.mgmt.yml | 13 + sdk/hybridkubernetes/ci.mgmt.yml | 13 + sdk/hybridnetwork/ci.mgmt.yml | 13 + sdk/informaticadatamanagement/ci.mgmt.yml | 13 + sdk/iot/ci.mgmt.yml | 13 + sdk/iotcentral/ci.mgmt.yml | 13 + sdk/iothub/ci.mgmt.yml | 13 + sdk/keyvault/ci.mgmt.yml | 13 + sdk/kubernetesconfiguration/ci.mgmt.yml | 13 + sdk/kusto/ci.mgmt.yml | 13 + sdk/labservices/ci.mgmt.yml | 13 + sdk/loadtestservice/ci.mgmt.yml | 13 + sdk/logic/ci.mgmt.yml | 13 + sdk/machinelearningcompute/ci.mgmt.yml | 13 + sdk/machinelearningservices/ci.mgmt.yml | 13 + sdk/maintenance/ci.mgmt.yml | 13 + sdk/managednetwork/ci.mgmt.yml | 13 + sdk/managednetworkfabric/ci.mgmt.yml | 13 + sdk/managedserviceidentity/ci.mgmt.yml | 13 + sdk/managedservices/ci.mgmt.yml | 13 + sdk/managementpartner/ci.mgmt.yml | 13 + sdk/maps/ci.mgmt.yml | 13 + sdk/marketplace/ci.mgmt.yml | 13 + sdk/marketplaceordering/ci.mgmt.yml | 13 + sdk/mediaservices/ci.mgmt.yml | 13 + sdk/migrationdiscoverysap/ci.mgmt.yml | 13 + sdk/mixedreality/ci.mgmt.yml | 13 + sdk/mobilenetwork/ci.mgmt.yml | 13 + sdk/mongocluster/ci.mgmt.yml | 13 + sdk/monitor/ci.mgmt.yml | 13 + sdk/mysql/ci.mgmt.yml | 13 + sdk/netapp/ci.mgmt.yml | 13 + sdk/network/ci.mgmt.yml | 13 + sdk/networkanalytics/ci.mgmt.yml | 13 + sdk/networkcloud/ci.mgmt.yml | 13 + sdk/networkfunction/ci.mgmt.yml | 13 + sdk/newrelicobservability/ci.mgmt.yml | 13 + sdk/nginx/ci.mgmt.yml | 13 + sdk/notificationhubs/ci.mgmt.yml | 13 + sdk/openenergyplatform/ci.mgmt.yml | 13 + sdk/operationalinsights/ci.mgmt.yml | 13 + sdk/oracle/ci.mgmt.yml | 13 + sdk/orbital/ci.mgmt.yml | 13 + sdk/paloaltonetworks.ngfw/ci.mgmt.yml | 13 + sdk/peering/ci.mgmt.yml | 13 + sdk/playwrighttesting/ci.mgmt.yml | 13 + sdk/policyinsights/ci.mgmt.yml | 13 + sdk/postgresql/ci.mgmt.yml | 13 + sdk/powerbidedicated/ci.mgmt.yml | 13 + sdk/privatedns/ci.mgmt.yml | 13 + sdk/providerhub/ci.mgmt.yml | 13 + sdk/purview/ci.mgmt.yml | 13 + sdk/quantum/ci.mgmt.yml | 13 + sdk/qumulo/ci.mgmt.yml | 13 + sdk/quota/ci.mgmt.yml | 13 + sdk/recoveryservices-backup/ci.mgmt.yml | 13 + .../ci.mgmt.yml | 13 + sdk/recoveryservices-siterecovery/ci.mgmt.yml | 13 + sdk/recoveryservices/ci.mgmt.yml | 13 + sdk/redis/ci.mgmt.yml | 13 + sdk/redisenterprise/ci.mgmt.yml | 13 + sdk/relay/ci.mgmt.yml | 13 + sdk/reservations/ci.mgmt.yml | 13 + sdk/resourceconnector/ci.mgmt.yml | 13 + sdk/resourcegraph/ci.mgmt.yml | 13 + sdk/resourcehealth/ci.mgmt.yml | 13 + sdk/resourcemanager/ci.mgmt.yml | 668 ++++++------- sdk/resourcemover/ci.mgmt.yml | 13 + sdk/resources/ci.mgmt.yml | 13 + sdk/search/ci.mgmt.yml | 13 + sdk/securitycenter/ci.mgmt.yml | 13 + sdk/securitydevops/ci.mgmt.yml | 13 + sdk/securityinsights/ci.mgmt.yml | 13 + sdk/selfhelp/ci.mgmt.yml | 13 + sdk/servicebus/ci.mgmt.yml | 13 + sdk/servicefabric/ci.mgmt.yml | 13 + sdk/servicefabricmanagedclusters/ci.mgmt.yml | 13 + sdk/servicelinker/ci.mgmt.yml | 13 + sdk/servicenetworking/ci.mgmt.yml | 13 + sdk/signalr/ci.mgmt.yml | 13 + sdk/sphere/ci.mgmt.yml | 13 + sdk/springappdiscovery/ci.mgmt.yml | 13 + sdk/sqlmanagement/ci.mgmt.yml | 13 + sdk/sqlvirtualmachine/ci.mgmt.yml | 13 + sdk/standbypool/ci.mgmt.yml | 13 + sdk/storage/ci.mgmt.yml | 13 + sdk/storageactions/ci.mgmt.yml | 13 + sdk/storagecache/ci.mgmt.yml | 13 + sdk/storagemover/ci.mgmt.yml | 13 + sdk/storagepool/ci.mgmt.yml | 13 + sdk/storagesync/ci.mgmt.yml | 13 + sdk/streamanalytics/ci.mgmt.yml | 13 + sdk/subscription/ci.mgmt.yml | 13 + sdk/support/ci.mgmt.yml | 13 + sdk/synapse/ci.mgmt.yml | 13 + sdk/terraform/ci.mgmt.yml | 13 + sdk/trafficmanager/ci.mgmt.yml | 13 + sdk/trustedsigning/ci.mgmt.yml | 13 + sdk/voiceservices/ci.mgmt.yml | 13 + sdk/webpubsub/ci.mgmt.yml | 13 + sdk/websites/ci.mgmt.yml | 13 + sdk/workloadmonitor/ci.mgmt.yml | 13 + sdk/workloads/ci.mgmt.yml | 13 + 637 files changed, 5014 insertions(+), 44954 deletions(-) delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResourceCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs 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/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/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.Serialization.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/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 create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DistanceFunction.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 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/GraphResourcesListResult.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.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.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/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 create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorDataType.cs rename sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/{NetworkSecurityPerimeter.Serialization.cs => VectorEmbedding.Serialization.cs} (53%) create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorEmbedding.cs rename sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/{ListCommands.Serialization.cs => VectorEmbeddingPolicy.Serialization.cs} (62%) rename sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/{ListCommands.cs => VectorEmbeddingPolicy.cs} (68%) rename sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/{ListBackups.Serialization.cs => VectorIndex.Serialization.cs} (61%) rename sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/{PhysicalPartitionThroughputInfoResource.cs => VectorIndex.cs} (54%) create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorIndexType.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/advisor/ci.mgmt.yml b/sdk/advisor/ci.mgmt.yml index 6b9f8d6952e6..22df99de35f2 100644 --- a/sdk/advisor/ci.mgmt.yml +++ b/sdk/advisor/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/advisor/ci.mgmt.yml - sdk/advisor/Azure.ResourceManager.Advisor/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/advisor/ci.mgmt.yml + - sdk/advisor/Azure.ResourceManager.Advisor/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/agrifood/ci.mgmt.yml b/sdk/agrifood/ci.mgmt.yml index ee27d71f9495..03a5f6399ccb 100644 --- a/sdk/agrifood/ci.mgmt.yml +++ b/sdk/agrifood/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/agrifood/ci.mgmt.yml - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/agrifood/ci.mgmt.yml + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/alertsmanagement/ci.mgmt.yml b/sdk/alertsmanagement/ci.mgmt.yml index f33a90fffe5c..ad3a8d3d1efd 100644 --- a/sdk/alertsmanagement/ci.mgmt.yml +++ b/sdk/alertsmanagement/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/alertsmanagement/ci.mgmt.yml - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/alertsmanagement/ci.mgmt.yml + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/analysisservices/ci.mgmt.yml b/sdk/analysisservices/ci.mgmt.yml index 33729b962d88..d3774b358380 100644 --- a/sdk/analysisservices/ci.mgmt.yml +++ b/sdk/analysisservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/analysisservices/ci.mgmt.yml - sdk/analysisservices/Azure.ResourceManager.Analysis/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/analysisservices/ci.mgmt.yml + - sdk/analysisservices/Azure.ResourceManager.Analysis/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/apicenter/ci.mgmt.yml b/sdk/apicenter/ci.mgmt.yml index 41c037327e33..4882d4409c0b 100644 --- a/sdk/apicenter/ci.mgmt.yml +++ b/sdk/apicenter/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/apicenter/ci.mgmt.yml - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apicenter/ci.mgmt.yml + - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/apimanagement/ci.mgmt.yml b/sdk/apimanagement/ci.mgmt.yml index b72c80a2e0e6..2f766edb9528 100644 --- a/sdk/apimanagement/ci.mgmt.yml +++ b/sdk/apimanagement/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/apimanagement/ci.mgmt.yml - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apimanagement/ci.mgmt.yml + - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/appcomplianceautomation/ci.mgmt.yml b/sdk/appcomplianceautomation/ci.mgmt.yml index d8a31e0139a8..7c3b00d97c17 100644 --- a/sdk/appcomplianceautomation/ci.mgmt.yml +++ b/sdk/appcomplianceautomation/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/appcomplianceautomation/ci.mgmt.yml - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appcomplianceautomation/ci.mgmt.yml + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/appconfiguration/ci.mgmt.yml b/sdk/appconfiguration/ci.mgmt.yml index a883eaefcd59..e53dd63aca0f 100644 --- a/sdk/appconfiguration/ci.mgmt.yml +++ b/sdk/appconfiguration/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/appconfiguration/ci.mgmt.yml - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appconfiguration/ci.mgmt.yml + - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + # These comments should stay. extends: diff --git a/sdk/applicationinsights/ci.mgmt.yml b/sdk/applicationinsights/ci.mgmt.yml index af82b66e6952..361f4019d322 100644 --- a/sdk/applicationinsights/ci.mgmt.yml +++ b/sdk/applicationinsights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/applicationinsights/ci.mgmt.yml - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/applicationinsights/ci.mgmt.yml + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/appplatform/ci.mgmt.yml b/sdk/appplatform/ci.mgmt.yml index 1d28b9352b6c..023cebeb8d71 100644 --- a/sdk/appplatform/ci.mgmt.yml +++ b/sdk/appplatform/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/appplatform/ci.mgmt.yml - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appplatform/ci.mgmt.yml + - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/arc-scvmm/ci.mgmt.yml b/sdk/arc-scvmm/ci.mgmt.yml index bbc2db0c9f63..53438df9d332 100644 --- a/sdk/arc-scvmm/ci.mgmt.yml +++ b/sdk/arc-scvmm/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/arc-scvmm/ci.mgmt.yml - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/arc-scvmm/ci.mgmt.yml + - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/astronomer/ci.mgmt.yml b/sdk/astronomer/ci.mgmt.yml index f6099036651c..d0de6d52b29a 100644 --- a/sdk/astronomer/ci.mgmt.yml +++ b/sdk/astronomer/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/astronomer/ci.mgmt.yml - sdk/astronomer/Azure.ResourceManager.Astro/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/astronomer/ci.mgmt.yml + - sdk/astronomer/Azure.ResourceManager.Astro/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/attestation/ci.mgmt.yml b/sdk/attestation/ci.mgmt.yml index 51d1ac0c8240..595f887b2c35 100644 --- a/sdk/attestation/ci.mgmt.yml +++ b/sdk/attestation/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/attestation/ci.mgmt.yml - sdk/attestation/Azure.ResourceManager.Attestation/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ci.mgmt.yml + - sdk/attestation/Azure.ResourceManager.Attestation/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/authorization/ci.mgmt.yml b/sdk/authorization/ci.mgmt.yml index 7ac32fcc5543..9c9d9638348d 100644 --- a/sdk/authorization/ci.mgmt.yml +++ b/sdk/authorization/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/authorization/ci.mgmt.yml - sdk/authorization/Azure.ResourceManager.Authorization/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.mgmt.yml + - sdk/authorization/Azure.ResourceManager.Authorization/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/automanage/ci.mgmt.yml b/sdk/automanage/ci.mgmt.yml index 5a2467820b85..8e45b6506aa8 100644 --- a/sdk/automanage/ci.mgmt.yml +++ b/sdk/automanage/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/automanage/ci.mgmt.yml - sdk/automanage/Azure.ResourceManager.Automanage/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automanage/ci.mgmt.yml + - sdk/automanage/Azure.ResourceManager.Automanage/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/automation/ci.mgmt.yml b/sdk/automation/ci.mgmt.yml index 45bec5d1c196..b2cb0f44bf22 100644 --- a/sdk/automation/ci.mgmt.yml +++ b/sdk/automation/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/automation/ci.mgmt.yml - sdk/automation/Azure.ResourceManager.Automation/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automation/ci.mgmt.yml + - sdk/automation/Azure.ResourceManager.Automation/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/avs/ci.mgmt.yml b/sdk/avs/ci.mgmt.yml index 6404a2ba34ce..7030303dc9f4 100644 --- a/sdk/avs/ci.mgmt.yml +++ b/sdk/avs/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/avs/ci.mgmt.yml - sdk/avs/Azure.ResourceManager.Avs/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ci.mgmt.yml + - sdk/avs/Azure.ResourceManager.Avs/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/azurelargeinstance/ci.mgmt.yml b/sdk/azurelargeinstance/ci.mgmt.yml index fbe98927ef15..d9425419d2c3 100644 --- a/sdk/azurelargeinstance/ci.mgmt.yml +++ b/sdk/azurelargeinstance/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/azurelargeinstance/ci.mgmt.yml - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurelargeinstance/ci.mgmt.yml + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/azurestackhci/ci.mgmt.yml b/sdk/azurestackhci/ci.mgmt.yml index 89c22080e00c..167241c22e36 100644 --- a/sdk/azurestackhci/ci.mgmt.yml +++ b/sdk/azurestackhci/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/azurestackhci/ci.mgmt.yml - sdk/azurestackhci/Azure.ResourceManager.Hci/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurestackhci/ci.mgmt.yml + - sdk/azurestackhci/Azure.ResourceManager.Hci/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/batch/ci.mgmt.yml b/sdk/batch/ci.mgmt.yml index fdb37873525c..57a9135b3c71 100644 --- a/sdk/batch/ci.mgmt.yml +++ b/sdk/batch/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/batch/ci.mgmt.yml - sdk/batch/Azure.ResourceManager.Batch/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/batch/ci.mgmt.yml + - sdk/batch/Azure.ResourceManager.Batch/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/billing/ci.mgmt.yml b/sdk/billing/ci.mgmt.yml index 67cf904850c6..0efcab4a9c90 100644 --- a/sdk/billing/ci.mgmt.yml +++ b/sdk/billing/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/billing/ci.mgmt.yml - sdk/billing/Azure.ResourceManager.Billing/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billing/ci.mgmt.yml + - sdk/billing/Azure.ResourceManager.Billing/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/billingbenefits/ci.mgmt.yml b/sdk/billingbenefits/ci.mgmt.yml index 9900a842be4f..d2d1e939d8cd 100644 --- a/sdk/billingbenefits/ci.mgmt.yml +++ b/sdk/billingbenefits/ci.mgmt.yml @@ -2,6 +2,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/billingbenefits/ci.mgmt.yml - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billingbenefits/ci.mgmt.yml + - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/blueprint/ci.mgmt.yml b/sdk/blueprint/ci.mgmt.yml index 65bd23b77f51..6524937da4ee 100644 --- a/sdk/blueprint/ci.mgmt.yml +++ b/sdk/blueprint/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/blueprint/ci.mgmt.yml - sdk/blueprint/Azure.ResourceManager.Blueprint/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/blueprint/ci.mgmt.yml + - sdk/blueprint/Azure.ResourceManager.Blueprint/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/botservice/ci.mgmt.yml b/sdk/botservice/ci.mgmt.yml index 8e5444ff3f9a..3e991a6ebab1 100644 --- a/sdk/botservice/ci.mgmt.yml +++ b/sdk/botservice/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/botservice/ci.mgmt.yml - sdk/botservice/Azure.ResourceManager.BotService/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/botservice/ci.mgmt.yml + - sdk/botservice/Azure.ResourceManager.BotService/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/cdn/ci.mgmt.yml b/sdk/cdn/ci.mgmt.yml index ac2ea82249d1..f1932c6d31b9 100644 --- a/sdk/cdn/ci.mgmt.yml +++ b/sdk/cdn/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/cdn/ci.mgmt.yml - sdk/cdn/Azure.ResourceManager.Cdn/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.mgmt.yml + - sdk/cdn/Azure.ResourceManager.Cdn/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/changeanalysis/ci.mgmt.yml b/sdk/changeanalysis/ci.mgmt.yml index 65c6e90d195a..aee7612c339f 100644 --- a/sdk/changeanalysis/ci.mgmt.yml +++ b/sdk/changeanalysis/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/changeanalysis/ci.mgmt.yml - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/changeanalysis/ci.mgmt.yml + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/chaos/ci.mgmt.yml b/sdk/chaos/ci.mgmt.yml index 585591bcb6bd..a74922d27932 100644 --- a/sdk/chaos/ci.mgmt.yml +++ b/sdk/chaos/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/chaos/ci.mgmt.yml - sdk/chaos/Azure.ResourceManager.Chaos/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/chaos/ci.mgmt.yml + - sdk/chaos/Azure.ResourceManager.Chaos/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/cognitiveservices/ci.mgmt.yml b/sdk/cognitiveservices/ci.mgmt.yml index ddeb32b868ce..79dda70912e2 100644 --- a/sdk/cognitiveservices/ci.mgmt.yml +++ b/sdk/cognitiveservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/cognitiveservices/ci.mgmt.yml - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitiveservices/ci.mgmt.yml + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/communication/ci.mgmt.yml b/sdk/communication/ci.mgmt.yml index 8fc73e107745..be0c8b4b5903 100644 --- a/sdk/communication/ci.mgmt.yml +++ b/sdk/communication/ci.mgmt.yml @@ -1,5 +1,6 @@ trigger: none + pr: branches: include: @@ -12,6 +13,18 @@ pr: - sdk/communication/ci.mgmt.yml - sdk/communication/Azure.ResourceManager.Communication/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/communication/ci.mgmt.yml + - sdk/communication/Azure.ResourceManager.Communication/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/compute/ci.mgmt.yml b/sdk/compute/ci.mgmt.yml index d9520f58d12c..9736fea82d63 100644 --- a/sdk/compute/ci.mgmt.yml +++ b/sdk/compute/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/compute/ci.mgmt.yml - sdk/compute/Azure.ResourceManager.Compute/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.mgmt.yml + - sdk/compute/Azure.ResourceManager.Compute/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/computefleet/ci.mgmt.yml b/sdk/computefleet/ci.mgmt.yml index de169e18c599..58fc15347c98 100644 --- a/sdk/computefleet/ci.mgmt.yml +++ b/sdk/computefleet/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/computefleet/ci.mgmt.yml - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/computeschedule/ci.mgmt.yml b/sdk/computeschedule/ci.mgmt.yml index d3a367f82551..01d026ef37ea 100644 --- a/sdk/computeschedule/ci.mgmt.yml +++ b/sdk/computeschedule/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/computeschedule/ci.mgmt.yml - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computeschedule/ci.mgmt.yml + - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/confidentialledger/ci.mgmt.yml b/sdk/confidentialledger/ci.mgmt.yml index 7343d843f2ee..b61c498ed14a 100644 --- a/sdk/confidentialledger/ci.mgmt.yml +++ b/sdk/confidentialledger/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,18 @@ pr: - sdk/confidentialledger/ci.mgmt.yml - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confidentialledger/ci.mgmt.yml + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/confluent/ci.mgmt.yml b/sdk/confluent/ci.mgmt.yml index 12d37aa41bd2..757508d306f9 100644 --- a/sdk/confluent/ci.mgmt.yml +++ b/sdk/confluent/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/confluent/ci.mgmt.yml - sdk/confluent/Azure.ResourceManager.Confluent/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confluent/ci.mgmt.yml + - sdk/confluent/Azure.ResourceManager.Confluent/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/connectedvmwarevsphere/ci.mgmt.yml b/sdk/connectedvmwarevsphere/ci.mgmt.yml index a9d0db85cf82..f8990a206c45 100644 --- a/sdk/connectedvmwarevsphere/ci.mgmt.yml +++ b/sdk/connectedvmwarevsphere/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/connectedvmwarevsphere/ci.mgmt.yml - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/connectedvmwarevsphere/ci.mgmt.yml + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/consumption/ci.mgmt.yml b/sdk/consumption/ci.mgmt.yml index 6b0ebe2b2fa7..ccda85ce5789 100644 --- a/sdk/consumption/ci.mgmt.yml +++ b/sdk/consumption/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/consumption/ci.mgmt.yml - sdk/consumption/Azure.ResourceManager.Consumption/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/consumption/ci.mgmt.yml + - sdk/consumption/Azure.ResourceManager.Consumption/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerapps/ci.mgmt.yml b/sdk/containerapps/ci.mgmt.yml index 7715d499fa59..69564e2f1920 100644 --- a/sdk/containerapps/ci.mgmt.yml +++ b/sdk/containerapps/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/containerapps/ci.mgmt.yml - sdk/containerapps/Azure.ResourceManager.AppContainers/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerapps/ci.mgmt.yml + - sdk/containerapps/Azure.ResourceManager.AppContainers/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerinstance/ci.mgmt.yml b/sdk/containerinstance/ci.mgmt.yml index 0b4d90bf6d1c..865705313c2c 100644 --- a/sdk/containerinstance/ci.mgmt.yml +++ b/sdk/containerinstance/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/containerinstance/ci.mgmt.yml - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.mgmt.yml + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerorchestratorruntime/ci.mgmt.yml b/sdk/containerorchestratorruntime/ci.mgmt.yml index 0a036386143b..98ade1bcf8c6 100644 --- a/sdk/containerorchestratorruntime/ci.mgmt.yml +++ b/sdk/containerorchestratorruntime/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/containerorchestratorruntime/ci.mgmt.yml - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerorchestratorruntime/ci.mgmt.yml + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerregistry/ci.mgmt.yml b/sdk/containerregistry/ci.mgmt.yml index e3f0cfb5bfa5..5fa9fce02790 100644 --- a/sdk/containerregistry/ci.mgmt.yml +++ b/sdk/containerregistry/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/containerregistry/ci.mgmt.yml - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerregistry/ci.mgmt.yml + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerservice/ci.mgmt.yml b/sdk/containerservice/ci.mgmt.yml index 9eb58047b02e..8eb615e701f7 100644 --- a/sdk/containerservice/ci.mgmt.yml +++ b/sdk/containerservice/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/containerservice/ci.mgmt.yml - sdk/containerservice/Azure.ResourceManager.ContainerService/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.mgmt.yml + - sdk/containerservice/Azure.ResourceManager.ContainerService/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: 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 353096046704..41645af90db2 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBManagedCassandraClusterListByResourceGroup() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBManagedCassandraClusterListByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -91,7 +91,7 @@ public async Task Get_CosmosDBManagedCassandraClusterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -121,7 +121,7 @@ public async Task Exists_CosmosDBManagedCassandraClusterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -163,7 +163,7 @@ public async Task GetIfExists_CosmosDBManagedCassandraClusterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBManagedCassandraClusterCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -173,7 +173,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); 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 2ebf1b09b464..bcdc19a71497 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 @@ -21,7 +21,7 @@ public partial class Sample_CassandraClusterResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCassandraClusters_CosmosDBManagedCassandraClusterListBySubscription() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -53,7 +53,7 @@ public async Task GetCassandraClusters_CosmosDBManagedCassandraClusterListBySubs [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -84,7 +84,7 @@ public async Task Get_CosmosDBManagedCassandraClusterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBManagedCassandraClusterDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -111,7 +111,7 @@ public async Task Delete_CosmosDBManagedCassandraClusterDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBManagedCassandraClusterPatch() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -175,7 +175,7 @@ public async Task Update_CosmosDBManagedCassandraClusterPatch() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task InvokeCommand_CosmosDBManagedCassandraCommand() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraCommand.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -185,151 +185,26 @@ 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}"); } - // CosmosDBManagedCassandraListCommand - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetCommand_CosmosDBManagedCassandraListCommand() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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"); - } - - // CosmosDBManagedCassandraCommandResult - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetCommandAsync_CosmosDBManagedCassandraCommandResult() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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 and iterate over the result - string commandId = "318653d0-3da5-4814-b8f6-429f2af0b2a4"; - await foreach (CassandraClusterCommand item in cassandraCluster.GetCommandAsyncAsync(commandId)) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBManagedCassandraBackupsList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetBackups_CosmosDBManagedCassandraBackupsList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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"); - } - - // CosmosDBManagedCassandraBackup - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetBackup_CosmosDBManagedCassandraBackup() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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}"); - } - // CosmosDBManagedCassandraClusterDeallocate [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -339,7 +214,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); @@ -356,7 +231,7 @@ public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Start_CosmosDBManagedCassandraClusterStart() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterStart.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -366,7 +241,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); @@ -383,7 +258,7 @@ public async Task Start_CosmosDBManagedCassandraClusterStart() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Status_CosmosDBManagedCassandraStatus() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraStatus.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -393,7 +268,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 66c12bc065cf..2cd453acbc29 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBManagedCassandraDataCenterList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBManagedCassandraDataCenterList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -92,7 +92,7 @@ public async Task Get_CosmosDBManagedCassandraDataCenterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBManagedCassandraDataCenterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBManagedCassandraDataCenterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBManagedCassandraDataCenterCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 5307170a10b5..b80ba9ba5555 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBManagedCassandraDataCenterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBManagedCassandraDataCenterDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -80,7 +80,7 @@ public async Task Delete_CosmosDBManagedCassandraDataCenterDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBManagedCassandraDataCenterUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 87f6e5b72f10..6ec8e367fd60 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBCassandraKeyspaceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBCassandraKeyspaceList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -92,7 +92,7 @@ public async Task Get_CosmosDBCassandraKeyspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBCassandraKeyspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBCassandraKeyspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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_CassandraKeyspaceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs index 70ad76958fc0..440c6ec62203 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBCassandraKeyspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBCassandraKeyspaceCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -92,7 +92,7 @@ public async Task Update_CosmosDBCassandraKeyspaceCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBCassandraKeyspaceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 1d862794db84..0cebe6e108c2 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraKeyspaceThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBCassandraKeyspaceThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -94,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateCassandraKeyspaceToAutoscale_CosmosDBCassandraKeyspaceMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -127,7 +127,7 @@ public async Task MigrateCassandraKeyspaceToAutoscale_CosmosDBCassandraKeyspaceM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateCassandraKeyspaceToManualThroughput_CosmosDBCassandraKeyspaceMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 03c272650886..b64fcd6c71d3 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBCassandraTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBCassandraTableList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -94,7 +94,7 @@ public async Task Get_CosmosDBCassandraTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBCassandraTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBCassandraTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBCassandraTableCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -221,7 +221,6 @@ public async Task CreateOrUpdate_CosmosDBCassandraTableCreateUpdate() } }, }, - AnalyticalStorageTtl = 500, }) { Options = new CosmosDBCreateUpdateConfig(), 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 461f2de6ba04..7243a6925d49 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -53,7 +53,7 @@ public async Task Get_CosmosDBCassandraTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBCassandraTableCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -101,7 +101,6 @@ public async Task Update_CosmosDBCassandraTableCreateUpdate() } }, }, - AnalyticalStorageTtl = 500, }) { Options = new CosmosDBCreateUpdateConfig(), @@ -124,7 +123,7 @@ public async Task Update_CosmosDBCassandraTableCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBCassandraTableDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 27a42395e8cf..aa9956621a33 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraTableThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -53,7 +53,7 @@ public async Task Get_CosmosDBCassandraTableThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBCassandraTableThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -96,7 +96,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraTableThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateCassandraTableToAutoscale_CosmosDBCassandraTableMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -130,7 +130,7 @@ public async Task MigrateCassandraTableToAutoscale_CosmosDBCassandraTableMigrate [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateCassandraTableToManualThroughput_CosmosDBCassandraTableMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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_CassandraViewGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs deleted file mode 100644 index 872a645748d2..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CassandraViewGetResultCollection - { - // CosmosDBCassandraViewList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBCassandraViewList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewList.json - // this example is just showing the usage of "CassandraResources_ListCassandraViews" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation and iterate over the result - await foreach (CassandraViewGetResultResource item in collection.GetAllAsync()) - { - // 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 - CassandraViewGetResultData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBCassandraViewGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBCassandraViewGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation - string viewName = "viewname"; - CassandraViewGetResultResource result = await collection.GetAsync(viewName); - - // 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 - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBCassandraViewGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation - string viewName = "viewname"; - bool result = await collection.ExistsAsync(viewName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBCassandraViewGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBCassandraViewGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation - string viewName = "viewname"; - NullableResponse response = await collection.GetIfExistsAsync(viewName); - CassandraViewGetResultResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // 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 - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDBCassandraViewCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBCassandraViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json - // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation - string viewName = "viewname"; - CassandraViewGetResultCreateOrUpdateContent content = new CassandraViewGetResultCreateOrUpdateContent(new AzureLocation("placeholder"), new CassandraViewResource("viewname", "SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)")) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, viewName, content); - CassandraViewGetResultResource 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 - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs deleted file mode 100644 index 9dac8603da40..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CassandraViewGetResultResource - { - // CosmosDBCassandraViewGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBCassandraViewGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CassandraViewGetResultResource created on azure - // for more information of creating CassandraViewGetResultResource, please refer to the document of CassandraViewGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewGetResultResourceId = CassandraViewGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewGetResultResource cassandraViewGetResult = client.GetCassandraViewGetResultResource(cassandraViewGetResultResourceId); - - // invoke the operation - CassandraViewGetResultResource result = await cassandraViewGetResult.GetAsync(); - - // 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 - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBCassandraViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json - // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CassandraViewGetResultResource created on azure - // for more information of creating CassandraViewGetResultResource, please refer to the document of CassandraViewGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewGetResultResourceId = CassandraViewGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewGetResultResource cassandraViewGetResult = client.GetCassandraViewGetResultResource(cassandraViewGetResultResourceId); - - // invoke the operation - CassandraViewGetResultCreateOrUpdateContent content = new CassandraViewGetResultCreateOrUpdateContent(new AzureLocation("placeholder"), new CassandraViewResource("viewname", "SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)")) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await cassandraViewGetResult.UpdateAsync(WaitUntil.Completed, content); - CassandraViewGetResultResource 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 - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewDelete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_CosmosDBCassandraViewDelete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewDelete.json - // this example is just showing the usage of "CassandraResources_DeleteCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CassandraViewGetResultResource created on azure - // for more information of creating CassandraViewGetResultResource, please refer to the document of CassandraViewGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewGetResultResourceId = CassandraViewGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewGetResultResource cassandraViewGetResult = client.GetCassandraViewGetResultResource(cassandraViewGetResultResourceId); - - // invoke the operation - await cassandraViewGetResult.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs deleted file mode 100644 index e24354257073..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CassandraViewThroughputSettingResource - { - // CosmosDBCassandraViewThroughputGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBCassandraViewThroughputGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewThroughputGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraViewThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CassandraViewThroughputSettingResource created on azure - // for more information of creating CassandraViewThroughputSettingResource, please refer to the document of CassandraViewThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewThroughputSettingResourceId = CassandraViewThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewThroughputSettingResource cassandraViewThroughputSetting = client.GetCassandraViewThroughputSettingResource(cassandraViewThroughputSettingResourceId); - - // invoke the operation - CassandraViewThroughputSettingResource result = await cassandraViewThroughputSetting.GetAsync(); - - // 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 - ThroughputSettingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewThroughputUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBCassandraViewThroughputUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewThroughputUpdate.json - // this example is just showing the usage of "CassandraResources_UpdateCassandraViewThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CassandraViewThroughputSettingResource created on azure - // for more information of creating CassandraViewThroughputSettingResource, please refer to the document of CassandraViewThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewThroughputSettingResourceId = CassandraViewThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewThroughputSettingResource cassandraViewThroughputSetting = client.GetCassandraViewThroughputSettingResource(cassandraViewThroughputSettingResourceId); - - // invoke the operation - ThroughputSettingsUpdateData data = new ThroughputSettingsUpdateData(new AzureLocation("placeholder"), new ThroughputSettingsResourceInfo() - { - Throughput = 400, - }) - { - Tags = -{ -}, - }; - ArmOperation lro = await cassandraViewThroughputSetting.CreateOrUpdateAsync(WaitUntil.Completed, data); - CassandraViewThroughputSettingResource 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 - ThroughputSettingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewMigrateToAutoscale - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MigrateCassandraViewToAutoscale_CosmosDBCassandraViewMigrateToAutoscale() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json - // this example is just showing the usage of "CassandraResources_MigrateCassandraViewToAutoscale" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CassandraViewThroughputSettingResource created on azure - // for more information of creating CassandraViewThroughputSettingResource, please refer to the document of CassandraViewThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewThroughputSettingResourceId = CassandraViewThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewThroughputSettingResource cassandraViewThroughputSetting = client.GetCassandraViewThroughputSettingResource(cassandraViewThroughputSettingResourceId); - - // invoke the operation - ArmOperation lro = await cassandraViewThroughputSetting.MigrateCassandraViewToAutoscaleAsync(WaitUntil.Completed); - CassandraViewThroughputSettingResource 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 - ThroughputSettingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewMigrateToManualThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MigrateCassandraViewToManualThroughput_CosmosDBCassandraViewMigrateToManualThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json - // this example is just showing the usage of "CassandraResources_MigrateCassandraViewToManualThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CassandraViewThroughputSettingResource created on azure - // for more information of creating CassandraViewThroughputSettingResource, please refer to the document of CassandraViewThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewThroughputSettingResourceId = CassandraViewThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewThroughputSettingResource cassandraViewThroughputSetting = client.GetCassandraViewThroughputSettingResource(cassandraViewThroughputSettingResourceId); - - // invoke the operation - ArmOperation lro = await cassandraViewThroughputSetting.MigrateCassandraViewToManualThroughputAsync(WaitUntil.Completed); - CassandraViewThroughputSettingResource 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 - ThroughputSettingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} 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 c6958672242f..bc6daa48d35d 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -56,7 +56,7 @@ public async Task Get_CosmosDBDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -128,7 +128,7 @@ public async Task GetIfExists_CosmosDBDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountCreateMax.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -164,6 +164,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, @@ -215,20 +222,9 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() 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 = { }, @@ -248,7 +244,7 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMin() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountCreateMin.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -295,7 +291,7 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMin() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -361,12 +357,10 @@ public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson( }, } }, - 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 = { @@ -387,7 +381,7 @@ public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBDatabaseAccountListByResourceGroup() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 aef0c4b39bed..904bac34f6dc 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 @@ -22,7 +22,7 @@ public partial class Sample_CosmosDBAccountResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -53,7 +53,7 @@ public async Task Get_CosmosDBDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBDatabaseAccountPatch() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -118,7 +118,7 @@ public async Task Update_CosmosDBDatabaseAccountPatch() { BackupIntervalInMinutes = 240, BackupRetentionIntervalInHours = 720, - BackupStorageRedundancy = CosmosDBBackupStorageRedundancy.Geo, + BackupStorageRedundancy = CosmosDBBackupStorageRedundancy.Local, }, }, NetworkAclBypass = NetworkAclBypass.AzureServices, @@ -126,14 +126,10 @@ public async Task Update_CosmosDBDatabaseAccountPatch() { 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); @@ -151,7 +147,7 @@ public async Task Update_CosmosDBDatabaseAccountPatch() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBDatabaseAccountDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -178,7 +174,7 @@ public async Task Delete_CosmosDBDatabaseAccountDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task FailoverPriorityChange_CosmosDBDatabaseAccountFailoverPriorityChange() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -217,7 +213,7 @@ public async Task FailoverPriorityChange_CosmosDBDatabaseAccountFailoverPriority [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCosmosDBAccounts_CosmosDBDatabaseAccountList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -249,7 +245,7 @@ public async Task GetCosmosDBAccounts_CosmosDBDatabaseAccountList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_CosmosDBDatabaseAccountListKeys() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountListKeys.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -276,7 +272,7 @@ public async Task GetKeys_CosmosDBDatabaseAccountListKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStrings() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -306,7 +302,7 @@ public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStri [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStringsMongo() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -336,7 +332,7 @@ public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStri [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task OfflineRegion_CosmosDBDatabaseAccountOfflineRegion() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -364,7 +360,7 @@ public async Task OfflineRegion_CosmosDBDatabaseAccountOfflineRegion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task OnlineRegion_CosmosDBDatabaseAccountOnlineRegion() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -392,7 +388,7 @@ public async Task OnlineRegion_CosmosDBDatabaseAccountOnlineRegion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetReadOnlyKeys_CosmosDBDatabaseAccountListReadOnlyKeys() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -419,7 +415,7 @@ public async Task GetReadOnlyKeys_CosmosDBDatabaseAccountListReadOnlyKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RegenerateKey_CosmosDBDatabaseAccountRegenerateKey() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -447,7 +443,7 @@ public async Task RegenerateKey_CosmosDBDatabaseAccountRegenerateKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CheckNameExistsDatabaseAccount_CosmosDBDatabaseAccountCheckNameExists() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -471,7 +467,7 @@ public async Task CheckNameExistsDatabaseAccount_CosmosDBDatabaseAccountCheckNam [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetrics_CosmosDBDatabaseAccountGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -502,7 +498,7 @@ public async Task GetMetrics_CosmosDBDatabaseAccountGetMetrics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsages_CosmosDBDatabaseAccountGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -533,7 +529,7 @@ public async Task GetUsages_CosmosDBDatabaseAccountGetUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricDefinitions_CosmosDBDatabaseAccountGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -563,7 +559,7 @@ public async Task GetMetricDefinitions_CosmosDBDatabaseAccountGetMetricDefinitio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsDatabases_CosmosDBDatabaseGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -595,7 +591,7 @@ public async Task GetMetricsDatabases_CosmosDBDatabaseGetMetrics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsagesDatabases_CosmosDBDatabaseGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -627,7 +623,7 @@ public async Task GetUsagesDatabases_CosmosDBDatabaseGetUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricDefinitionsDatabases_CosmosDBDatabaseGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -658,7 +654,7 @@ public async Task GetMetricDefinitionsDatabases_CosmosDBDatabaseGetMetricDefinit [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsCollections_CosmosDBCollectionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCollectionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -691,7 +687,7 @@ public async Task GetMetricsCollections_CosmosDBCollectionGetMetrics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsagesCollections_CosmosDBCollectionGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCollectionGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -724,7 +720,7 @@ public async Task GetUsagesCollections_CosmosDBCollectionGetUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricDefinitionsCollections_CosmosDBCollectionGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCollectionGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -756,7 +752,7 @@ public async Task GetMetricDefinitionsCollections_CosmosDBCollectionGetMetricDef [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsCollectionRegions_CosmosDBRegionCollectionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRegionCollectionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -790,7 +786,7 @@ public async Task GetMetricsCollectionRegions_CosmosDBRegionCollectionGetMetrics [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsDatabaseAccountRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -822,7 +818,7 @@ public async Task GetMetricsDatabaseAccountRegions_CosmosDBDatabaseAccountRegion [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPercentileSourceTargets_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -855,7 +851,7 @@ public async Task GetMetricsPercentileSourceTargets_CosmosDBDatabaseAccountRegio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPercentileTargets_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPercentileTargetGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -887,7 +883,7 @@ public async Task GetMetricsPercentileTargets_CosmosDBDatabaseAccountRegionGetMe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPercentiles_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPercentileGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -918,7 +914,7 @@ public async Task GetMetricsPercentiles_CosmosDBDatabaseAccountRegionGetMetrics( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsCollectionPartitionRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -952,7 +948,7 @@ public async Task GetMetricsCollectionPartitionRegions_CosmosDBDatabaseAccountRe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsCollectionPartitions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCollectionPartitionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -985,7 +981,7 @@ public async Task GetMetricsCollectionPartitions_CosmosDBDatabaseAccountRegionGe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsagesCollectionPartitions_CosmosDBCollectionGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCollectionPartitionGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -1018,7 +1014,7 @@ public async Task GetUsagesCollectionPartitions_CosmosDBCollectionGetUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPartitionKeyRangeIds_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -1052,7 +1048,7 @@ public async Task GetMetricsPartitionKeyRangeIds_CosmosDBDatabaseAccountRegionGe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPartitionKeyRangeIdRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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_CosmosDBChaosFaultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResource.cs deleted file mode 100644 index 01c735faeb92..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResource.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.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBChaosFaultResource - { - // ChaosFaultEnableDisable - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_ChaosFaultEnableDisable() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/ChaosFaultEnableDisable.json - // this example is just showing the usage of "ChaosFault_EnableDisable" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 CosmosDBChaosFaultResource created on azure - // for more information of creating CosmosDBChaosFaultResource, please refer to the document of CosmosDBChaosFaultResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroupName"; - string accountName = "myAccountName"; - string chaosFault = "ServiceUnavailability"; - ResourceIdentifier cosmosDBChaosFaultResourceId = CosmosDBChaosFaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, chaosFault); - CosmosDBChaosFaultResource cosmosDBChaosFaultResource = client.GetCosmosDBChaosFaultResource(cosmosDBChaosFaultResourceId); - - // invoke the operation - CosmosDBChaosFaultResourceData data = new CosmosDBChaosFaultResourceData() - { - CosmosDBChaosFaultSupportedActions = CosmosDBChaosFaultSupportedAction.Enable, - Region = "EastUS", - DatabaseName = "testDatabase", - ContainerName = "testCollection", - }; - ArmOperation lro = await cosmosDBChaosFaultResource.UpdateAsync(WaitUntil.Completed, data); - CosmosDBChaosFaultResource 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 - CosmosDBChaosFaultResourceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // ChaosFaultGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_ChaosFaultGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/ChaosFaultGet.json - // this example is just showing the usage of "ChaosFault_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBChaosFaultResource created on azure - // for more information of creating CosmosDBChaosFaultResource, please refer to the document of CosmosDBChaosFaultResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string chaosFault = "ServiceUnavailability"; - ResourceIdentifier cosmosDBChaosFaultResourceId = CosmosDBChaosFaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, chaosFault); - CosmosDBChaosFaultResource cosmosDBChaosFaultResource = client.GetCosmosDBChaosFaultResource(cosmosDBChaosFaultResourceId); - - // invoke the operation - CosmosDBChaosFaultResource result = await cosmosDBChaosFaultResource.GetAsync(); - - // 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 - CosmosDBChaosFaultResourceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResourceCollection.cs deleted file mode 100644 index e682cb4005a3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResourceCollection.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBChaosFaultResourceCollection - { - // ChaosFaultList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ChaosFaultList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/ChaosFaultList.json - // this example is just showing the usage of "ChaosFault_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 CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this CosmosDBChaosFaultResource - CosmosDBChaosFaultResourceCollection collection = cosmosDBAccount.GetCosmosDBChaosFaultResources(); - - // invoke the operation and iterate over the result - await foreach (CosmosDBChaosFaultResource item in collection.GetAllAsync()) - { - // 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 - CosmosDBChaosFaultResourceData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // ChaosFaultEnableDisable - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_ChaosFaultEnableDisable() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/ChaosFaultEnableDisable.json - // this example is just showing the usage of "ChaosFault_EnableDisable" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroupName"; - string accountName = "myAccountName"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this CosmosDBChaosFaultResource - CosmosDBChaosFaultResourceCollection collection = cosmosDBAccount.GetCosmosDBChaosFaultResources(); - - // invoke the operation - string chaosFault = "ServiceUnavailability"; - CosmosDBChaosFaultResourceData data = new CosmosDBChaosFaultResourceData() - { - CosmosDBChaosFaultSupportedActions = CosmosDBChaosFaultSupportedAction.Enable, - Region = "EastUS", - DatabaseName = "testDatabase", - ContainerName = "testCollection", - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, chaosFault, data); - CosmosDBChaosFaultResource 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 - CosmosDBChaosFaultResourceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // ChaosFaultGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_ChaosFaultGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/ChaosFaultGet.json - // this example is just showing the usage of "ChaosFault_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 - 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 = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this CosmosDBChaosFaultResource - CosmosDBChaosFaultResourceCollection collection = cosmosDBAccount.GetCosmosDBChaosFaultResources(); - - // invoke the operation - string chaosFault = "ServiceUnavailability"; - CosmosDBChaosFaultResource result = await collection.GetAsync(chaosFault); - - // 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 - CosmosDBChaosFaultResourceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // ChaosFaultGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_ChaosFaultGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/ChaosFaultGet.json - // this example is just showing the usage of "ChaosFault_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 - 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 = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this CosmosDBChaosFaultResource - CosmosDBChaosFaultResourceCollection collection = cosmosDBAccount.GetCosmosDBChaosFaultResources(); - - // invoke the operation - string chaosFault = "ServiceUnavailability"; - bool result = await collection.ExistsAsync(chaosFault); - - Console.WriteLine($"Succeeded: {result}"); - } - - // ChaosFaultGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_ChaosFaultGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/ChaosFaultGet.json - // this example is just showing the usage of "ChaosFault_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 - 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 = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this CosmosDBChaosFaultResource - CosmosDBChaosFaultResourceCollection collection = cosmosDBAccount.GetCosmosDBChaosFaultResources(); - - // invoke the operation - string chaosFault = "ServiceUnavailability"; - NullableResponse response = await collection.GetIfExistsAsync(chaosFault); - CosmosDBChaosFaultResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // 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 - CosmosDBChaosFaultResourceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} 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 932c4dee8e09..aa3b11dcd756 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBLocationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBLocationList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -55,7 +55,7 @@ public async Task GetAll_CosmosDBLocationList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -88,7 +88,7 @@ public async Task Get_CosmosDBLocationGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -117,7 +117,7 @@ public async Task Exists_CosmosDBLocationGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 961f915ddc5d..1dcec648d52c 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 80fcf8c3d037..2d3629138a1a 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -57,7 +57,7 @@ public async Task GetAll_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -92,7 +92,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -123,7 +123,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -166,7 +166,7 @@ public async Task GetIfExists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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_CosmosDBPrivateEndpointConnectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs index 54a48a850d93..83195bbae49b 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -93,7 +93,7 @@ public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeletesAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 f171a5c1a7cd..1248e6de6e54 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 1a39ed91c4f5..151da8daa2a2 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateLinkResourceListGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -56,7 +56,7 @@ public async Task GetAll_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -91,7 +91,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -122,7 +122,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 c64b2038bd3a..38dd897ae8f4 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBServicesList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBServicesList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBServicesList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_DataTransferServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDataTransferServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -101,7 +101,7 @@ public async Task CreateOrUpdate_DataTransferServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_GraphAPIComputeServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -145,7 +145,7 @@ public async Task CreateOrUpdate_GraphAPIComputeServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_MaterializedViewsBuilderServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -189,7 +189,7 @@ public async Task CreateOrUpdate_MaterializedViewsBuilderServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_SqlDedicatedGatewayServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -234,7 +234,7 @@ public async Task CreateOrUpdate_SqlDedicatedGatewayServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -269,7 +269,7 @@ public async Task Get_DataTransferServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -300,7 +300,7 @@ public async Task Exists_DataTransferServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -343,7 +343,7 @@ public async Task GetIfExists_DataTransferServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -378,7 +378,7 @@ public async Task Get_GraphAPIComputeServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -409,7 +409,7 @@ public async Task Exists_GraphAPIComputeServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -452,7 +452,7 @@ public async Task GetIfExists_GraphAPIComputeServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -487,7 +487,7 @@ public async Task Get_MaterializedViewsBuilderServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -518,7 +518,7 @@ public async Task Exists_MaterializedViewsBuilderServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -561,7 +561,7 @@ public async Task GetIfExists_MaterializedViewsBuilderServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -596,7 +596,7 @@ public async Task Get_SqlDedicatedGatewayServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -627,7 +627,7 @@ public async Task Exists_SqlDedicatedGatewayServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 5862235cb006..1abe5c425467 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DataTransferServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDataTransferServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -61,7 +61,7 @@ public async Task Update_DataTransferServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_GraphAPIComputeServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -102,7 +102,7 @@ public async Task Update_GraphAPIComputeServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_MaterializedViewsBuilderServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -143,7 +143,7 @@ public async Task Update_MaterializedViewsBuilderServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_SqlDedicatedGatewayServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -185,7 +185,7 @@ public async Task Update_SqlDedicatedGatewayServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -217,7 +217,7 @@ public async Task Get_DataTransferServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -249,7 +249,7 @@ public async Task Get_GraphAPIComputeServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -281,7 +281,7 @@ public async Task Get_MaterializedViewsBuilderServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -313,7 +313,7 @@ public async Task Get_SqlDedicatedGatewayServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DataTransferServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDataTransferServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -341,7 +341,7 @@ public async Task Delete_DataTransferServiceDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_GraphAPIComputeServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -369,7 +369,7 @@ public async Task Delete_GraphAPIComputeServiceDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_MaterializedViewsBuilderServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -397,7 +397,7 @@ public async Task Delete_MaterializedViewsBuilderServiceDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_SqlDedicatedGatewayServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 0069c55855c8..58097c690ddc 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 @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlClientEncryptionKeyCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBClientEncryptionKeysList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlClientEncryptionKeysList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBClientEncryptionKeysList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -94,7 +94,7 @@ public async Task Get_CosmosDBClientEncryptionKeyGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBClientEncryptionKeyGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBClientEncryptionKeyGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBClientEncryptionKeyCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -196,7 +196,7 @@ public async Task CreateOrUpdate_CosmosDBClientEncryptionKeyCreateUpdate() { Id = "cekName", EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", - WrappedDataEncryptionKey = Convert.FromBase64String("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), + WrappedDataEncryptionKey = Convert.FromBase64String("U3dhZ2dlciByb2Nrcw=="), KeyWrapMetadata = new CosmosDBKeyWrapMetadata() { Name = "customerManagedKey", 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 ecea9fb37867..0d80044360df 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 @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlClientEncryptionKeyResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBClientEncryptionKeyCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 = Convert.FromBase64String("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), + WrappedDataEncryptionKey = Convert.FromBase64String("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 763064ad573d..3e4e78933c39 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlContainerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBSqlContainerList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -94,7 +94,7 @@ public async Task Get_CosmosDBSqlContainerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBSqlContainerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBSqlContainerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlContainerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -221,6 +221,10 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerCreateUpdate() }, ExcludedPaths = { +}, + VectorIndexes = +{ +new VectorIndex("/vectorPath1",VectorIndexType.Flat),new VectorIndex("/vectorPath2",VectorIndexType.QuantizedFlat),new VectorIndex("/vectorPath3",VectorIndexType.DiskANN) }, }, PartitionKey = new CosmosDBContainerPartitionKey() @@ -259,143 +263,10 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerCreateUpdate() Query = "SELECT VALUE LOWER(c.name) FROM c", } }, - }) - { - 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}"); - } - - // CosmosDBSqlContainerRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBSqlContainerRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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() - { - 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}"); - } - - // CosmosDBSqlMaterializedViewCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBSqlMaterializedViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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() -{ -Path = "/*", -Indexes = -{ -new CosmosDBPathIndexes() -{ -DataType = CosmosDBDataType.String, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -},new CosmosDBPathIndexes() -{ -DataType = CosmosDBDataType.Number, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -} -}, -} -}, - ExcludedPaths = + VectorEmbeddings = { +new VectorEmbedding("/vectorPath1",VectorDataType.Float32,DistanceFunction.Euclidean,400),new VectorEmbedding("/vectorPath2",VectorDataType.Uint8,DistanceFunction.Cosine,512),new VectorEmbedding("/vectorPath3",VectorDataType.Int8,DistanceFunction.Dotproduct,512) }, - }, - PartitionKey = new CosmosDBContainerPartitionKey() - { - Paths = -{ -"/mvpk" -}, - Kind = CosmosDBPartitionKind.Hash, - }, - MaterializedViewDefinition = new MaterializedViewDefinition("sourceContainerName", "select * from ROOT"), }) { Options = new CosmosDBCreateUpdateConfig(), 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 cd491ceb8a42..2e41f774caae 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -53,7 +53,7 @@ public async Task Get_CosmosDBSqlContainerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlContainerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -101,6 +101,10 @@ public async Task Update_CosmosDBSqlContainerCreateUpdate() }, ExcludedPaths = { +}, + VectorIndexes = +{ +new VectorIndex("/vectorPath1",VectorIndexType.Flat),new VectorIndex("/vectorPath2",VectorIndexType.QuantizedFlat),new VectorIndex("/vectorPath3",VectorIndexType.DiskANN) }, }, PartitionKey = new CosmosDBContainerPartitionKey() @@ -139,137 +143,10 @@ public async Task Update_CosmosDBSqlContainerCreateUpdate() Query = "SELECT VALUE LOWER(c.name) FROM c", } }, - }) - { - 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}"); - } - - // CosmosDBSqlContainerRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBSqlContainerRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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() - { - 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}"); - } - - // CosmosDBSqlMaterializedViewCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBSqlMaterializedViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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() -{ -Path = "/*", -Indexes = -{ -new CosmosDBPathIndexes() -{ -DataType = CosmosDBDataType.String, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -},new CosmosDBPathIndexes() -{ -DataType = CosmosDBDataType.Number, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -} -}, -} -}, - ExcludedPaths = + VectorEmbeddings = { +new VectorEmbedding("/vectorPath1",VectorDataType.Float32,DistanceFunction.Euclidean,400),new VectorEmbedding("/vectorPath2",VectorDataType.Uint8,DistanceFunction.Cosine,512),new VectorEmbedding("/vectorPath3",VectorDataType.Int8,DistanceFunction.Dotproduct,512) }, - }, - PartitionKey = new CosmosDBContainerPartitionKey() - { - Paths = -{ -"/mvpk" -}, - Kind = CosmosDBPartitionKind.Hash, - }, - MaterializedViewDefinition = new MaterializedViewDefinition("sourceContainerName", "select * from ROOT"), }) { Options = new CosmosDBCreateUpdateConfig(), @@ -292,7 +169,7 @@ public async Task Update_CosmosDBSqlMaterializedViewCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlContainerDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -316,46 +193,12 @@ public async Task Delete_CosmosDBSqlContainerDelete() Console.WriteLine($"Succeeded"); } - // CosmosDBSqlContainerPartitionMerge - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetSqlContainerPartitionMerge_CosmosDBSqlContainerPartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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}"); - } - // CosmosDBSqlContainerBackupInformation [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveContinuousBackupInformation_CosmosDBSqlContainerBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 63d6d42d2171..5d4562acd738 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; namespace Azure.ResourceManager.CosmosDB.Samples { @@ -21,7 +20,7 @@ public partial class Sample_CosmosDBSqlContainerThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlContainerThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -54,7 +53,7 @@ public async Task Get_CosmosDBSqlContainerThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlContainerThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -97,7 +96,7 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateSqlContainerToAutoscale_CosmosDBSqlContainerMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -131,7 +130,7 @@ public async Task MigrateSqlContainerToAutoscale_CosmosDBSqlContainerMigrateToAu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateSqlContainerToManualThroughput_CosmosDBSqlContainerMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -159,91 +158,5 @@ public async Task MigrateSqlContainerToManualThroughput_CosmosDBSqlContainerMigr // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBSqlContainerRetrieveThroughputDistribution - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlContainerRetrieveThroughputDistribution_CosmosDBSqlContainerRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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(new AzureLocation("placeholder"), 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}"); - } - - // CosmosDBSqlContainerRedistributeThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlContainerRedistributeThroughput_CosmosDBSqlContainerRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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(new AzureLocation("placeholder"), 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 ebefdbc4df69..9a889cced632 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBSqlDatabaseList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -92,7 +92,7 @@ public async Task Get_CosmosDBSqlDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBSqlDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBSqlDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -203,57 +203,5 @@ public async Task CreateOrUpdate_CosmosDBSqlDatabaseCreateUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBSqlDatabaseRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBSqlDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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}"); - } } } 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 f5ec2f75ef4c..ea54a4f3c4d1 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -87,61 +87,12 @@ public async Task Update_CosmosDBSqlDatabaseCreateUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // CosmosDBSqlDatabaseRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBSqlDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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}"); - } - // CosmosDBSqlDatabaseDelete [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -163,38 +114,5 @@ public async Task Delete_CosmosDBSqlDatabaseDelete() Console.WriteLine($"Succeeded"); } - - // CosmosDBSqlDatabasePartitionMerge - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlDatabasePartitionMerge_CosmosDBSqlDatabasePartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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 e42898da4465..95e83d20c338 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; namespace Azure.ResourceManager.CosmosDB.Samples { @@ -21,7 +20,7 @@ public partial class Sample_CosmosDBSqlDatabaseThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -53,7 +52,7 @@ public async Task Get_CosmosDBSqlDatabaseThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -95,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBSqlDatabaseThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateSqlDatabaseToAutoscale_CosmosDBSqlDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -128,7 +127,7 @@ public async Task MigrateSqlDatabaseToAutoscale_CosmosDBSqlDatabaseMigrateToAuto [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateSqlDatabaseToManualThroughput_CosmosDBSqlDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -155,89 +154,5 @@ public async Task MigrateSqlDatabaseToManualThroughput_CosmosDBSqlDatabaseMigrat // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBSqlDatabaseRetrieveThroughputDistribution - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlDatabaseRetrieveThroughputDistribution_CosmosDBSqlDatabaseRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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(new AzureLocation("placeholder"), 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}"); - } - - // CosmosDBSqlDatabaseRedistributeThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlDatabaseRedistributeThroughput_CosmosDBSqlDatabaseRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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(new AzureLocation("placeholder"), 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 459a5c101608..c222847ff175 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -55,7 +55,7 @@ public async Task Get_CosmosDBSqlRoleAssignmentGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBSqlRoleAssignmentGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -129,7 +129,7 @@ public async Task GetIfExists_CosmosDBSqlRoleAssignmentGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlRoleAssignmentCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -171,7 +171,7 @@ public async Task CreateOrUpdate_CosmosDBSqlRoleAssignmentCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlRoleAssignmentList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleAssignmentList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 a606d6e631fd..98b3c9c7a4b9 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlRoleAssignmentGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlRoleAssignmentCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -91,7 +91,7 @@ public async Task Update_CosmosDBSqlRoleAssignmentCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlRoleAssignmentDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleAssignmentDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 deff357c4900..95fab667ecfe 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -55,7 +55,7 @@ public async Task Get_CosmosDBSqlRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBSqlRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -129,7 +129,7 @@ public async Task GetIfExists_CosmosDBSqlRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -187,7 +187,7 @@ public async Task CreateOrUpdate_CosmosDBSqlRoleDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlRoleDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 2d73f0520059..cee205ef45a4 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -107,7 +107,7 @@ public async Task Update_CosmosDBSqlRoleDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlRoleDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 0dfc607543fb..278f1a178cae 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlStoredProcedureList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlStoredProcedureList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -59,7 +59,7 @@ public async Task GetAll_CosmosDBSqlStoredProcedureList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -96,7 +96,7 @@ public async Task Get_CosmosDBSqlStoredProcedureGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -129,7 +129,7 @@ public async Task Exists_CosmosDBSqlStoredProcedureGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -174,7 +174,7 @@ public async Task GetIfExists_CosmosDBSqlStoredProcedureGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlStoredProcedureCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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_CosmosDBSqlStoredProcedureResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs index 3b352a8e31f1..712ab04ff1ff 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -54,7 +54,7 @@ public async Task Get_CosmosDBSqlStoredProcedureGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlStoredProcedureCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -96,7 +96,7 @@ public async Task Update_CosmosDBSqlStoredProcedureCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlStoredProcedureDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlStoredProcedureDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 885e58ce38d6..ee2ea2b672c2 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlTriggerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlTriggerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -59,7 +59,7 @@ public async Task GetAll_CosmosDBSqlTriggerList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -96,7 +96,7 @@ public async Task Get_CosmosDBSqlTriggerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -129,7 +129,7 @@ public async Task Exists_CosmosDBSqlTriggerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -174,7 +174,7 @@ public async Task GetIfExists_CosmosDBSqlTriggerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlTriggerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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_CosmosDBSqlTriggerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs index a13b5efc2fc0..4751bb0a64ef 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -54,7 +54,7 @@ public async Task Get_CosmosDBSqlTriggerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlTriggerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -98,7 +98,7 @@ public async Task Update_CosmosDBSqlTriggerCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlTriggerDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlTriggerDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 fe3d14ea9493..e2431bc4d42c 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlUserDefinedFunctionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlUserDefinedFunctionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -59,7 +59,7 @@ public async Task GetAll_CosmosDBSqlUserDefinedFunctionList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -96,7 +96,7 @@ public async Task Get_CosmosDBSqlUserDefinedFunctionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -129,7 +129,7 @@ public async Task Exists_CosmosDBSqlUserDefinedFunctionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -174,7 +174,7 @@ public async Task GetIfExists_CosmosDBSqlUserDefinedFunctionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlUserDefinedFunctionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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_CosmosDBSqlUserDefinedFunctionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs index 8ccd232fe54f..419c1cf14b86 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -54,7 +54,7 @@ public async Task Get_CosmosDBSqlUserDefinedFunctionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlUserDefinedFunctionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -96,7 +96,7 @@ public async Task Update_CosmosDBSqlUserDefinedFunctionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlUserDefinedFunctionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 1da1f5732e9d..7603f0eafad0 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBTableList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -92,7 +92,7 @@ public async Task Get_CosmosDBTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBTableReplace() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 68d7d0226d1e..555ec45ac0b8 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBTableReplace() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -92,7 +92,7 @@ public async Task Update_CosmosDBTableReplace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBTableDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -120,7 +120,7 @@ public async Task Delete_CosmosDBTableDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveContinuousBackupInformation_CosmosDBTableCollectionBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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_CosmosDBThroughputPoolAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs deleted file mode 100644 index c602003dd2c0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.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.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBThroughputPoolAccountCollection - { - // CosmosDB ThroughputPool Account List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBThroughputPoolAccountList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json - // this example is just showing the usage of "ThroughputPoolAccounts_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 CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation and iterate over the result - await foreach (CosmosDBThroughputPoolAccountResource item in collection.GetAllAsync()) - { - // 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 - CosmosDBThroughputPoolAccountData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDB ThroughputPool Account Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBThroughputPoolAccountGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json - // this example is just showing the usage of "ThroughputPoolAccount_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation - string throughputPoolAccountName = "db1"; - CosmosDBThroughputPoolAccountResource result = await collection.GetAsync(throughputPoolAccountName); - - // 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 - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Account Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBThroughputPoolAccountGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json - // this example is just showing the usage of "ThroughputPoolAccount_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation - string throughputPoolAccountName = "db1"; - bool result = await collection.ExistsAsync(throughputPoolAccountName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDB ThroughputPool Account Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBThroughputPoolAccountGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json - // this example is just showing the usage of "ThroughputPoolAccount_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation - string throughputPoolAccountName = "db1"; - NullableResponse response = await collection.GetIfExistsAsync(throughputPoolAccountName); - CosmosDBThroughputPoolAccountResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // 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 - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDB ThroughputPool Account Create - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBThroughputPoolAccountCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json - // this example is just showing the usage of "ThroughputPoolAccount_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rg1"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation - string throughputPoolAccountName = "db1"; - CosmosDBThroughputPoolAccountData data = new CosmosDBThroughputPoolAccountData() - { - AccountResourceIdentifier = new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/"), - AccountLocation = new AzureLocation("West US"), - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, throughputPoolAccountName, data); - CosmosDBThroughputPoolAccountResource 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 - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs deleted file mode 100644 index 57f543f10b02..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBThroughputPoolAccountResource - { - // CosmosDB ThroughputPool Account Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBThroughputPoolAccountGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json - // this example is just showing the usage of "ThroughputPoolAccount_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolAccountResource created on azure - // for more information of creating CosmosDBThroughputPoolAccountResource, please refer to the document of CosmosDBThroughputPoolAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - string throughputPoolAccountName = "db1"; - ResourceIdentifier cosmosDBThroughputPoolAccountResourceId = CosmosDBThroughputPoolAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - CosmosDBThroughputPoolAccountResource cosmosDBThroughputPoolAccount = client.GetCosmosDBThroughputPoolAccountResource(cosmosDBThroughputPoolAccountResourceId); - - // invoke the operation - CosmosDBThroughputPoolAccountResource result = await cosmosDBThroughputPoolAccount.GetAsync(); - - // 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 - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Account Create - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBThroughputPoolAccountCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json - // this example is just showing the usage of "ThroughputPoolAccount_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolAccountResource created on azure - // for more information of creating CosmosDBThroughputPoolAccountResource, please refer to the document of CosmosDBThroughputPoolAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rg1"; - string throughputPoolName = "tp1"; - string throughputPoolAccountName = "db1"; - ResourceIdentifier cosmosDBThroughputPoolAccountResourceId = CosmosDBThroughputPoolAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - CosmosDBThroughputPoolAccountResource cosmosDBThroughputPoolAccount = client.GetCosmosDBThroughputPoolAccountResource(cosmosDBThroughputPoolAccountResourceId); - - // invoke the operation - CosmosDBThroughputPoolAccountData data = new CosmosDBThroughputPoolAccountData() - { - AccountResourceIdentifier = new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/"), - AccountLocation = new AzureLocation("West US"), - }; - ArmOperation lro = await cosmosDBThroughputPoolAccount.UpdateAsync(WaitUntil.Completed, data); - CosmosDBThroughputPoolAccountResource 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 - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Account Delete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_CosmosDBThroughputPoolAccountDelete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json - // this example is just showing the usage of "ThroughputPoolAccount_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolAccountResource created on azure - // for more information of creating CosmosDBThroughputPoolAccountResource, please refer to the document of CosmosDBThroughputPoolAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - string throughputPoolAccountName = "db1"; - ResourceIdentifier cosmosDBThroughputPoolAccountResourceId = CosmosDBThroughputPoolAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - CosmosDBThroughputPoolAccountResource cosmosDBThroughputPoolAccount = client.GetCosmosDBThroughputPoolAccountResource(cosmosDBThroughputPoolAccountResourceId); - - // invoke the operation - await cosmosDBThroughputPoolAccount.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs deleted file mode 100644 index e9a0d9d232b2..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBThroughputPoolCollection - { - // CosmosDB ThroughputPool List by Resource Group - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBThroughputPoolListByResourceGroup() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json - // this example is just showing the usage of "ThroughputPools_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // 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 = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation and iterate over the result - await foreach (CosmosDBThroughputPoolResource item in collection.GetAllAsync()) - { - // 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"); - } - - // CosmosDB ThroughputPool Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBThroughputPoolGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json - // this example is just showing the usage of "ThroughputPool_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // 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 = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation - string throughputPoolName = "tp1"; - CosmosDBThroughputPoolResource result = await collection.GetAsync(throughputPoolName); - - // 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 - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBThroughputPoolGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json - // this example is just showing the usage of "ThroughputPool_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // 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 = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation - string throughputPoolName = "tp1"; - bool result = await collection.ExistsAsync(throughputPoolName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDB ThroughputPool Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBThroughputPoolGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json - // this example is just showing the usage of "ThroughputPool_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // 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 = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation - string throughputPoolName = "tp1"; - NullableResponse response = await collection.GetIfExistsAsync(throughputPoolName); - CosmosDBThroughputPoolResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // 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 - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDB ThroughputPool Create - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBThroughputPoolCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json - // this example is just showing the usage of "ThroughputPool_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // 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 = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation - string throughputPoolName = "tp1"; - CosmosDBThroughputPoolData data = new CosmosDBThroughputPoolData(new AzureLocation("westus2")) - { - MaxThroughput = 10000, - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, throughputPoolName, data); - CosmosDBThroughputPoolResource 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 - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs deleted file mode 100644 index 6ca8b1424220..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBThroughputPoolResource - { - // CosmosDB ThroughputPool List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetCosmosDBThroughputPools_CosmosDBThroughputPoolList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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"); - } - - // CosmosDB ThroughputPool Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBThroughputPoolGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json - // this example is just showing the usage of "ThroughputPool_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // invoke the operation - CosmosDBThroughputPoolResource result = await cosmosDBThroughputPool.GetAsync(); - - // 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 - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Update - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBThroughputPoolUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json - // this example is just showing the usage of "ThroughputPool_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rg1"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // invoke the operation - CosmosDBThroughputPoolPatch patch = new CosmosDBThroughputPoolPatch() - { - MaxThroughput = 10000, - }; - ArmOperation lro = await cosmosDBThroughputPool.UpdateAsync(WaitUntil.Completed, patch); - CosmosDBThroughputPoolResource 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 - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Delete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_CosmosDBThroughputPoolDelete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json - // this example is just showing the usage of "ThroughputPool_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // invoke the operation - await cosmosDBThroughputPool.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} 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 760cb29aea89..3602779be9e1 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBTableThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBTableThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBTableThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -94,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBTableThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateTableToAutoscale_CosmosDBTableMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -127,7 +127,7 @@ public async Task MigrateTableToAutoscale_CosmosDBTableMigrateToAutoscale() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateTableToManualThroughput_CosmosDBTableMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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_DataTransferJobGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs deleted file mode 100644 index 1eddaa8abb53..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.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.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_DataTransferJobGetResultCollection - { - // CosmosDBDataTransferJobCreate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBDataTransferJobCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json - // this example is just showing the usage of "DataTransferJobs_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 - 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 DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation - string jobName = "j1"; - DataTransferJobGetResultCreateOrUpdateContent content = new DataTransferJobGetResultCreateOrUpdateContent(new DataTransferJobProperties(new CosmosCassandraDataTransferDataSourceSink("keyspace", "table"), new AzureBlobDataTransferDataSourceSink("blob_container") - { - EndpointUri = new Uri("https://blob.windows.net"), - })); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, jobName, content); - DataTransferJobGetResultResource 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 - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBDataTransferJobGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json - // this example is just showing the usage of "DataTransferJobs_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 - 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 DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation - string jobName = "j1"; - DataTransferJobGetResultResource result = await collection.GetAsync(jobName); - - // 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 - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBDataTransferJobGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json - // this example is just showing the usage of "DataTransferJobs_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 - 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 DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation - string jobName = "j1"; - bool result = await collection.ExistsAsync(jobName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBDataTransferJobGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBDataTransferJobGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json - // this example is just showing the usage of "DataTransferJobs_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 - 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 DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation - string jobName = "j1"; - NullableResponse response = await collection.GetIfExistsAsync(jobName); - DataTransferJobGetResultResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // 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 - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDBDataTransferJobFeed - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBDataTransferJobFeed() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json - // this example is just showing the usage of "DataTransferJobs_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 - 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 DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation and iterate over the result - await foreach (DataTransferJobGetResultResource item in collection.GetAllAsync()) - { - // 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 - DataTransferJobGetResultData 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_DataTransferJobGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs deleted file mode 100644 index a6b5a44df6ed..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.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.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_DataTransferJobGetResultResource - { - // CosmosDBDataTransferJobCreate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBDataTransferJobCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json - // this example is just showing the usage of "DataTransferJobs_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultCreateOrUpdateContent content = new DataTransferJobGetResultCreateOrUpdateContent(new DataTransferJobProperties(new CosmosCassandraDataTransferDataSourceSink("keyspace", "table"), new AzureBlobDataTransferDataSourceSink("blob_container") - { - EndpointUri = new Uri("https://blob.windows.net"), - })); - ArmOperation lro = await dataTransferJobGetResult.UpdateAsync(WaitUntil.Completed, content); - DataTransferJobGetResultResource 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 - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBDataTransferJobGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json - // this example is just showing the usage of "DataTransferJobs_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.GetAsync(); - - // 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 - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobPause - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Pause_CosmosDBDataTransferJobPause() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json - // this example is just showing the usage of "DataTransferJobs_Pause" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.PauseAsync(); - - // 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 - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobResume - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Resume_CosmosDBDataTransferJobResume() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json - // this example is just showing the usage of "DataTransferJobs_Resume" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.ResumeAsync(); - - // 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 - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobCancel - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Cancel_CosmosDBDataTransferJobCancel() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json - // this example is just showing the usage of "DataTransferJobs_Cancel" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.CancelAsync(); - - // 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 - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobComplete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Complete_CosmosDBDataTransferJobComplete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json - // this example is just showing the usage of "DataTransferJobs_Complete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "e35cc6eb-c8e3-447b-8de6-b83328cd0098"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.CompleteAsync(); - - // 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 - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs deleted file mode 100644 index 993288e3ead3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_GraphResourceGetResultCollection - { - // CosmosDBSqlDatabaseList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBSqlDatabaseList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphResourceList.json - // this example is just showing the usage of "GraphResources_ListGraphs" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 = "rgName"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation and iterate over the result - await foreach (GraphResourceGetResultResource item in collection.GetAllAsync()) - { - // 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 - GraphResourceGetResultData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBSqlDatabaseGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBSqlDatabaseGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphResourceGet.json - // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation - string graphName = "graphName"; - GraphResourceGetResultResource result = await collection.GetAsync(graphName); - - // 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 - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBSqlDatabaseGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBSqlDatabaseGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphResourceGet.json - // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation - string graphName = "graphName"; - bool result = await collection.ExistsAsync(graphName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBSqlDatabaseGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBSqlDatabaseGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphResourceGet.json - // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation - string graphName = "graphName"; - NullableResponse response = await collection.GetIfExistsAsync(graphName); - GraphResourceGetResultResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // 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 - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDBGraphCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBGraphCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json - // this example is just showing the usage of "GraphResources_CreateUpdateGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation - string graphName = "graphName"; - GraphResourceGetResultCreateOrUpdateContent content = new GraphResourceGetResultCreateOrUpdateContent(new AzureLocation("West US"), new WritableSubResource() - { - Id = new ResourceIdentifier("graphName"), - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, graphName, content); - GraphResourceGetResultResource 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 - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs deleted file mode 100644 index cfbc70237eac..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_GraphResourceGetResultResource - { - // CosmosDBSqlDatabaseGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBSqlDatabaseGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphResourceGet.json - // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 GraphResourceGetResultResource created on azure - // for more information of creating GraphResourceGetResultResource, please refer to the document of GraphResourceGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string graphName = "graphName"; - ResourceIdentifier graphResourceGetResultResourceId = GraphResourceGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, graphName); - GraphResourceGetResultResource graphResourceGetResult = client.GetGraphResourceGetResultResource(graphResourceGetResultResourceId); - - // invoke the operation - GraphResourceGetResultResource result = await graphResourceGetResult.GetAsync(); - - // 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 - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBGraphCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBGraphCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json - // this example is just showing the usage of "GraphResources_CreateUpdateGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 GraphResourceGetResultResource created on azure - // for more information of creating GraphResourceGetResultResource, please refer to the document of GraphResourceGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string graphName = "graphName"; - ResourceIdentifier graphResourceGetResultResourceId = GraphResourceGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, graphName); - GraphResourceGetResultResource graphResourceGetResult = client.GetGraphResourceGetResultResource(graphResourceGetResultResourceId); - - // invoke the operation - GraphResourceGetResultCreateOrUpdateContent content = new GraphResourceGetResultCreateOrUpdateContent(new AzureLocation("West US"), new WritableSubResource() - { - Id = new ResourceIdentifier("graphName"), - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await graphResourceGetResult.UpdateAsync(WaitUntil.Completed, content); - GraphResourceGetResultResource 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 - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBSqlDatabaseDelete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_CosmosDBSqlDatabaseDelete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphResourceDelete.json - // this example is just showing the usage of "GraphResources_DeleteGraphResource" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 GraphResourceGetResultResource created on azure - // for more information of creating GraphResourceGetResultResource, please refer to the document of GraphResourceGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string graphName = "graphName"; - ResourceIdentifier graphResourceGetResultResourceId = GraphResourceGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, graphName); - GraphResourceGetResultResource graphResourceGetResult = client.GetGraphResourceGetResultResource(graphResourceGetResultResourceId); - - // invoke the operation - await graphResourceGetResult.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} 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 063d431d50ff..884a5de89b4c 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBGremlinDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBGremlinDatabaseList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -92,7 +92,7 @@ public async Task Get_CosmosDBGremlinDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBGremlinDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBGremlinDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBGremlinDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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_GremlinDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs index 5bc7f1fbabd7..4115956457bf 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBGremlinDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBGremlinDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -92,7 +92,7 @@ public async Task Update_CosmosDBGremlinDatabaseCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBGremlinDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 2bd0a94abc93..5fa80c12bced 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBGremlinDatabaseThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBGremlinDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -94,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinDatabaseThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateGremlinDatabaseToAutoscale_CosmosDBGremlinDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -127,7 +127,7 @@ public async Task MigrateGremlinDatabaseToAutoscale_CosmosDBGremlinDatabaseMigra [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateGremlinDatabaseToManualThroughput_CosmosDBGremlinDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 f570b64c50b1..bf9625f22dd9 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBGremlinGraphList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBGremlinGraphList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -94,7 +94,7 @@ public async Task Get_CosmosDBGremlinGraphGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBGremlinGraphGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBGremlinGraphGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBGremlinGraphCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 2cd822552832..6c87f3ac27cf 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -53,7 +53,7 @@ public async Task Get_CosmosDBGremlinGraphGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBGremlinGraphCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -149,7 +149,7 @@ public async Task Update_CosmosDBGremlinGraphCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBGremlinGraphDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -178,7 +178,7 @@ public async Task Delete_CosmosDBGremlinGraphDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveContinuousBackupInformation_CosmosDBGremlinGraphBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 0cf2e88adcd6..5b60e5cea8b7 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinGraphThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -53,7 +53,7 @@ public async Task Get_CosmosDBGremlinGraphThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBGremlinGraphThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -96,7 +96,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinGraphThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateGremlinGraphToAutoscale_CosmosDBGremlinGraphMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -130,7 +130,7 @@ public async Task MigrateGremlinGraphToAutoscale_CosmosDBGremlinGraphMigrateToAu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateGremlinGraphToManualThroughput_CosmosDBGremlinGraphMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 e06a111b2be9..b24366951ad5 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBMongoDBCollectionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBMongoDBCollectionList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -94,7 +94,7 @@ public async Task Get_CosmosDBMongoDBCollectionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBMongoDBCollectionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBMongoDBCollectionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBCollectionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -219,60 +219,6 @@ public async Task CreateOrUpdate_CosmosDBMongoDBCollectionCreateUpdate() }, } }, - 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}"); - } - - // CosmosDBMongoDBCollectionRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBMongoDBCollectionRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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(), 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 016d27d2ac86..115de11d5acc 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -53,7 +53,7 @@ public async Task Get_CosmosDBMongoDBCollectionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBMongoDBCollectionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -99,57 +99,6 @@ public async Task Update_CosmosDBMongoDBCollectionCreateUpdate() }, } }, - AnalyticalStorageTtl = 500, - }) - { - 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}"); - } - - // CosmosDBMongoDBCollectionRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBMongoDBCollectionRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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(), @@ -172,7 +121,7 @@ public async Task Update_CosmosDBMongoDBCollectionRestore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBMongoDBCollectionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -196,46 +145,12 @@ public async Task Delete_CosmosDBMongoDBCollectionDelete() Console.WriteLine($"Succeeded"); } - // CosmosDBMongoDBCollectionPartitionMerge - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetMongoDBCollectionPartitionMerge_CosmosDBMongoDBCollectionPartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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}"); - } - // CosmosDBMongoDBCollectionBackupInformation [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveContinuousBackupInformation_CosmosDBMongoDBCollectionBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 a5559312aabd..146791154d28 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,104 +10,17 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Samples { public partial class Sample_MongoDBCollectionThroughputSettingResource { - // CosmosDBMongoDBCollectionRetrieveThroughputDistribution - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBContainerRetrieveThroughputDistribution_CosmosDBMongoDBCollectionRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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(new AzureLocation("placeholder"), 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}"); - } - - // CosmosDBMongoDBCollectionRedistributeThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBContainerRedistributeThroughput_CosmosDBMongoDBCollectionRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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(new AzureLocation("placeholder"), 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}"); - } - // CosmosDBMongoDBCollectionThroughputGet [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBCollectionThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -140,7 +53,7 @@ public async Task Get_CosmosDBMongoDBCollectionThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBCollectionThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -183,7 +96,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBCollectionThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateMongoDBCollectionToAutoscale_CosmosDBMongoDBCollectionMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -217,7 +130,7 @@ public async Task MigrateMongoDBCollectionToAutoscale_CosmosDBMongoDBCollectionM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateMongoDBCollectionToManualThroughput_CosmosDBMongoDBCollectionMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 f5b3a745c265..a6ee36bc5101 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBMongoDBDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBMongoDBDatabaseList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -92,7 +92,7 @@ public async Task Get_CosmosDBMongoDBDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBMongoDBDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBMongoDBDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -203,57 +203,5 @@ public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseCreateUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBMongoDBDatabaseRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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}"); - } } } 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 4e0e40328253..2ca85ea8b87a 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBMongoDBDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBMongoDBDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -87,61 +87,12 @@ public async Task Update_CosmosDBMongoDBDatabaseCreateUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // CosmosDBMongoDBDatabaseRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBMongoDBDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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}"); - } - // CosmosDBMongoDBDatabaseDelete [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBMongoDBDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -163,38 +114,5 @@ public async Task Delete_CosmosDBMongoDBDatabaseDelete() Console.WriteLine($"Succeeded"); } - - // CosmosDBMongoDBDatabasePartitionMerge - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBDatabasePartitionMerge_CosmosDBMongoDBDatabasePartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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 fe863bf412ea..7549ee0692fd 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; namespace Azure.ResourceManager.CosmosDB.Samples { @@ -21,7 +20,7 @@ public partial class Sample_MongoDBDatabaseThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -53,7 +52,7 @@ public async Task Get_CosmosDBMongoDBDatabaseThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -95,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateMongoDBDatabaseToAutoscale_CosmosDBMongoDBDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -128,7 +127,7 @@ public async Task MigrateMongoDBDatabaseToAutoscale_CosmosDBMongoDBDatabaseMigra [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateMongoDBDatabaseToManualThroughput_CosmosDBMongoDBDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -155,89 +154,5 @@ public async Task MigrateMongoDBDatabaseToManualThroughput_CosmosDBMongoDBDataba // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBMongoDBDatabaseRetrieveThroughputDistribution - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBDatabaseRetrieveThroughputDistribution_CosmosDBMongoDBDatabaseRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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(new AzureLocation("placeholder"), 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}"); - } - - // CosmosDBMongoDBDatabaseRedistributeThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBDatabaseRedistributeThroughput_CosmosDBMongoDBDatabaseRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-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(new AzureLocation("placeholder"), 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 f788fd2681a8..e9b6609fbb0d 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -55,7 +55,7 @@ public async Task Get_CosmosDBMongoRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBMongoRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -129,7 +129,7 @@ public async Task GetIfExists_CosmosDBMongoRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -193,7 +193,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBRoleDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBMongoDBRoleDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBRoleDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 d7ba2fca8081..7d008a2855bd 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBMongoRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBMongoDBRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -113,7 +113,7 @@ public async Task Update_CosmosDBMongoDBRoleDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBMongoDBRoleDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 c7bd2d7b4a07..a7eb8797ce2f 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -55,7 +55,7 @@ public async Task Get_CosmosDBMongoDBUserDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBMongoDBUserDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -129,7 +129,7 @@ public async Task GetIfExists_CosmosDBMongoDBUserDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBUserDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -181,7 +181,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBUserDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBMongoDBUserDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBUserDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 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 a966183ee14e..c1760050e72d 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBMongoDBUserDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBMongoDBUserDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -101,7 +101,7 @@ public async Task Update_CosmosDBMongoDBUserDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBMongoDBUserDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs deleted file mode 100644 index a677319312a9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.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.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_NetworkSecurityPerimeterConfigurationCollection - { - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/NetworkSecurityPerimeterConfigurationList.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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 CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = cosmosDBAccount.GetNetworkSecurityPerimeterConfigurations(); - - // invoke the operation and iterate over the result - await foreach (NetworkSecurityPerimeterConfigurationResource item in collection.GetAllAsync()) - { - // 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 - NetworkSecurityPerimeterConfigurationData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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 - 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 = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = cosmosDBAccount.GetNetworkSecurityPerimeterConfigurations(); - - // invoke the operation - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - NetworkSecurityPerimeterConfigurationResource result = await collection.GetAsync(networkSecurityPerimeterConfigurationName); - - // 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 - NetworkSecurityPerimeterConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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 - 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 = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = cosmosDBAccount.GetNetworkSecurityPerimeterConfigurations(); - - // invoke the operation - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - bool result = await collection.ExistsAsync(networkSecurityPerimeterConfigurationName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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 - 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 = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = cosmosDBAccount.GetNetworkSecurityPerimeterConfigurations(); - - // invoke the operation - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - NullableResponse response = await collection.GetIfExistsAsync(networkSecurityPerimeterConfigurationName); - NetworkSecurityPerimeterConfigurationResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // 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 - NetworkSecurityPerimeterConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs deleted file mode 100644 index c7e13d5a1c28..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.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.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_NetworkSecurityPerimeterConfigurationResource - { - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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 - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NetworkSecurityPerimeterConfigurationResource created on azure - // for more information of creating NetworkSecurityPerimeterConfigurationResource, please refer to the document of NetworkSecurityPerimeterConfigurationResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - NetworkSecurityPerimeterConfigurationResource networkSecurityPerimeterConfiguration = client.GetNetworkSecurityPerimeterConfigurationResource(networkSecurityPerimeterConfigurationResourceId); - - // invoke the operation - NetworkSecurityPerimeterConfigurationResource result = await networkSecurityPerimeterConfiguration.GetAsync(); - - // 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 - NetworkSecurityPerimeterConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // NetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Reconcile_NetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/NetworkSecurityPerimeterConfigurationReconcile.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Reconcile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 NetworkSecurityPerimeterConfigurationResource created on azure - // for more information of creating NetworkSecurityPerimeterConfigurationResource, please refer to the document of NetworkSecurityPerimeterConfigurationResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "sto8607"; - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - NetworkSecurityPerimeterConfigurationResource networkSecurityPerimeterConfiguration = client.GetNetworkSecurityPerimeterConfigurationResource(networkSecurityPerimeterConfigurationResourceId); - - // invoke the operation - await networkSecurityPerimeterConfiguration.ReconcileAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} 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 6d1df7b3fc35..904dc73b2279 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 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBRestorableDatabaseAccountList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableDatabaseAccountList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -55,7 +55,7 @@ public async Task GetAll_CosmosDBRestorableDatabaseAccountList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -89,7 +89,7 @@ public async Task Get_CosmosDBRestorableDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -119,7 +119,7 @@ public async Task Exists_CosmosDBRestorableDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 9e32a904dccf..7eadbd5bce32 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 @@ -21,7 +21,7 @@ public partial class Sample_RestorableCosmosDBAccountResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableCosmosDBAccounts_CosmosDBRestorableDatabaseAccountNoLocationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -53,7 +53,7 @@ public async Task GetRestorableCosmosDBAccounts_CosmosDBRestorableDatabaseAccoun [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -84,7 +84,7 @@ public async Task Get_CosmosDBRestorableDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableSqlDatabases_CosmosDBRestorableSqlDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableSqlDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -114,7 +114,7 @@ public async Task GetRestorableSqlDatabases_CosmosDBRestorableSqlDatabaseList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableSqlContainers_CosmosDBRestorableSqlContainerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableSqlContainerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -145,7 +145,7 @@ public async Task GetRestorableSqlContainers_CosmosDBRestorableSqlContainerList( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAllRestorableSqlResourceData_CosmosDBRestorableSqlResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableSqlResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -177,7 +177,7 @@ public async Task GetAllRestorableSqlResourceData_CosmosDBRestorableSqlResourceL [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableMongoDBDatabases_CosmosDBRestorableMongodbDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableMongodbDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -207,7 +207,7 @@ public async Task GetRestorableMongoDBDatabases_CosmosDBRestorableMongodbDatabas [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableMongoDBCollections_CosmosDBRestorableMongodbCollectionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableMongodbCollectionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -238,7 +238,7 @@ public async Task GetRestorableMongoDBCollections_CosmosDBRestorableMongodbColle [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAllRestorableMongoDBResourceData_CosmosDBRestorableMongodbResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableMongodbResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -270,7 +270,7 @@ public async Task GetAllRestorableMongoDBResourceData_CosmosDBRestorableMongodbR [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableGremlinDatabases_CosmosDBRestorableGremlinDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableGremlinDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -300,7 +300,7 @@ public async Task GetRestorableGremlinDatabases_CosmosDBRestorableGremlinDatabas [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableGremlinGraphs_CosmosDBRestorableGremlinGraphList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableGremlinGraphList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -331,7 +331,7 @@ public async Task GetRestorableGremlinGraphs_CosmosDBRestorableGremlinGraphList( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableGremlinResources_CosmosDBRestorableGremlinResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableGremlinResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -363,7 +363,7 @@ public async Task GetRestorableGremlinResources_CosmosDBRestorableGremlinResourc [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableTables_CosmosDBRestorableTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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 @@ -393,7 +393,7 @@ public async Task GetRestorableTables_CosmosDBRestorableTableList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableTableResources_CosmosDBRestorableTableResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableTableResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-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/src/Generated/ArmCosmosDBModelFactory.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs index a631690442cc..2e9ace494219 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs @@ -10,7 +10,6 @@ using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Models { @@ -25,6 +24,7 @@ public static partial class ArmCosmosDBModelFactory /// The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. + /// 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. @@ -61,23 +61,16 @@ public static partial class ArmCosmosDBModelFactory /// 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(); @@ -99,6 +92,7 @@ public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = nu tags, location, kind, + identity, provisioningState, documentEndpoint, databaseAccountOfferType, @@ -131,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); } @@ -213,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. @@ -274,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(); @@ -324,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. @@ -376,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(); @@ -410,6 +362,7 @@ public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdate tags, location, kind, + identity, consistencyPolicy, locations?.ToList(), databaseAccountOfferType, @@ -434,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); } @@ -483,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). @@ -694,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. @@ -759,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(); @@ -774,7 +655,6 @@ public static CosmosDBSqlDatabaseData CosmosDBSqlDatabaseData(ResourceIdentifier location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -811,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(); @@ -826,7 +705,6 @@ public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreate location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -838,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(); @@ -852,7 +729,6 @@ public static ThroughputSettingData ThroughputSettingData(ResourceIdentifier id tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -920,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(); @@ -934,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. @@ -987,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(); @@ -1002,7 +835,6 @@ public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifi location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1017,16 +849,17 @@ 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. /// 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, 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, string rid = null, float? timestamp = null, ETag? etag = null) { uniqueKeys ??= new List(); computedProperties ??= new List(); + vectorEmbeddings ??= new List(); return new ExtendedCosmosDBSqlContainerResourceInfo( containerName, @@ -1039,8 +872,8 @@ public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContai analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties?.ToList(), + vectorEmbeddings != null ? new VectorEmbeddingPolicy(vectorEmbeddings?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null, rid, timestamp, @@ -1060,16 +893,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. @@ -1079,9 +902,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(); @@ -1094,107 +916,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 . @@ -1205,9 +967,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(); @@ -1219,7 +980,6 @@ public static CosmosDBSqlStoredProcedureData CosmosDBSqlStoredProcedureData(Reso tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -1250,9 +1010,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(); @@ -1265,7 +1024,6 @@ public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredP location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1277,9 +1035,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(); @@ -1291,7 +1048,6 @@ public static CosmosDBSqlUserDefinedFunctionData CosmosDBSqlUserDefinedFunctionD tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -1322,9 +1078,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(); @@ -1337,7 +1092,6 @@ public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUse location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1349,9 +1103,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(); @@ -1363,7 +1116,6 @@ public static CosmosDBSqlTriggerData CosmosDBSqlTriggerData(ResourceIdentifier i tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -1398,9 +1150,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(); @@ -1413,7 +1164,6 @@ public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOr location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1426,9 +1176,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(); @@ -1441,7 +1190,6 @@ public static MongoDBDatabaseData MongoDBDatabaseData(ResourceIdentifier id = nu location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1474,9 +1222,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(); @@ -1489,7 +1236,6 @@ public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdate location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1502,9 +1248,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(); @@ -1517,7 +1262,6 @@ public static MongoDBCollectionData MongoDBCollectionData(ResourceIdentifier id location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1559,9 +1303,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(); @@ -1574,7 +1317,6 @@ public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUp location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1587,9 +1329,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(); @@ -1602,7 +1343,6 @@ public static CosmosDBTableData CosmosDBTableData(ResourceIdentifier id = null, location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1635,9 +1375,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(); @@ -1650,7 +1389,6 @@ public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateCont location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1663,9 +1401,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(); @@ -1678,7 +1415,6 @@ public static CassandraKeyspaceData CassandraKeyspaceData(ResourceIdentifier id location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1702,9 +1438,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(); @@ -1717,7 +1452,6 @@ public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUp location, resourceKeyspaceName != null ? new CassandraKeyspaceResourceInfo(resourceKeyspaceName, serializedAdditionalRawData: null) : null, options, - identity, serializedAdditionalRawData: null); } @@ -1730,9 +1464,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(); @@ -1745,7 +1478,6 @@ public static CassandraTableData CassandraTableData(ResourceIdentifier id = null location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1780,9 +1512,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(); @@ -1795,7 +1526,6 @@ public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateCo location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1808,9 +1538,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(); @@ -1823,7 +1552,6 @@ public static GremlinDatabaseData GremlinDatabaseData(ResourceIdentifier id = nu location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1856,9 +1584,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(); @@ -1871,7 +1598,6 @@ public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdate location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1884,9 +1610,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(); @@ -1899,7 +1624,6 @@ public static GremlinGraphData GremlinGraphData(ResourceIdentifier id = null, st location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1946,9 +1670,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(); @@ -1961,7 +1684,6 @@ public static GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateConten location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -2005,182 +1727,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. @@ -2217,34 +1763,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, @@ -2256,21 +1793,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); @@ -2281,9 +1812,9 @@ public static CassandraClusterProperties CassandraClusterProperties(CassandraPro /// The arguments for the command to be run. /// IP address of the cassandra host to run the command on. /// 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. + /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. /// A new instance for mocking. - public static CassandraCommandPostBody CassandraCommandPostBody(string command = null, IDictionary arguments = null, string host = null, bool? cassandraStopStart = null, bool? allowWrite = null) + public static CassandraCommandPostBody CassandraCommandPostBody(string command = null, IDictionary arguments = null, string host = null, bool? cassandraStopStart = null, bool? readwrite = null) { arguments ??= new Dictionary(); @@ -2292,7 +1823,7 @@ public static CassandraCommandPostBody CassandraCommandPostBody(string command = arguments, host, cassandraStopStart, - allowWrite, + readwrite, serializedAdditionalRawData: null); } @@ -2304,52 +1835,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. @@ -2494,9 +1979,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(); @@ -2518,7 +2002,6 @@ public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeI memoryFreeKB, memoryTotalKB, cpuUsage, - isLatestModel, serializedAdditionalRawData: null); } @@ -2581,74 +2064,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. @@ -2731,12 +2146,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(); @@ -2748,8 +2163,8 @@ public static RestorableCosmosDBAccountData RestorableCosmosDBAccountData(Resour location, accountName, createdOn, - oldestRestorableOn, deletedOn, + oldestRestorableOn, apiType, restorableLocations?.ToList(), serializedAdditionalRawData: null); @@ -2895,17 +2310,18 @@ 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. /// 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, 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, string self = null, string rid = null, float? timestamp = null, ETag? etag = null) { uniqueKeys ??= new List(); computedProperties ??= new List(); + vectorEmbeddings ??= new List(); return new RestorableSqlContainerPropertiesResourceContainer( containerName, @@ -2918,8 +2334,8 @@ public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlCon analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties?.ToList(), + vectorEmbeddings != null ? new VectorEmbeddingPolicy(vectorEmbeddings?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null, self, rid, @@ -3246,82 +2662,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. - /// 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 . /// 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 640a94800f10..cd82e4e96b7f 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string cl /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string clusterName, Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string clusterName, Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string clusterName, CancellationToken cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 f87af6a5ae7f..d5e96acdffb3 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -142,7 +141,7 @@ public virtual async Task> GetCassandraDat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -173,7 +172,7 @@ public virtual Response GetCassandraDataCenter(stri /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -213,7 +212,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +252,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -295,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -337,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -383,7 +382,7 @@ public virtual async Task> UpdateAsync(Wa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -429,7 +428,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -475,7 +474,7 @@ public virtual async Task> InvokeCommandAsy /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -508,362 +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-09-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-09-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-09-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. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCommandAsyncAsync(string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateGetCommandAsyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, commandId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => CassandraClusterCommand.DeserializeCassandraClusterCommand(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetCommandAsync", "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-09-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. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCommandAsync(string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateGetCommandAsyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, commandId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => CassandraClusterCommand.DeserializeCassandraClusterCommand(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetCommandAsync", "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-09-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-09-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-09-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-09-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-09-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-09-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. /// @@ -877,7 +520,7 @@ public virtual ArmOperation Deallocate(WaitUntil waitUntil, string xMsForceDeall /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -919,7 +562,7 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -961,7 +604,7 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -999,7 +642,7 @@ public virtual async Task> StatusAsync(Ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1037,7 +680,7 @@ public virtual Response Status(CancellationToken c /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1099,7 +742,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1161,7 +804,7 @@ public virtual Response AddTag(string key, string valu /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1218,7 +861,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1275,7 +918,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1335,7 +978,7 @@ public virtual async Task> RemoveTagAsync(str /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 79822dfe75bf..da33d48885ad 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string dataCenterName, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string dataCenterName, Can /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string dataCenterName, CancellationToken ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 274d79720380..80a9cf76b71f 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 11ba93c32cd9..9e6908848a59 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string k /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string keyspaceName, Canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string keyspaceName, Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string keyspaceName, CancellationToken canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 055f7a03a3a8..dec4f6ceba6d 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 0e60c9dc0d06..ddb606449336 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetCassandraTableAsy /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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-09-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-09-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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -288,7 +219,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -328,7 +259,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -370,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -412,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -458,7 +389,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -504,7 +435,7 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -566,7 +497,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -628,7 +559,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -685,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -742,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -802,7 +733,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 905975587231..92671f9fa1ca 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateC /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateC /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 4126174e5a1f..027ca1ef001d 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string tabl /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string tableName, Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string tableName, Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string tableName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 7e971bbf6ef6..d87fe0c0b860 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 81b6a2a88424..db36342d2361 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(Wait /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -367,7 +367,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -429,7 +429,7 @@ public virtual async Task> AddTagAsync(string k /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -491,7 +491,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -548,7 +548,7 @@ public virtual async Task> SetTagsAsync(IDictio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -605,7 +605,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -665,7 +665,7 @@ public virtual async Task> RemoveTagAsync(strin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 c128bed1924c..33413b2d5be9 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation MigrateCass /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual ArmOperation MigrateCass /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -506,7 +506,7 @@ public virtual async Task> Add /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -568,7 +568,7 @@ public virtual Response AddTag(string k /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -625,7 +625,7 @@ public virtual async Task> Set /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response SetTags(IDictio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> Rem /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 74bb135a2cb0..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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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 5bfe68e8d452..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); - 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 38f016818afa..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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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 22685a2983fa..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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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 7e83d1fc3378..76c4fae61205 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -164,7 +164,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string acc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string accountName, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string accountName, Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string accountName, CancellationToken cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 62f789c6f8c1..2b3b27e6431f 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 25ff1799a4a8..0e8a7ba8458e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs @@ -75,6 +75,7 @@ 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. + /// 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. @@ -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,6 +176,9 @@ internal CosmosDBAccountData() /// 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 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; } @@ -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 64d592b752dd..9be4ca15b5b1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs @@ -135,75 +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 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-09-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-09-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() @@ -224,7 +155,7 @@ public virtual CosmosDBSqlDatabaseCollection GetCosmosDBSqlDatabases() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -255,7 +186,7 @@ public virtual async Task> GetCosmosDBSqlD /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -293,7 +224,7 @@ public virtual CosmosDBSqlRoleDefinitionCollection GetCosmosDBSqlRoleDefinitions /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -324,7 +255,7 @@ public virtual async Task> GetCosmos /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -362,7 +293,7 @@ public virtual CosmosDBSqlRoleAssignmentCollection GetCosmosDBSqlRoleAssignments /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -393,7 +324,7 @@ public virtual async Task> GetCosmos /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -431,7 +362,7 @@ public virtual MongoDBDatabaseCollection GetMongoDBDatabases() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -462,7 +393,7 @@ public virtual async Task> GetMongoDBDatabaseA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -500,7 +431,7 @@ public virtual MongoDBRoleDefinitionCollection GetMongoDBRoleDefinitions() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -531,7 +462,7 @@ public virtual async Task> GetMongoDBRol /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -569,7 +500,7 @@ public virtual MongoDBUserDefinitionCollection GetMongoDBUserDefinitions() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -600,7 +531,7 @@ public virtual async Task> GetMongoDBUse /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -638,7 +569,7 @@ public virtual CosmosDBTableCollection GetCosmosDBTables() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -669,7 +600,7 @@ public virtual async Task> GetCosmosDBTableAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -707,7 +638,7 @@ public virtual CassandraKeyspaceCollection GetCassandraKeyspaces() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -738,7 +669,7 @@ public virtual async Task> GetCassandraKeysp /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -776,7 +707,7 @@ public virtual GremlinDatabaseCollection GetGremlinDatabases() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -807,7 +738,7 @@ public virtual async Task> GetGremlinDatabaseA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -825,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-09-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-09-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-09-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-09-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() @@ -983,7 +776,7 @@ public virtual CosmosDBPrivateEndpointConnectionCollection GetCosmosDBPrivateEnd /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1014,7 +807,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1052,7 +845,7 @@ public virtual CosmosDBPrivateLinkResourceCollection GetCosmosDBPrivateLinkResou /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1083,7 +876,7 @@ public virtual async Task> GetCosmosDBPriv /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1121,7 +914,7 @@ public virtual CosmosDBServiceCollection GetCosmosDBServices() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1152,7 +945,7 @@ public virtual async Task> GetCosmosDBServiceA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1170,75 +963,6 @@ public virtual Response GetCosmosDBService(string servi return GetCosmosDBServices().Get(serviceName, cancellationToken); } - /// 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-09-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-09-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); - } - /// /// Retrieves the properties of an existing Azure Cosmos DB database account. /// @@ -1252,7 +976,7 @@ public virtual Response GetCosmosDBChaosFaultResourc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1292,7 +1016,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1332,7 +1056,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1374,7 +1098,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1416,7 +1140,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1462,7 +1186,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1508,7 +1232,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1554,7 +1278,7 @@ public virtual async Task FailoverPriorityChangeAsync(WaitUntil wa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1600,7 +1324,7 @@ public virtual ArmOperation FailoverPriorityChange(WaitUntil waitUntil, CosmosDB /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1638,7 +1362,7 @@ public virtual async Task> GetKeysAsync(Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1676,7 +1400,7 @@ public virtual Response GetKeys(CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1705,7 +1429,7 @@ public virtual AsyncPageable GetConnectionStrin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1734,7 +1458,7 @@ public virtual Pageable GetConnectionStrings(Ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1780,7 +1504,7 @@ public virtual async Task OfflineRegionAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1826,7 +1550,7 @@ public virtual ArmOperation OfflineRegion(WaitUntil waitUntil, RegionForOnlineOf /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1872,7 +1596,7 @@ public virtual async Task OnlineRegionAsync(WaitUntil waitUntil, R /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1918,7 +1642,7 @@ public virtual ArmOperation OnlineRegion(WaitUntil waitUntil, RegionForOnlineOff /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1956,7 +1680,7 @@ public virtual async Task> GetReadOnlyK /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1994,7 +1718,7 @@ public virtual Response GetReadOnlyKeys(Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -2040,7 +1764,7 @@ public virtual async Task RegenerateKeyAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -2086,7 +1810,7 @@ public virtual ArmOperation RegenerateKey(WaitUntil waitUntil, CosmosDBAccountRe /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -2119,7 +1843,7 @@ public virtual AsyncPageable GetMetricsAsync(string filter, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -2152,7 +1876,7 @@ public virtual Pageable GetMetrics(string filter, Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -2182,7 +1906,7 @@ public virtual AsyncPageable GetUsagesAsync(string filter = n /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -2212,7 +1936,7 @@ public virtual Pageable GetUsages(string filter = null, Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -2241,7 +1965,7 @@ public virtual AsyncPageable GetMetricDefinitionsAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -2270,7 +1994,7 @@ public virtual Pageable GetMetricDefinitions(Cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2302,7 +2026,7 @@ public virtual AsyncPageable GetMetricsDatabasesAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2334,7 +2058,7 @@ public virtual Pageable GetMetricsDatabases(string databaseR /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2365,7 +2089,7 @@ public virtual AsyncPageable GetUsagesDatabasesAsync(string d /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2396,7 +2120,7 @@ public virtual Pageable GetUsagesDatabases(string databaseRid /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2426,7 +2150,7 @@ public virtual AsyncPageable GetMetricDefinitionsDatab /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2456,7 +2180,7 @@ public virtual Pageable GetMetricDefinitionsDatabases( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2490,7 +2214,7 @@ public virtual AsyncPageable GetMetricsCollectionsAsync(stri /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2524,7 +2248,7 @@ public virtual Pageable GetMetricsCollections(string databas /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2557,7 +2281,7 @@ public virtual AsyncPageable GetUsagesCollectionsAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2590,7 +2314,7 @@ public virtual Pageable GetUsagesCollections(string databaseR /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2622,7 +2346,7 @@ public virtual AsyncPageable GetMetricDefinitionsColle /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2654,7 +2378,7 @@ public virtual Pageable GetMetricDefinitionsCollection /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2690,7 +2414,7 @@ public virtual AsyncPageable GetMetricsCollectionRegionsAsyn /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2726,7 +2450,7 @@ public virtual Pageable GetMetricsCollectionRegions(string r /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2758,7 +2482,7 @@ public virtual AsyncPageable GetMetricsDatabaseAccountRegion /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2790,7 +2514,7 @@ public virtual Pageable GetMetricsDatabaseAccountRegions(str /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2824,7 +2548,7 @@ public virtual AsyncPageable GetMetricsPercentileSourc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2858,7 +2582,7 @@ public virtual Pageable GetMetricsPercentileSourceTarg /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2890,7 +2614,7 @@ public virtual AsyncPageable GetMetricsPercentileTarge /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2922,7 +2646,7 @@ public virtual Pageable GetMetricsPercentileTargets(st /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2951,7 +2675,7 @@ public virtual AsyncPageable GetMetricsPercentilesAsyn /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -2980,7 +2704,7 @@ public virtual Pageable GetMetricsPercentiles(string f /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -3016,7 +2740,7 @@ public virtual AsyncPageable GetMetricsCollectionPartitionRegio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -3052,7 +2776,7 @@ public virtual Pageable GetMetricsCollectionPartitionRegions(st /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -3086,7 +2810,7 @@ public virtual AsyncPageable GetMetricsCollectionPartitionsAsyn /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -3120,7 +2844,7 @@ public virtual Pageable GetMetricsCollectionPartitions(string d /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -3153,7 +2877,7 @@ public virtual AsyncPageable GetUsagesCollectionPartitionsAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -3186,7 +2910,7 @@ public virtual Pageable GetUsagesCollectionPartitions(string dat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -3222,7 +2946,7 @@ public virtual AsyncPageable GetMetricsPartitionKeyRangeIdsAsyn /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -3258,7 +2982,7 @@ public virtual Pageable GetMetricsPartitionKeyRangeIds(string d /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -3296,7 +3020,7 @@ public virtual AsyncPageable GetMetricsPartitionKeyRangeIdRegio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -3334,7 +3058,7 @@ public virtual Pageable GetMetricsPartitionKeyRangeIdRegions(st /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -3396,7 +3120,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -3458,7 +3182,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -3515,7 +3239,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -3572,7 +3296,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -3632,7 +3356,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 54cfbdbc10a5..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-09-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-09-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-09-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-09-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 0beb3a0065ee..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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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 aee46691413d..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); - 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 1ffedae60983..1e879e0d1160 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -106,7 +106,7 @@ public virtual async Task> GetAsync(AzureLoca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -147,7 +147,7 @@ public virtual Response Get(AzureLocation location, Ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -176,7 +176,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -205,7 +205,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -244,7 +244,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, Ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual Response Exists(AzureLocation location, CancellationToken c /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -324,7 +324,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 ca032eac77fc..7a58ed36b264 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -136,7 +136,7 @@ public virtual async Task> GetRestor /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -165,7 +165,7 @@ public virtual Response GetRestorableCosmosDB /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -205,7 +205,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 1029a98c1815..1550b2b4269f 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string pr /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 ee5547adcccf..e8e8270ab0ee 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 4c0099457614..3e2ad1b6f4cd 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 d023175eddd9..2f0578fa83c4 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string groupName, Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual async Task> ExistsAsync(string groupName, Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -298,7 +298,7 @@ public virtual Response Exists(string groupName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 20649df76135..5acc5e0bb379 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string ser /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string serviceName, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string serviceName, Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string serviceName, CancellationToken cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 bb88612c392e..bbe02533f41f 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 babb1786829b..d438c22b77d3 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string clien /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string clientEncryptionKey /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string clientEncryptionKeyName, Cancellatio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 daa684cddf80..2c9f0910eda9 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 0861eb6bba20..fba5e018cf65 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUp /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string containerName, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string containerName, Canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string containerName, CancellationToken can /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 005a2be0d125..c0dfee6ebff2 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 ee96c52f2c30..b5a4a730867b 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -149,7 +149,7 @@ public virtual async Task> GetCosmo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -187,7 +187,7 @@ public virtual CosmosDBSqlUserDefinedFunctionCollection GetCosmosDBSqlUserDefine /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual CosmosDBSqlTriggerCollection GetCosmosDBSqlTriggers() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual async Task> GetCosmosDBSqlTr /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Response GetCosmosDBSqlTrigger(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -440,7 +440,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -482,7 +482,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -528,7 +528,7 @@ public virtual async Task> UpdateAsyn /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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-09-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-09-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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -712,7 +620,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -758,7 +666,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -820,7 +728,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -882,7 +790,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -939,7 +847,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -996,7 +904,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1056,7 +964,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 750a926560a6..8db762efe0ea 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation Creat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Migra /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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-09-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-09-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-09-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-09-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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -690,7 +506,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -752,7 +568,7 @@ public virtual Response AddTag(st /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -809,7 +625,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -866,7 +682,7 @@ public virtual Response SetTags(I /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -926,7 +742,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 b98c76b1b60d..d494fb39272a 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 390dd4463fc0..79e03d7d57f0 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 ea80108e4e06..4ea2f08d6cd2 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-09-01-preview + /// 2024-11-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-09-01-preview + /// 2024-11-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-09-01-preview + /// 2024-11-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-09-01-preview + /// 2024-11-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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -288,7 +288,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -328,7 +328,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -370,7 +370,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -412,7 +412,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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-09-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-09-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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -658,7 +566,7 @@ public virtual async Task> AddTagAsync(str /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -720,7 +628,7 @@ public virtual Response AddTag(string key, string v /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -777,7 +685,7 @@ public virtual async Task> SetTagsAsync(ID /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -834,7 +742,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -894,7 +802,7 @@ public virtual async Task> RemoveTagAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 cf88ccb62c1c..1596123b5276 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Create /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Migrat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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-09-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-09-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-09-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-09-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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -689,7 +505,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -751,7 +567,7 @@ public virtual Response AddTag(str /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -808,7 +624,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -865,7 +681,7 @@ public virtual Response SetTags(ID /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -925,7 +741,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 a9c00b117078..b1a40ba7707c 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string roleAssign /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string roleAssignmentId, C /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string roleAssignmentId, CancellationToken /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 7765dafa84ee..b377067ae958 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 0418867735fa..9d2c3f3bb03a 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string roleDefini /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string roleDefinitionId, C /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string roleDefinitionId, CancellationToken /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 0ae900aa6bf9..e383d2658a30 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 ae8e1baa3842..27ded89d9c4d 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string storedPro /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Can /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationT /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string storedProcedureName /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string storedProcedureName, CancellationTok /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 2370f9e1be87..7837b19e0356 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 992bf6ac3b50..3b2a1bbfd04f 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAs /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, s /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary< /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 72e2eb383949..56bd4ab22e1b 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string triggerName, Canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string triggerName, Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string triggerName, CancellationToken cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 5a1797357e81..fdd8a2e5c500 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 99d055e1ae0b..1ddb79c0fd92 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsync(stri /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, string va /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 067dfddfd27d..19477003a3a4 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string userD /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string userDefinedFunction /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string userDefinedFunctionName, Cancellatio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 c774f7620b96..e321248262c5 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 fbe8586e1ba4..28676ac131d4 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitU /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 0317d52cbe71..51ed607eec12 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string table /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string tableName, Cancellatio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToke /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string tableName, Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string tableName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 725b45b0b7cd..6f10047d8e1e 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 b49c78e85ae9..a6ad74818704 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -150,7 +150,7 @@ public virtual async Task> GetAsync(Cancellation /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -190,7 +190,7 @@ public virtual Response Get(CancellationToken cancellatio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -232,7 +232,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -274,7 +274,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -320,7 +320,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -366,7 +366,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -412,7 +412,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -520,7 +520,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -582,7 +582,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -639,7 +639,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -696,7 +696,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -756,7 +756,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource 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 98bdf28bb60e..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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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 c7981782b019..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); - 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 aa6a307f055a..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-09-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-09-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-09-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-09-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-09-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-09-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 fbb23a85ee5d..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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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 8efb9d1add78..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); - 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 5fa7762ed6ac..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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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 68aee415dcc3..5cbbd87b71c3 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> Mi /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateTableTo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task> Mi /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateTableTo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> AddTag /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(string key, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> SetTag /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDictionar /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> Remove /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 baaba917bf4c..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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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 a698d8d2dd8e..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); - 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 903b5d365e91..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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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 70e16076ef3b..e20c9c25009a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs @@ -56,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. @@ -227,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. @@ -285,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); } /// @@ -550,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. @@ -626,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. @@ -683,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. @@ -778,63 +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 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 a collection of CosmosDBAccountResources in the ResourceGroupResource. /// @@ -865,7 +713,7 @@ public static CosmosDBAccountCollection GetCosmosDBAccounts(this ResourceGroupRe /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -903,7 +751,7 @@ public static async Task> GetCosmosDBAccountAs /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -958,7 +806,7 @@ public static CassandraClusterCollection GetCassandraClusters(this ResourceGroup /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -996,7 +844,7 @@ public static async Task> GetCassandraCluster /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1021,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-09-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-09-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. /// @@ -1144,7 +899,7 @@ public static CosmosDBLocationCollection GetCosmosDBLocations(this SubscriptionR /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1181,7 +936,7 @@ public static async Task> GetCosmosDBLocation /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1218,7 +973,7 @@ public static Response GetCosmosDBLocation(this Subscr /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1254,7 +1009,7 @@ public static AsyncPageable GetCosmosDBAccountsAsync(th /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1290,7 +1045,7 @@ public static Pageable GetCosmosDBAccounts(this Subscri /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1326,7 +1081,7 @@ public static AsyncPageable GetCassandraClustersAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1362,7 +1117,7 @@ public static Pageable GetCassandraClusters(this Subsc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1398,7 +1153,7 @@ public static AsyncPageable GetRestorableCosm /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1421,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-09-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-09-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. /// @@ -1506,7 +1189,7 @@ public static Pageable GetCosmosDBThroughputPool /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -1543,7 +1226,7 @@ public static async Task> CheckNameExistsDatabaseAccountAsync(thi /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 1670aa0fb079..46b5ff6c6c8e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs @@ -46,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. @@ -154,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. @@ -190,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. @@ -214,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. @@ -358,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. @@ -406,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. @@ -442,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. @@ -501,41 +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); - } - - /// - /// 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); - } } } 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 bcdfe208f98b..e6a299fdb62d 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetCosmosDBAccountA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -122,7 +122,7 @@ public virtual CassandraClusterCollection GetCassandraClusters() /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> GetCassandraCluste /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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-09-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-09-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 5af0f88f8f8a..0c1998dc020c 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -101,7 +97,7 @@ public virtual async Task> GetCosmosDBLocatio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -130,7 +126,7 @@ public virtual Response GetCosmosDBLocation(AzureLocat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -159,7 +155,7 @@ public virtual AsyncPageable GetCosmosDBAccountsAsync(C /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -188,7 +184,7 @@ public virtual Pageable GetCosmosDBAccounts(Cancellatio /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -217,7 +213,7 @@ public virtual AsyncPageable GetCassandraClustersAsync /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -246,7 +242,7 @@ public virtual Pageable GetCassandraClusters(Cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +271,7 @@ public virtual AsyncPageable GetRestorableCos /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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-09-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-09-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 fefb6c71f3fe..85fbe45cfb20 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -96,7 +96,7 @@ public virtual async Task> CheckNameExistsDatabaseAccountAsync(st /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 c7b6fd551623..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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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 8515677a3191..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); - 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 654b50b9231d..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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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 31043e832a94..5b4a82aff198 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string dat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 004ed6405666..48b5919c61b9 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 0fc73ab63652..f890162e7b3c 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetGremlinGraphAsync(s /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual Response GetGremlinGraph(string graphName, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -389,7 +389,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -435,7 +435,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -497,7 +497,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -559,7 +559,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -616,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -673,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -733,7 +733,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 532463ad7751..df5db1157fea 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateGre /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateGre /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 c71018e208ee..6e69fb52f947 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string graphN /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string graphName, Cancellation /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string graphName, Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string graphName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 a7c49307ed24..7eeabbf0ab90 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 b48ada959b8d..78209ea1d4a0 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -367,7 +367,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Gr /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -413,7 +413,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -459,7 +459,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -521,7 +521,7 @@ public virtual async Task> AddTagAsync(string key /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -583,7 +583,7 @@ public virtual Response AddTag(string key, string value, C /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -640,7 +640,7 @@ public virtual async Task> SetTagsAsync(IDictiona /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -697,7 +697,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -757,7 +757,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 607ec03a5e60..95ffa5e40699 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation MigrateGremli /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual ArmOperation MigrateGremli /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -506,7 +506,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -568,7 +568,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -625,7 +625,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 3ad5ec571757..9f3dddd96e94 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.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/CassandraTableThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs index 7edc805329e2..21361edbd316 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs @@ -64,7 +64,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 70a5c5bfecd8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewGetResultOperationSource.cs +++ /dev/null @@ -1,38 +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; - -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) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = CassandraViewGetResultData.DeserializeCassandraViewGetResultData(document.RootElement); - return new CassandraViewGetResultResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = CassandraViewGetResultData.DeserializeCassandraViewGetResultData(document.RootElement); - return new CassandraViewGetResultResource(_client, data); - } - } -} 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 1394eb087f80..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewThroughputSettingOperationSource.cs +++ /dev/null @@ -1,38 +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; - -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) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ThroughputSettingData.DeserializeThroughputSettingData(document.RootElement); - return new CassandraViewThroughputSettingResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ThroughputSettingData.DeserializeThroughputSettingData(document.RootElement); - return new CassandraViewThroughputSettingResource(_client, data); - } - } -} 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 f5275ba36a04..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBChaosFaultResourceOperationSource.cs +++ /dev/null @@ -1,38 +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; - -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) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = CosmosDBChaosFaultResourceData.DeserializeCosmosDBChaosFaultResourceData(document.RootElement); - return new CosmosDBChaosFaultResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = CosmosDBChaosFaultResourceData.DeserializeCosmosDBChaosFaultResourceData(document.RootElement); - return new CosmosDBChaosFaultResource(_client, data); - } - } -} 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 af9245a5fb97..f492aadeb1d3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs @@ -64,7 +64,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 0fe23f1c89bc..33bd0f9f59dd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.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/CosmosDBThroughputPoolAccountOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs deleted file mode 100644 index 30abec784760..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs +++ /dev/null @@ -1,38 +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; - -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) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(document.RootElement); - return new CosmosDBThroughputPoolAccountResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(document.RootElement); - return new CosmosDBThroughputPoolAccountResource(_client, data); - } - } -} 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 a6ce37b70457..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolOperationSource.cs +++ /dev/null @@ -1,38 +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; - -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) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(document.RootElement); - return new CosmosDBThroughputPoolResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(document.RootElement); - return new CosmosDBThroughputPoolResource(_client, data); - } - } -} 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 0e5c9833df92..3795d6f36e70 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.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/GraphResourceGetResultOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs deleted file mode 100644 index 6c63eaa3b485..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs +++ /dev/null @@ -1,38 +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; - -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) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = GraphResourceGetResultData.DeserializeGraphResourceGetResultData(document.RootElement); - return new GraphResourceGetResultResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = GraphResourceGetResultData.DeserializeGraphResourceGetResultData(document.RootElement); - return new GraphResourceGetResultResource(_client, data); - } - } -} 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 7b1093b43f5e..3edf9d05727d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.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/GremlinGraphThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs index b1f6eaa5b4bf..b67f22dee77a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs @@ -64,7 +64,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 ba0caf7dfd63..e74999f5c334 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs @@ -64,7 +64,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 4c5eab41e545..7e20cabb630a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.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/PhysicalPartitionStorageInfoCollectionOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionStorageInfoCollectionOperationSource.cs deleted file mode 100644 index e78c5f9955ed..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); - return PhysicalPartitionStorageInfoCollection.DeserializePhysicalPartitionStorageInfoCollection(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, 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 bcda0825749f..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); - return PhysicalPartitionThroughputInfoResult.DeserializePhysicalPartitionThroughputInfoResult(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, 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 0cc1c9822add..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)) - { - 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); - 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 e7c72c057924..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)) - { - 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); - 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 1c55b637ec67..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); - 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 d4f74b855192..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); - 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 612a2fd889e1..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)) - { - 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); - 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 34f1433d5c5f..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)) - { - 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); - 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 000d5f5dd78c..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)) - { - 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); - 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 8964be1de3a9..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)) - { - 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)) - { - 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); - 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 3960a57cad6f..9e4716c44cdf 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 f3a749d257b1..ed39e6271195 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/CassandraCommandPostBody.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs index 472d70f5090c..cb9fcfd2eb5a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs @@ -54,10 +54,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("cassandra-stop-start"u8); writer.WriteBooleanValue(CassandraStopStart.Value); } - if (Optional.IsDefined(AllowWrite)) + if (Optional.IsDefined(Readwrite)) { - writer.WritePropertyName("readWrite"u8); - writer.WriteBooleanValue(AllowWrite.Value); + writer.WritePropertyName("readwrite"u8); + writer.WriteBooleanValue(Readwrite.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -100,7 +100,7 @@ internal static CassandraCommandPostBody DeserializeCassandraCommandPostBody(Jso IDictionary arguments = default; string host = default; bool? cassandraStopStart = default; - bool? readWrite = default; + bool? readwrite = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -138,13 +138,13 @@ internal static CassandraCommandPostBody DeserializeCassandraCommandPostBody(Jso cassandraStopStart = property.Value.GetBoolean(); continue; } - if (property.NameEquals("readWrite"u8)) + if (property.NameEquals("readwrite"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - readWrite = property.Value.GetBoolean(); + readwrite = property.Value.GetBoolean(); continue; } if (options.Format != "W") @@ -158,7 +158,7 @@ internal static CassandraCommandPostBody DeserializeCassandraCommandPostBody(Jso arguments ?? new ChangeTrackingDictionary(), host, cassandraStopStart, - readWrite, + readwrite, serializedAdditionalRawData); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.cs index f1a30a528624..cbc35ba4c830 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.cs @@ -64,15 +64,15 @@ public CassandraCommandPostBody(string command, string host) /// The arguments for the command to be run. /// IP address of the cassandra host to run the command on. /// 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. + /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. /// Keeps track of any properties unknown to the library. - internal CassandraCommandPostBody(string command, IDictionary arguments, string host, bool? cassandraStopStart, bool? allowWrite, IDictionary serializedAdditionalRawData) + internal CassandraCommandPostBody(string command, IDictionary arguments, string host, bool? cassandraStopStart, bool? readwrite, IDictionary serializedAdditionalRawData) { Command = command; Arguments = arguments; Host = host; CassandraStopStart = cassandraStopStart; - AllowWrite = allowWrite; + Readwrite = readwrite; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -94,7 +94,7 @@ internal CassandraCommandPostBody() [WirePath("cassandra-stop-start")] public bool? CassandraStopStart { get; set; } /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. - [WirePath("readWrite")] - public bool? AllowWrite { get; set; } + [WirePath("readwrite")] + public bool? Readwrite { get; set; } } } 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 73e8526ea2ba..792da09c0234 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 f43158ba1e47..01a5b929603c 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 ff38532d3c31..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); - 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 2a0290b15fda..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); - 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 5d69dedeafce..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); - 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 1641028a48f8..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)) - { - 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); - 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 2e475f84b183..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)) - { - 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); - 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.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ChaosFaultListResponse.Serialization.cs deleted file mode 100644 index 4822dc27d2bc..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ChaosFaultListResponse.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 ChaosFaultListResponse : 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(ChaosFaultListResponse)} 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)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ChaosFaultListResponse 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(ChaosFaultListResponse)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChaosFaultListResponse(document.RootElement, options); - } - - internal static ChaosFaultListResponse DeserializeChaosFaultListResponse(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(CosmosDBChaosFaultResourceData.DeserializeCosmosDBChaosFaultResourceData(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 ChaosFaultListResponse(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(ChaosFaultListResponse)} does not support writing '{options.Format}' format."); - } - } - - ChaosFaultListResponse 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); - return DeserializeChaosFaultListResponse(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ChaosFaultListResponse)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} 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 b778484ea44c..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); - 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 ac5a45046677..f956aa260a6c 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/CosmosDBAccountPatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs index 8ee3d06654c1..2ff44055d3d9 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 8767bfca33e7..89bb9abfca37 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 377ddf33e6e0..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)) - { - 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); - 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/CosmosDBIndexingPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIndexingPolicy.Serialization.cs index 2c62b2396b35..6e6297c2c925 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIndexingPolicy.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIndexingPolicy.Serialization.cs @@ -96,6 +96,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsCollectionDefined(VectorIndexes)) + { + writer.WritePropertyName("vectorIndexes"u8); + writer.WriteStartArray(); + foreach (var item in VectorIndexes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -139,6 +149,7 @@ internal static CosmosDBIndexingPolicy DeserializeCosmosDBIndexingPolicy(JsonEle IList excludedPaths = default; IList> compositeIndexes = default; IList spatialIndexes = default; + IList vectorIndexes = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -229,6 +240,20 @@ internal static CosmosDBIndexingPolicy DeserializeCosmosDBIndexingPolicy(JsonEle spatialIndexes = array; continue; } + if (property.NameEquals("vectorIndexes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VectorIndex.DeserializeVectorIndex(item, options)); + } + vectorIndexes = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -242,6 +267,7 @@ internal static CosmosDBIndexingPolicy DeserializeCosmosDBIndexingPolicy(JsonEle excludedPaths ?? new ChangeTrackingList(), compositeIndexes ?? new ChangeTrackingList>(), spatialIndexes ?? new ChangeTrackingList(), + vectorIndexes ?? new ChangeTrackingList(), serializedAdditionalRawData); } @@ -389,6 +415,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VectorIndexes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vectorIndexes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(VectorIndexes)) + { + if (VectorIndexes.Any()) + { + builder.Append(" vectorIndexes: "); + builder.AppendLine("["); + foreach (var item in VectorIndexes) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " vectorIndexes: "); + } + builder.AppendLine(" ]"); + } + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIndexingPolicy.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIndexingPolicy.cs index c4cc69516b41..be410d11f364 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIndexingPolicy.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIndexingPolicy.cs @@ -52,6 +52,7 @@ public CosmosDBIndexingPolicy() ExcludedPaths = new ChangeTrackingList(); CompositeIndexes = new ChangeTrackingList>(); SpatialIndexes = new ChangeTrackingList(); + VectorIndexes = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -61,8 +62,9 @@ public CosmosDBIndexingPolicy() /// List of paths to exclude from indexing. /// List of composite path list. /// List of spatial specifics. + /// List of paths to include in the vector indexing. /// Keeps track of any properties unknown to the library. - internal CosmosDBIndexingPolicy(bool? isAutomatic, CosmosDBIndexingMode? indexingMode, IList includedPaths, IList excludedPaths, IList> compositeIndexes, IList spatialIndexes, IDictionary serializedAdditionalRawData) + internal CosmosDBIndexingPolicy(bool? isAutomatic, CosmosDBIndexingMode? indexingMode, IList includedPaths, IList excludedPaths, IList> compositeIndexes, IList spatialIndexes, IList vectorIndexes, IDictionary serializedAdditionalRawData) { IsAutomatic = isAutomatic; IndexingMode = indexingMode; @@ -70,6 +72,7 @@ internal CosmosDBIndexingPolicy(bool? isAutomatic, CosmosDBIndexingMode? indexin ExcludedPaths = excludedPaths; CompositeIndexes = compositeIndexes; SpatialIndexes = spatialIndexes; + VectorIndexes = vectorIndexes; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -91,5 +94,8 @@ internal CosmosDBIndexingPolicy(bool? isAutomatic, CosmosDBIndexingMode? indexin /// List of spatial specifics. [WirePath("spatialIndexes")] public IList SpatialIndexes { get; } + /// List of paths to include in the vector indexing. + [WirePath("vectorIndexes")] + public IList VectorIndexes { 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 c1d55f43b8ec..0e0adf908b4a 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 4f7aa7d91ddb..4c1c33033df7 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); @@ -98,6 +93,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(VectorEmbeddingPolicy)) + { + writer.WritePropertyName("vectorEmbeddingPolicy"u8); + writer.WriteObjectValue(VectorEmbeddingPolicy, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -145,8 +145,8 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer long? analyticalStorageTtl = default; ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; - MaterializedViewDefinition materializedViewDefinition = default; IList computedProperties = default; + VectorEmbeddingPolicy vectorEmbeddingPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -237,15 +237,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) @@ -260,6 +251,15 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer computedProperties = array; continue; } + if (property.NameEquals("vectorEmbeddingPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vectorEmbeddingPolicy = VectorEmbeddingPolicy.DeserializeVectorEmbeddingPolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -277,8 +277,8 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties ?? new ChangeTrackingList(), + vectorEmbeddingPolicy, serializedAdditionalRawData); } @@ -454,21 +454,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) { @@ -492,6 +477,24 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("VectorEmbeddings", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vectorEmbeddingPolicy: "); + builder.AppendLine("{"); + builder.Append(" vectorEmbeddings: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(VectorEmbeddingPolicy)) + { + builder.Append(" vectorEmbeddingPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, VectorEmbeddingPolicy, options, 2, false, " vectorEmbeddingPolicy: "); + } + } + 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 cc6c3aeda029..c75a793caca4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs @@ -67,10 +67,10 @@ 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. /// 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, 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, IDictionary serializedAdditionalRawData) { ContainerName = containerName; IndexingPolicy = indexingPolicy; @@ -82,8 +82,8 @@ internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexing AnalyticalStorageTtl = analyticalStorageTtl; RestoreParameters = restoreParameters; CreateMode = createMode; - MaterializedViewDefinition = materializedViewDefinition; ComputedProperties = computedProperties; + VectorEmbeddingPolicy = vectorEmbeddingPolicy; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -133,11 +133,21 @@ 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; } + /// The vector embedding policy for the container. + internal VectorEmbeddingPolicy VectorEmbeddingPolicy { get; set; } + /// List of vector embeddings. + [WirePath("vectorEmbeddingPolicy.vectorEmbeddings")] + public IList VectorEmbeddings + { + get + { + if (VectorEmbeddingPolicy is null) + VectorEmbeddingPolicy = new VectorEmbeddingPolicy(); + return VectorEmbeddingPolicy.VectorEmbeddings; + } + } } } 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 c9c7f75a0256..8f94ab71b8f9 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 010ff04e75ce..7860aeac282d 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 0889346fce9f..599f3cae446a 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 1277f2d17212..d3b586fc3758 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 e7c14dbdad35..b8de0658e3e9 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/CosmosDBThroughputPoolPatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs deleted file mode 100644 index d497a35295af..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)) - { - 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); - 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 e4b057c968d6..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); - 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 f3499a64b042..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); - 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 936d74518638..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); - 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 731f4c748ebc..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)) - { - 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); - 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 1e5df3f842d4..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)) - { - 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); - 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 0312847163d9..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); - 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 d6aca8c77df2..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)) - { - 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); - 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 e68a0886038e..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)) - { - 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); - 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/DistanceFunction.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DistanceFunction.cs new file mode 100644 index 000000000000..b21a7cda419f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DistanceFunction.cs @@ -0,0 +1,54 @@ +// 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 distance function to use for distance calculation in between vectors. + public readonly partial struct DistanceFunction : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DistanceFunction(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EuclideanValue = "euclidean"; + private const string CosineValue = "cosine"; + private const string DotproductValue = "dotproduct"; + + /// euclidean. + public static DistanceFunction Euclidean { get; } = new DistanceFunction(EuclideanValue); + /// cosine. + public static DistanceFunction Cosine { get; } = new DistanceFunction(CosineValue); + /// dotproduct. + public static DistanceFunction Dotproduct { get; } = new DistanceFunction(DotproductValue); + /// Determines if two values are the same. + public static bool operator ==(DistanceFunction left, DistanceFunction right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DistanceFunction left, DistanceFunction right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DistanceFunction(string value) => new DistanceFunction(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DistanceFunction other && Equals(other); + /// + public bool Equals(DistanceFunction 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/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 0f9778faa975..a9f165a4fb42 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,8 +87,8 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm long? analyticalStorageTtl = default; ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; - MaterializedViewDefinition materializedViewDefinition = default; IList computedProperties = default; + VectorEmbeddingPolicy vectorEmbeddingPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -202,15 +202,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) @@ -225,6 +216,15 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm computedProperties = array; continue; } + if (property.NameEquals("vectorEmbeddingPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vectorEmbeddingPolicy = VectorEmbeddingPolicy.DeserializeVectorEmbeddingPolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -242,8 +242,8 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties ?? new ChangeTrackingList(), + vectorEmbeddingPolicy, serializedAdditionalRawData, rid, ts, @@ -475,21 +475,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) { @@ -513,6 +498,24 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("VectorEmbeddings", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vectorEmbeddingPolicy: "); + builder.AppendLine("{"); + builder.Append(" vectorEmbeddings: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(VectorEmbeddingPolicy)) + { + builder.Append(" vectorEmbeddingPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, VectorEmbeddingPolicy, options, 2, false, " vectorEmbeddingPolicy: "); + } + } + 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 29bd68e82d12..6941114010bc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs @@ -32,13 +32,13 @@ 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. /// 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, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, computedProperties, 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, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, computedProperties, vectorEmbeddingPolicy, serializedAdditionalRawData) { Rid = rid; Timestamp = timestamp; 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 e0554e345682..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); - 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 5df884e44ffe..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); - 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 6b51f9f2fdc9..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)) - { - 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); - 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/GraphResourcesListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.cs deleted file mode 100644 index 960002eccee0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.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 Graph resource and their properties. - internal partial class GraphResourcesListResult - { - /// - /// 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 GraphResourcesListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of Graph resource and their properties. - /// Keeps track of any properties unknown to the library. - internal GraphResourcesListResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of Graph resource and their properties. - public IReadOnlyList Value { get; } - } -} 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 2e5a328b4e78..cc6ba436b017 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 a0463bcb3150..0f2b70b36adf 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.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/MaterializedViewDefinition.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs deleted file mode 100644 index 148961a3057c..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)) - { - 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); - 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 7fa43a5cb630..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)) - { - 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); - 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 1e351718f51f..4f72f45682af 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 8162fefb6832..bd4e2e363764 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.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 acb5696a8a4f..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)) - { - 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); - 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 b1496c4bc2fa..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)) - { - 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); - 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 20f069e4e726..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)) - { - 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); - 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 52dbfc4bbbd5..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)) - { - 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); - 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 1b0f7165cb74..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)) - { - 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); - 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 7617b7fe0d1f..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)) - { - 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); - 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 553f257c5f4d..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)) - { - 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); - 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 7b9e1a2647c0..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); - 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 a0e69f10f0cf..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); - 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 aa914b1111ff..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)) - { - 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); - 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 735be1d4d631..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)) - { - 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); - 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 a4a4c684ba24..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); - 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 17861718e332..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)) - { - 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); - 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 7820540e1995..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)) - { - 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); - 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 46c8a6f24449..63a984cdf7fc 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,8 +93,8 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes long? analyticalStorageTtl = default; ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; - MaterializedViewDefinition materializedViewDefinition = default; IList computedProperties = default; + VectorEmbeddingPolicy vectorEmbeddingPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -213,15 +213,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) @@ -236,6 +227,15 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes computedProperties = array; continue; } + if (property.NameEquals("vectorEmbeddingPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vectorEmbeddingPolicy = VectorEmbeddingPolicy.DeserializeVectorEmbeddingPolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -253,8 +253,8 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties ?? new ChangeTrackingList(), + vectorEmbeddingPolicy, serializedAdditionalRawData, self, rid, @@ -510,21 +510,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) { @@ -548,6 +533,24 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("VectorEmbeddings", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vectorEmbeddingPolicy: "); + builder.AppendLine("{"); + builder.Append(" vectorEmbeddings: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(VectorEmbeddingPolicy)) + { + builder.Append(" vectorEmbeddingPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, VectorEmbeddingPolicy, options, 2, false, " vectorEmbeddingPolicy: "); + } + } + 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 4c8b5028942d..5b6cb3c56c38 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs @@ -32,14 +32,14 @@ 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. /// 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, IDictionary serializedAdditionalRawData, string self, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, computedProperties, 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, IDictionary serializedAdditionalRawData, string self, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, computedProperties, vectorEmbeddingPolicy, 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 8d2ddb933b04..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); - 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 ed27bbbe0a62..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)) - { - 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); - 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/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 b60e6244e0d4..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)) - { - 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); - 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 0c937569e3a3..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)) - { - 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); - 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/ThroughputSettingsUpdateData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs index c0731217dcc3..3fab806494b9 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 635af56d9427..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); - 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/Models/VectorDataType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorDataType.cs new file mode 100644 index 000000000000..747fae1ee3b6 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorDataType.cs @@ -0,0 +1,54 @@ +// 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 data type of vector. + public readonly partial struct VectorDataType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorDataType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Float32Value = "float32"; + private const string Uint8Value = "uint8"; + private const string Int8Value = "int8"; + + /// float32. + public static VectorDataType Float32 { get; } = new VectorDataType(Float32Value); + /// uint8. + public static VectorDataType Uint8 { get; } = new VectorDataType(Uint8Value); + /// int8. + public static VectorDataType Int8 { get; } = new VectorDataType(Int8Value); + /// Determines if two values are the same. + public static bool operator ==(VectorDataType left, VectorDataType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorDataType left, VectorDataType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorDataType(string value) => new VectorDataType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorDataType other && Equals(other); + /// + public bool Equals(VectorDataType 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/NetworkSecurityPerimeter.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorEmbedding.Serialization.cs similarity index 53% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs rename to sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorEmbedding.Serialization.cs index 2201730376fe..b617de248553 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorEmbedding.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.CosmosDB.Models { - public partial class NetworkSecurityPerimeter : IUtf8JsonSerializable, IJsonModel + public partial class VectorEmbedding : 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); @@ -29,27 +29,20 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// 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(NetworkSecurityPerimeter)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(VectorEmbedding)} 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); - } + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + writer.WritePropertyName("dataType"u8); + writer.WriteStringValue(DataType.ToString()); + writer.WritePropertyName("distanceFunction"u8); + writer.WriteStringValue(DistanceFunction.ToString()); + writer.WritePropertyName("dimensions"u8); + writer.WriteNumberValue(Dimensions); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -67,19 +60,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NetworkSecurityPerimeter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + VectorEmbedding 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(NetworkSecurityPerimeter)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(VectorEmbedding)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeter(document.RootElement, options); + return DeserializeVectorEmbedding(document.RootElement, options); } - internal static NetworkSecurityPerimeter DeserializeNetworkSecurityPerimeter(JsonElement element, ModelReaderWriterOptions options = null) + internal static VectorEmbedding DeserializeVectorEmbedding(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,38 +80,32 @@ internal static NetworkSecurityPerimeter DeserializeNetworkSecurityPerimeter(Jso { return null; } - ResourceIdentifier id = default; - Guid? perimeterGuid = default; - AzureLocation? location = default; + string path = default; + VectorDataType dataType = default; + DistanceFunction distanceFunction = default; + int dimensions = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (property.NameEquals("path"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - id = new ResourceIdentifier(property.Value.GetString()); + path = property.Value.GetString(); continue; } - if (property.NameEquals("perimeterGuid"u8)) + if (property.NameEquals("dataType"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - perimeterGuid = property.Value.GetGuid(); + dataType = new VectorDataType(property.Value.GetString()); continue; } - if (property.NameEquals("location"u8)) + if (property.NameEquals("distanceFunction"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + distanceFunction = new DistanceFunction(property.Value.GetString()); + continue; + } + if (property.NameEquals("dimensions"u8)) + { + dimensions = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -127,7 +114,7 @@ internal static NetworkSecurityPerimeter DeserializeNetworkSecurityPerimeter(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeter(id, perimeterGuid, location, serializedAdditionalRawData); + return new VectorEmbedding(path, dataType, distanceFunction, dimensions, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -141,58 +128,72 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Path), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" id: "); + builder.Append(" path: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(Id)) + if (Optional.IsDefined(Path)) { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); + builder.Append(" path: "); + if (Path.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Path}'''"); + } + else + { + builder.AppendLine($"'{Path}'"); + } } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PerimeterGuid), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DataType), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" perimeterGuid: "); + builder.Append(" dataType: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(PerimeterGuid)) - { - builder.Append(" perimeterGuid: "); - builder.AppendLine($"'{PerimeterGuid.Value.ToString()}'"); - } + builder.Append(" dataType: "); + builder.AppendLine($"'{DataType.ToString()}'"); } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DistanceFunction), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" location: "); + builder.Append(" distanceFunction: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(Location)) - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.Value.ToString()}'"); - } + builder.Append(" distanceFunction: "); + builder.AppendLine($"'{DistanceFunction.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Dimensions), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" dimensions: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" dimensions: "); + builder.AppendLine($"{Dimensions}"); } builder.AppendLine("}"); 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) { @@ -201,26 +202,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(VectorEmbedding)} does not support writing '{options.Format}' format."); } } - NetworkSecurityPerimeter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + VectorEmbedding 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); - return DeserializeNetworkSecurityPerimeter(document.RootElement, options); + return DeserializeVectorEmbedding(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(VectorEmbedding)} 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/VectorEmbedding.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorEmbedding.cs new file mode 100644 index 000000000000..30972a0caac3 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorEmbedding.cs @@ -0,0 +1,97 @@ +// 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 vector embedding. A vector embedding is used to define a vector field in the documents. + public partial class VectorEmbedding + { + /// + /// 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 path to the vector field in the document. + /// Indicates the data type of vector. + /// The distance function to use for distance calculation in between vectors. + /// The number of dimensions in the vector. + /// is null. + public VectorEmbedding(string path, VectorDataType dataType, DistanceFunction distanceFunction, int dimensions) + { + Argument.AssertNotNull(path, nameof(path)); + + Path = path; + DataType = dataType; + DistanceFunction = distanceFunction; + Dimensions = dimensions; + } + + /// Initializes a new instance of . + /// The path to the vector field in the document. + /// Indicates the data type of vector. + /// The distance function to use for distance calculation in between vectors. + /// The number of dimensions in the vector. + /// Keeps track of any properties unknown to the library. + internal VectorEmbedding(string path, VectorDataType dataType, DistanceFunction distanceFunction, int dimensions, IDictionary serializedAdditionalRawData) + { + Path = path; + DataType = dataType; + DistanceFunction = distanceFunction; + Dimensions = dimensions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VectorEmbedding() + { + } + + /// The path to the vector field in the document. + [WirePath("path")] + public string Path { get; set; } + /// Indicates the data type of vector. + [WirePath("dataType")] + public VectorDataType DataType { get; set; } + /// The distance function to use for distance calculation in between vectors. + [WirePath("distanceFunction")] + public DistanceFunction DistanceFunction { get; set; } + /// The number of dimensions in the vector. + [WirePath("dimensions")] + public int Dimensions { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorEmbeddingPolicy.Serialization.cs similarity index 62% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs rename to sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorEmbeddingPolicy.Serialization.cs index fefeb5ec9e88..dbaf0601df12 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorEmbeddingPolicy.Serialization.cs @@ -15,11 +15,11 @@ namespace Azure.ResourceManager.CosmosDB.Models { - internal partial class ListCommands : IUtf8JsonSerializable, IJsonModel + internal partial class VectorEmbeddingPolicy : 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,17 +30,17 @@ 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(VectorEmbeddingPolicy)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + if (Optional.IsCollectionDefined(VectorEmbeddings)) { - writer.WritePropertyName("value"u8); + writer.WritePropertyName("vectorEmbeddings"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (var item in VectorEmbeddings) { writer.WriteObjectValue(item, options); } @@ -63,19 +63,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ListCommands IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + VectorEmbeddingPolicy 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(VectorEmbeddingPolicy)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeListCommands(document.RootElement, options); + return DeserializeVectorEmbeddingPolicy(document.RootElement, options); } - internal static ListCommands DeserializeListCommands(JsonElement element, ModelReaderWriterOptions options = null) + internal static VectorEmbeddingPolicy DeserializeVectorEmbeddingPolicy(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,23 +83,23 @@ internal static ListCommands DeserializeListCommands(JsonElement element, ModelR { return null; } - IReadOnlyList value = default; + IList vectorEmbeddings = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (property.NameEquals("vectorEmbeddings"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(CassandraClusterCommand.DeserializeCassandraClusterCommand(item, options)); + array.Add(VectorEmbedding.DeserializeVectorEmbedding(item, options)); } - value = array; + vectorEmbeddings = array; continue; } if (options.Format != "W") @@ -108,7 +108,7 @@ internal static ListCommands DeserializeListCommands(JsonElement element, ModelR } } serializedAdditionalRawData = rawDataDictionary; - return new ListCommands(value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new VectorEmbeddingPolicy(vectorEmbeddings ?? new ChangeTrackingList(), serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -122,23 +122,23 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VectorEmbeddings), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" value: "); + builder.Append(" vectorEmbeddings: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsCollectionDefined(Value)) + if (Optional.IsCollectionDefined(VectorEmbeddings)) { - if (Value.Any()) + if (VectorEmbeddings.Any()) { - builder.Append(" value: "); + builder.Append(" vectorEmbeddings: "); builder.AppendLine("["); - foreach (var item in Value) + foreach (var item in VectorEmbeddings) { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " vectorEmbeddings: "); } builder.AppendLine(" ]"); } @@ -149,9 +149,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 +160,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(VectorEmbeddingPolicy)} does not support writing '{options.Format}' format."); } } - ListCommands IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + VectorEmbeddingPolicy 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); - return DeserializeListCommands(document.RootElement, options); + return DeserializeVectorEmbeddingPolicy(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ListCommands)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(VectorEmbeddingPolicy)} 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/ListCommands.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorEmbeddingPolicy.cs similarity index 68% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs rename to sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorEmbeddingPolicy.cs index d8d7eb6149b8..6b195f68fb82 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorEmbeddingPolicy.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// List of commands for cluster. - internal partial class ListCommands + /// Cosmos DB Vector Embedding Policy. + internal partial class VectorEmbeddingPolicy { /// /// Keeps track of any properties unknown to the library. @@ -45,23 +45,23 @@ internal partial class ListCommands /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ListCommands() + /// Initializes a new instance of . + public VectorEmbeddingPolicy() { - Value = new ChangeTrackingList(); + VectorEmbeddings = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// Container for array of commands. + /// Initializes a new instance of . + /// List of vector embeddings. /// Keeps track of any properties unknown to the library. - internal ListCommands(IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal VectorEmbeddingPolicy(IList vectorEmbeddings, IDictionary serializedAdditionalRawData) { - Value = value; + VectorEmbeddings = vectorEmbeddings; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Container for array of commands. - [WirePath("value")] - public IReadOnlyList Value { get; } + /// List of vector embeddings. + [WirePath("vectorEmbeddings")] + public IList VectorEmbeddings { get; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorIndex.Serialization.cs similarity index 61% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs rename to sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorIndex.Serialization.cs index cb17f48f0c1c..4351fdb75af7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorIndex.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 ListBackups : IUtf8JsonSerializable, IJsonModel + public partial class VectorIndex : 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,22 +29,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio /// 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(ListBackups)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(VectorIndex)} 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(); - } + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(IndexType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -63,19 +56,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ListBackups IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + VectorIndex 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(ListBackups)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(VectorIndex)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeListBackups(document.RootElement, options); + return DeserializeVectorIndex(document.RootElement, options); } - internal static ListBackups DeserializeListBackups(JsonElement element, ModelReaderWriterOptions options = null) + internal static VectorIndex DeserializeVectorIndex(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,23 +76,20 @@ internal static ListBackups DeserializeListBackups(JsonElement element, ModelRea { return null; } - IReadOnlyList value = default; + string path = default; + VectorIndexType type = 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(CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(item, options)); - } - value = array; + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new VectorIndexType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -108,7 +98,7 @@ internal static ListBackups DeserializeListBackups(JsonElement element, ModelRea } } serializedAdditionalRawData = rawDataDictionary; - return new ListBackups(value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new VectorIndex(path, type, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -122,36 +112,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.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); + builder.AppendLine("'''"); + builder.AppendLine($"{Path}'''"); + } + else + { + builder.AppendLine($"'{Path}'"); } } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IndexType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" type: "); + builder.AppendLine($"'{IndexType.ToString()}'"); + } + builder.AppendLine("}"); 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 +162,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ListBackups)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(VectorIndex)} does not support writing '{options.Format}' format."); } } - ListBackups IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + VectorIndex 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); - return DeserializeListBackups(document.RootElement, options); + return DeserializeVectorIndex(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ListBackups)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(VectorIndex)} 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/VectorIndex.cs similarity index 54% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs rename to sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorIndex.cs index 966c4d6682bb..b7b69b17eab5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorIndex.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// PhysicalPartitionThroughputInfo object. - public partial class PhysicalPartitionThroughputInfoResource + /// The VectorIndex. + public partial class VectorIndex { /// /// Keeps track of any properties unknown to the library. @@ -45,37 +45,39 @@ 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 vector field in the document. + /// The index type of the vector. Currently, flat, diskANN, and quantizedFlat are supported. + /// is null. + public VectorIndex(string path, VectorIndexType indexType) { - Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(path, nameof(path)); - Id = id; + Path = path; + IndexType = indexType; } - /// Initializes a new instance of . - /// Id of a physical partition. - /// Throughput of a physical partition. + /// Initializes a new instance of . + /// The path to the vector field in the document. + /// The index type of the vector. Currently, flat, diskANN, and quantizedFlat are supported. /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoResource(string id, double? throughput, IDictionary serializedAdditionalRawData) + internal VectorIndex(string path, VectorIndexType indexType, IDictionary serializedAdditionalRawData) { - Id = id; - Throughput = throughput; + Path = path; + IndexType = indexType; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal PhysicalPartitionThroughputInfoResource() + /// Initializes a new instance of for deserialization. + internal VectorIndex() { } - /// 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 vector field in the document. + [WirePath("path")] + public string Path { get; set; } + /// The index type of the vector. Currently, flat, diskANN, and quantizedFlat are supported. + [WirePath("type")] + public VectorIndexType IndexType { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorIndexType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorIndexType.cs new file mode 100644 index 000000000000..29889773dea3 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/VectorIndexType.cs @@ -0,0 +1,54 @@ +// 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 index type of the vector. Currently, flat, diskANN, and quantizedFlat are supported. + public readonly partial struct VectorIndexType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorIndexType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FlatValue = "flat"; + private const string DiskANNValue = "diskANN"; + private const string QuantizedFlatValue = "quantizedFlat"; + + /// flat. + public static VectorIndexType Flat { get; } = new VectorIndexType(FlatValue); + /// diskANN. + public static VectorIndexType DiskANN { get; } = new VectorIndexType(DiskANNValue); + /// quantizedFlat. + public static VectorIndexType QuantizedFlat { get; } = new VectorIndexType(QuantizedFlatValue); + /// Determines if two values are the same. + public static bool operator ==(VectorIndexType left, VectorIndexType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorIndexType left, VectorIndexType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorIndexType(string value) => new VectorIndexType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorIndexType other && Equals(other); + /// + public bool Equals(VectorIndexType 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/MongoDBCollectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs index a43dda8726a8..6b9c4a4aff4f 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string c /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string collectionName, Ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string collectionName, Can /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string collectionName, CancellationToken ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 846659064c3f..c4bafa398fa5 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 e15fdf54132d..7300cc5c3570 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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-09-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-09-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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -505,7 +413,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -551,7 +459,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -613,7 +521,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -675,7 +583,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -732,7 +640,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -789,7 +697,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -849,7 +757,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 e4c562d3c089..0a218ee08b92 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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-09-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-09-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-09-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-09-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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -502,7 +318,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -544,7 +360,7 @@ public virtual ArmOperation MigrateM /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -586,7 +402,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -628,7 +444,7 @@ public virtual ArmOperation MigrateM /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -690,7 +506,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -752,7 +568,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -809,7 +625,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -866,7 +682,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -926,7 +742,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 120207d4d84f..173a5e9e65b4 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string dat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 b18cdee8f97f..a1998e11dfe5 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 3fb4e0e4a1cd..896de9c85478 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetMongoDBCollect /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual Response GetMongoDBCollection(string c /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -389,7 +389,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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-09-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-09-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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -589,7 +497,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -651,7 +559,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -708,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -765,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -825,7 +733,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 95e9458656cc..4ba8b808864e 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateMon /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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-09-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-09-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-09-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-09-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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -689,7 +505,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -751,7 +567,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -808,7 +624,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -865,7 +681,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -925,7 +741,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 cb4494836f1f..63a30c70067b 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mongoRoleDefin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string mongoRoleDefinition /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string mongoRoleDefinitionId, CancellationT /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 349883e033e9..bff898a2bebf 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 3e007c3104e7..a0b064c28bf1 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mongoUserDefin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string mongoUserDefinition /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string mongoUserDefinitionId, CancellationT /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 2a19105198e7..4468316e23e8 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 5e8ee17aeeaa..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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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 a86383273c50..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); - 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 8ab5a7a61393..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-09-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-09-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-09-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-09-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 373c508e7ef6..3228f97a9ee2 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -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 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, default, 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 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); - 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 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: - { - ListCommands value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ListCommands.DeserializeListCommands(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 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: - { - ListCommands value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ListCommands.DeserializeListCommands(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 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, default, 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 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); - 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 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, default, 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 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); - 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,10 +687,6 @@ 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; @@ -1088,17 +696,16 @@ internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resou /// 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) { @@ -1113,17 +720,16 @@ public async Task DeallocateAsync(string subscriptionId, string resour /// 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) { 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 63676f5bf42f..c094e33c387c 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 48c801f088f1..cb18745dd4eb 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -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 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, default, 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 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); - 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 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, default, 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 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); - 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 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 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 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 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 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, default, 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 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); - 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 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 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 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 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 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 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 77f0bcba6cb5..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-09-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 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, default, 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 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); - 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 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 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 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, default, 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 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); - 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 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, default, 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 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); - 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 5b24a4e443fd..1388f29eb9d1 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 e6a8c2abc28c..16653cbf2a6d 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 3c72698c4763..8150f6fa27b8 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 c05dbc8aa78f..bbf77994265b 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 e363a25b8393..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-09-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 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, default, 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 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); - 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 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, default, 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 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); - 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 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, default, 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 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); - 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 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, default, 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 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); - 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 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, default, 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 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); - 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 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, default, 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 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); - 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 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, default, 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 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); - 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 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, default, 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 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); - 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 1bdabe1252de..79a148984ca1 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 1d6596214688..47b5dfc91896 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 72a9a33d3d62..e2c2bc9414fd 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 52a2d2263166..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-09-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 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, default, 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 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); - 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 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, default, 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 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); - 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 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 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 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 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 c3fd061a83cd..40b7045b734e 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 d8b27107ea1d..6513d90111c1 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 54ac2b58baf8..e86c6cd05558 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -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 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 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 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 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 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 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 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 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(); @@ -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 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 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 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 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(); 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 6721b602a40e..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-09-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 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, default, 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 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); - 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 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, default, 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 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); - 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 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 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 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, default, 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 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); - 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 40badf1f79bd..cc5674239302 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 cf913a78ce86..160553e8dc35 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 dbc44a10b763..cfd158347f9b 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 69c3c9f5a0b1..767b264c29dd 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 edfc03cab34a..b2bb1421dd51 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 c784b7864559..1446864e2432 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 f062f534db40..677d08ce454c 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 1edf60c237f7..81a7f886b120 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 24bbf69bd243..cd249101e371 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 3e92f390208d..01e0266feeda 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 b9039feb634e..f6f8f63be244 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 21f6b5d65077..1062e9947c46 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 7cf2f47a9eaf..4569c1fe6588 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 949d2f910461..bebf2c9ff247 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 540025172ff1..fbe040e9cdb4 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 32439715f14c..45ee7cc32141 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 53d3f3dbe3ba..951564093e73 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 c51e2667ca7d..bdae7da87a13 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 7cbf96aa45e9..f1affb795441 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 d927cb5edf47..5db447f80f23 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 a23c98cb28fc..9ee1481bc318 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -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 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, default, 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 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); - 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 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, default, 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 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); - 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 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 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(); @@ -1397,235 +1075,32 @@ internal HttpMessage CreateCreateUpdateSqlContainerRequest(string subscriptionId 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 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 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 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 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; + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Merges the partitions of a SQL database. + /// 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. + /// 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. + /// 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. + /// 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); @@ -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 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 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. + /// 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, default, 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. + /// 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); + 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. + /// 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, default, 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. + /// 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); + 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. + /// 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. + /// 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) { 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 fb63f63e9cf4..ba8ebce68b9b 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-09-01-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 b224eb2a0deb..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-09-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 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, default, 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 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); - 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 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 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 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 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 0fafcaebdacd..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-09-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 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, default, 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 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); - 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 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, default, 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 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); - 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 79f41b1f0d50..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-09-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 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, default, 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 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); - 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 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 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 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 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 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 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 a84f3b027136..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-09-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 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, default, 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 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); - 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 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, default, 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 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); - 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 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, default, 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 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); - 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 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, default, 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 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); - 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 477f4daa796c..8ebb481b87a0 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -105,7 +105,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(Guid instanceId, /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -175,7 +175,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -204,7 +204,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -243,7 +243,7 @@ public virtual async Task> ExistsAsync(Guid instanceId, Cancellat /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual Response Exists(Guid instanceId, CancellationToken cancella /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -323,7 +323,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 0de995a52723..66759c53ec1a 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 686eeb305a11..ce22235cdae2 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-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -186,7 +186,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -251,7 +251,7 @@ public virtual AsyncPageable GetRestorableSqlDatabasesAsy /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -276,7 +276,7 @@ public virtual Pageable GetRestorableSqlDatabases(Cancell /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -304,7 +304,7 @@ public virtual AsyncPageable GetRestorableSqlContainersA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -332,7 +332,7 @@ public virtual Pageable GetRestorableSqlContainers(strin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -359,7 +359,7 @@ public virtual AsyncPageable GetAllRestorableSqlResou /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -386,7 +386,7 @@ public virtual Pageable GetAllRestorableSqlResourceDa /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -411,7 +411,7 @@ public virtual AsyncPageable GetRestorableMongoDBData /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -436,7 +436,7 @@ public virtual Pageable GetRestorableMongoDBDatabases /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -464,7 +464,7 @@ public virtual AsyncPageable GetRestorableMongoDBCo /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -492,7 +492,7 @@ public virtual Pageable GetRestorableMongoDBCollect /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -519,7 +519,7 @@ public virtual AsyncPageable GetAllRestorableMong /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -546,7 +546,7 @@ public virtual Pageable GetAllRestorableMongoDBRe /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -571,7 +571,7 @@ public virtual AsyncPageable GetRestorableGremlinData /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -596,7 +596,7 @@ public virtual Pageable GetRestorableGremlinDatabases /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -624,7 +624,7 @@ public virtual AsyncPageable GetRestorableGremlinGraphsA /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -652,7 +652,7 @@ public virtual Pageable GetRestorableGremlinGraphs(strin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -679,7 +679,7 @@ public virtual AsyncPageable GetRestorableGremlin /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -706,7 +706,7 @@ public virtual Pageable GetRestorableGremlinResou /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -733,7 +733,7 @@ public virtual AsyncPageable GetRestorableTablesAsync(string st /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -760,7 +760,7 @@ public virtual Pageable GetRestorableTables(string startTime = /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-15 /// /// /// @@ -787,7 +787,7 @@ public virtual AsyncPageable GetRestorableTableReso /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2024-11-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 1670f6a5310a..7166efc3ed84 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 7b1143d52d92..df9b42e2836e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md @@ -9,7 +9,7 @@ azure-arm: true csharp: true library-name: CosmosDB namespace: Azure.ResourceManager.CosmosDB -require: https://github.com/Azure/azure-rest-api-specs/blob/4d065866a422257746306b352cb34fd5c98d5754/specification/cosmos-db/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md #tag: package-preview-2024-09 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/cosmosdb/ci.mgmt.yml b/sdk/cosmosdb/ci.mgmt.yml index 1eab24b3bbf9..ac1fce954c2a 100644 --- a/sdk/cosmosdb/ci.mgmt.yml +++ b/sdk/cosmosdb/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/cosmosdb/ci.mgmt.yml - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdb/ci.mgmt.yml + - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/cosmosdbforpostgresql/ci.mgmt.yml b/sdk/cosmosdbforpostgresql/ci.mgmt.yml index ef6098c3999f..bfe2761181a8 100644 --- a/sdk/cosmosdbforpostgresql/ci.mgmt.yml +++ b/sdk/cosmosdbforpostgresql/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/cosmosdbforpostgresql/ci.mgmt.yml - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdbforpostgresql/ci.mgmt.yml + - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/costmanagement/ci.mgmt.yml b/sdk/costmanagement/ci.mgmt.yml index e59280ba6be2..cee9459831fb 100644 --- a/sdk/costmanagement/ci.mgmt.yml +++ b/sdk/costmanagement/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/costmanagement/ci.mgmt.yml - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/costmanagement/ci.mgmt.yml + - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/customer-insights/ci.mgmt.yml b/sdk/customer-insights/ci.mgmt.yml index 124af418dcfa..a5d4f1a60cb5 100644 --- a/sdk/customer-insights/ci.mgmt.yml +++ b/sdk/customer-insights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/customer-insights/ci.mgmt.yml - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/customer-insights/ci.mgmt.yml + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/databox/ci.mgmt.yml b/sdk/databox/ci.mgmt.yml index edd63a701700..6525b0b436cc 100644 --- a/sdk/databox/ci.mgmt.yml +++ b/sdk/databox/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/databox/ci.mgmt.yml - sdk/databox/Azure.ResourceManager.DataBox/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databox/ci.mgmt.yml + - sdk/databox/Azure.ResourceManager.DataBox/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/databoxedge/ci.mgmt.yml b/sdk/databoxedge/ci.mgmt.yml index 29e3b1537c78..3cf952bd82f3 100644 --- a/sdk/databoxedge/ci.mgmt.yml +++ b/sdk/databoxedge/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/databoxedge/ci.mgmt.yml - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databoxedge/ci.mgmt.yml + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datadog/ci.mgmt.yml b/sdk/datadog/ci.mgmt.yml index 9e9d6825d8b0..c1b66f6edb09 100644 --- a/sdk/datadog/ci.mgmt.yml +++ b/sdk/datadog/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/datadog/ci.mgmt.yml - sdk/datadog/Azure.ResourceManager.Datadog/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datadog/ci.mgmt.yml + - sdk/datadog/Azure.ResourceManager.Datadog/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datafactory/ci.mgmt.yml b/sdk/datafactory/ci.mgmt.yml index 85d246a5d4e7..1f1a4ba295cd 100644 --- a/sdk/datafactory/ci.mgmt.yml +++ b/sdk/datafactory/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/datafactory/ci.mgmt.yml - sdk/datafactory/Azure.ResourceManager.DataFactory/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datafactory/ci.mgmt.yml + - sdk/datafactory/Azure.ResourceManager.DataFactory/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datalake-analytics/ci.mgmt.yml b/sdk/datalake-analytics/ci.mgmt.yml index b8794cd18f9e..44823b2f9444 100644 --- a/sdk/datalake-analytics/ci.mgmt.yml +++ b/sdk/datalake-analytics/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/datalake-analytics/ci.mgmt.yml - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-analytics/ci.mgmt.yml + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datalake-store/ci.mgmt.yml b/sdk/datalake-store/ci.mgmt.yml index 469839fd3024..27295ad1c28c 100644 --- a/sdk/datalake-store/ci.mgmt.yml +++ b/sdk/datalake-store/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/datalake-store/ci.mgmt.yml - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-store/ci.mgmt.yml + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datamigration/ci.mgmt.yml b/sdk/datamigration/ci.mgmt.yml index 1e64024fed17..f26452e1de48 100644 --- a/sdk/datamigration/ci.mgmt.yml +++ b/sdk/datamigration/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/datamigration/ci.mgmt.yml - sdk/datamigration/Azure.ResourceManager.DataMigration/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ci.mgmt.yml + - sdk/datamigration/Azure.ResourceManager.DataMigration/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/dataprotection/ci.mgmt.yml b/sdk/dataprotection/ci.mgmt.yml index 25637090aedb..0b74e9436cc7 100644 --- a/sdk/dataprotection/ci.mgmt.yml +++ b/sdk/dataprotection/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/dataprotection/ci.mgmt.yml - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dataprotection/ci.mgmt.yml + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datashare/ci.mgmt.yml b/sdk/datashare/ci.mgmt.yml index f6dd41e0f37f..dcb3801e3f58 100644 --- a/sdk/datashare/ci.mgmt.yml +++ b/sdk/datashare/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/datashare/ci.mgmt.yml - sdk/datashare/Azure.ResourceManager.DataShare/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datashare/ci.mgmt.yml + - sdk/datashare/Azure.ResourceManager.DataShare/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/defendereasm/ci.mgmt.yml b/sdk/defendereasm/ci.mgmt.yml index dd90e5a46690..2dc5c04ec007 100644 --- a/sdk/defendereasm/ci.mgmt.yml +++ b/sdk/defendereasm/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/defendereasm/ci.mgmt.yml - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/defendereasm/ci.mgmt.yml + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/desktopvirtualization/ci.mgmt.yml b/sdk/desktopvirtualization/ci.mgmt.yml index 3d6f40025c77..b6af32cc15c3 100644 --- a/sdk/desktopvirtualization/ci.mgmt.yml +++ b/sdk/desktopvirtualization/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/desktopvirtualization/ci.mgmt.yml - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/desktopvirtualization/ci.mgmt.yml + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/devcenter/ci.mgmt.yml b/sdk/devcenter/ci.mgmt.yml index 136d77bbba6d..cfa8320239dd 100644 --- a/sdk/devcenter/ci.mgmt.yml +++ b/sdk/devcenter/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/devcenter/ci.mgmt.yml - sdk/devcenter/Azure.ResourceManager.DevCenter/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devcenter/ci.mgmt.yml + - sdk/devcenter/Azure.ResourceManager.DevCenter/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/deviceprovisioningservices/ci.mgmt.yml b/sdk/deviceprovisioningservices/ci.mgmt.yml index f9c94973a324..733989d927dc 100644 --- a/sdk/deviceprovisioningservices/ci.mgmt.yml +++ b/sdk/deviceprovisioningservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/deviceprovisioningservices/ci.mgmt.yml - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceprovisioningservices/ci.mgmt.yml + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/deviceregistry/ci.mgmt.yml b/sdk/deviceregistry/ci.mgmt.yml index 05fffe301114..271e718d8676 100644 --- a/sdk/deviceregistry/ci.mgmt.yml +++ b/sdk/deviceregistry/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/deviceregistry/ci.mgmt.yml - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceregistry/ci.mgmt.yml + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/deviceupdate/ci.mgmt.yml b/sdk/deviceupdate/ci.mgmt.yml index c1315e462bb9..d8abd00a2256 100644 --- a/sdk/deviceupdate/ci.mgmt.yml +++ b/sdk/deviceupdate/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/deviceupdate/ci.mgmt.yml - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceupdate/ci.mgmt.yml + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/devopsinfrastructure/ci.mgmt.yml b/sdk/devopsinfrastructure/ci.mgmt.yml index 0f2db1225cf0..8e463b9f3794 100644 --- a/sdk/devopsinfrastructure/ci.mgmt.yml +++ b/sdk/devopsinfrastructure/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/devopsinfrastructure/ci.mgmt.yml - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devopsinfrastructure/ci.mgmt.yml + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/devspaces/ci.mgmt.yml b/sdk/devspaces/ci.mgmt.yml index b63234a64555..248d3c3143f0 100644 --- a/sdk/devspaces/ci.mgmt.yml +++ b/sdk/devspaces/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/devspaces/ci.mgmt.yml - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devspaces/ci.mgmt.yml + - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/devtestlabs/ci.mgmt.yml b/sdk/devtestlabs/ci.mgmt.yml index 1946409a6b75..7ee994de378b 100644 --- a/sdk/devtestlabs/ci.mgmt.yml +++ b/sdk/devtestlabs/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/devtestlabs/ci.mgmt.yml - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devtestlabs/ci.mgmt.yml + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/digitaltwins/ci.mgmt.yml b/sdk/digitaltwins/ci.mgmt.yml index a0e8233a36cf..a8766e215b7c 100644 --- a/sdk/digitaltwins/ci.mgmt.yml +++ b/sdk/digitaltwins/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/digitaltwins/ci.mgmt.yml - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ci.mgmt.yml + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/dns/ci.mgmt.yml b/sdk/dns/ci.mgmt.yml index 8357809b4e6f..ec6edfb21775 100644 --- a/sdk/dns/ci.mgmt.yml +++ b/sdk/dns/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/dns/ci.mgmt.yml - sdk/dns/Azure.ResourceManager.Dns/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.mgmt.yml + - sdk/dns/Azure.ResourceManager.Dns/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/dnsresolver/ci.mgmt.yml b/sdk/dnsresolver/ci.mgmt.yml index afa270cdc600..6b2569c11c49 100644 --- a/sdk/dnsresolver/ci.mgmt.yml +++ b/sdk/dnsresolver/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/dnsresolver/ci.mgmt.yml - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dnsresolver/ci.mgmt.yml + - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/dynatrace/ci.mgmt.yml b/sdk/dynatrace/ci.mgmt.yml index f76bf3a316af..fe97a3c1f612 100644 --- a/sdk/dynatrace/ci.mgmt.yml +++ b/sdk/dynatrace/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/dynatrace/ci.mgmt.yml - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.mgmt.yml + - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/edgeorder/ci.mgmt.yml b/sdk/edgeorder/ci.mgmt.yml index 4d1fbaa121f9..cb4d87c29a1b 100644 --- a/sdk/edgeorder/ci.mgmt.yml +++ b/sdk/edgeorder/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/edgeorder/ci.mgmt.yml - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeorder/ci.mgmt.yml + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/edgezones/ci.mgmt.yml b/sdk/edgezones/ci.mgmt.yml index 9dc8d79aab30..ebed00842581 100644 --- a/sdk/edgezones/ci.mgmt.yml +++ b/sdk/edgezones/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/edgezones/ci.mgmt.yml - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgezones/ci.mgmt.yml + - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/elastic/ci.mgmt.yml b/sdk/elastic/ci.mgmt.yml index 76ecd8b3923d..2e29070fce4a 100644 --- a/sdk/elastic/ci.mgmt.yml +++ b/sdk/elastic/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/elastic/ci.mgmt.yml - sdk/elastic/Azure.ResourceManager.Elastic/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elastic/ci.mgmt.yml + - sdk/elastic/Azure.ResourceManager.Elastic/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/elasticsan/ci.mgmt.yml b/sdk/elasticsan/ci.mgmt.yml index 7e2bb35dde21..dba4416415e9 100644 --- a/sdk/elasticsan/ci.mgmt.yml +++ b/sdk/elasticsan/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/elasticsan/ci.mgmt.yml - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.mgmt.yml + - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/eventgrid/ci.mgmt.yml b/sdk/eventgrid/ci.mgmt.yml index cb02a1b84e8b..1b2eaffc0fdd 100644 --- a/sdk/eventgrid/ci.mgmt.yml +++ b/sdk/eventgrid/ci.mgmt.yml @@ -2,6 +2,7 @@ # This is for Track 2 managment plane SDK trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/eventgrid/ci.mgmt.yml - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventgrid/ci.mgmt.yml + - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/eventhub/ci.mgmt.yml b/sdk/eventhub/ci.mgmt.yml index b7c0045fffb3..dadda2db6dc5 100644 --- a/sdk/eventhub/ci.mgmt.yml +++ b/sdk/eventhub/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/eventhub/ci.mgmt.yml - sdk/eventhub/Azure.ResourceManager.EventHubs/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhub/ci.mgmt.yml + - sdk/eventhub/Azure.ResourceManager.EventHubs/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/extendedlocation/ci.mgmt.yml b/sdk/extendedlocation/ci.mgmt.yml index 4fb53374be74..e9c6939e2b1d 100644 --- a/sdk/extendedlocation/ci.mgmt.yml +++ b/sdk/extendedlocation/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/extendedlocation/ci.mgmt.yml - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/extendedlocation/ci.mgmt.yml + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/fabric/ci.mgmt.yml b/sdk/fabric/ci.mgmt.yml index d0bc6cea6eb9..5cc91d0c8722 100644 --- a/sdk/fabric/ci.mgmt.yml +++ b/sdk/fabric/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/fabric/ci.mgmt.yml - sdk/fabric/Azure.ResourceManager.Fabric/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fabric/ci.mgmt.yml + - sdk/fabric/Azure.ResourceManager.Fabric/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/fleet/ci.mgmt.yml b/sdk/fleet/ci.mgmt.yml index 09a225882401..469d40cad619 100644 --- a/sdk/fleet/ci.mgmt.yml +++ b/sdk/fleet/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/fleet/ci.mgmt.yml - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fleet/ci.mgmt.yml + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/fluidrelay/ci.mgmt.yml b/sdk/fluidrelay/ci.mgmt.yml index d43dfe94d729..1673db3a9f26 100644 --- a/sdk/fluidrelay/ci.mgmt.yml +++ b/sdk/fluidrelay/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/fluidrelay/ci.mgmt.yml - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fluidrelay/ci.mgmt.yml + - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/frontdoor/ci.mgmt.yml b/sdk/frontdoor/ci.mgmt.yml index bff9dbcae78c..f19923a1b43d 100644 --- a/sdk/frontdoor/ci.mgmt.yml +++ b/sdk/frontdoor/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/frontdoor/ci.mgmt.yml - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ci.mgmt.yml + - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/grafana/ci.mgmt.yml b/sdk/grafana/ci.mgmt.yml index a2f22e6ee33b..848173351b4d 100644 --- a/sdk/grafana/ci.mgmt.yml +++ b/sdk/grafana/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/grafana/ci.mgmt.yml - sdk/grafana/Azure.ResourceManager.Grafana/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/grafana/ci.mgmt.yml + - sdk/grafana/Azure.ResourceManager.Grafana/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/graphservices/ci.mgmt.yml b/sdk/graphservices/ci.mgmt.yml index 717a9a4a1963..ccd14b614b43 100644 --- a/sdk/graphservices/ci.mgmt.yml +++ b/sdk/graphservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/graphservices/ci.mgmt.yml - sdk/graphservices/Azure.ResourceManager.GraphServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/graphservices/ci.mgmt.yml + - sdk/graphservices/Azure.ResourceManager.GraphServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/guestconfiguration/ci.mgmt.yml b/sdk/guestconfiguration/ci.mgmt.yml index 5ebc59550f58..c2d2526d488b 100644 --- a/sdk/guestconfiguration/ci.mgmt.yml +++ b/sdk/guestconfiguration/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/guestconfiguration/ci.mgmt.yml - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/guestconfiguration/ci.mgmt.yml + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hardwaresecuritymodules/ci.mgmt.yml b/sdk/hardwaresecuritymodules/ci.mgmt.yml index 21778711f99e..d94eea966253 100644 --- a/sdk/hardwaresecuritymodules/ci.mgmt.yml +++ b/sdk/hardwaresecuritymodules/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hardwaresecuritymodules/ci.mgmt.yml - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hardwaresecuritymodules/ci.mgmt.yml + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hdinsight/ci.mgmt.yml b/sdk/hdinsight/ci.mgmt.yml index 4df0a02f5c80..29d3b404c76a 100644 --- a/sdk/hdinsight/ci.mgmt.yml +++ b/sdk/hdinsight/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hdinsight/ci.mgmt.yml - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ci.mgmt.yml + - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hdinsightcontainers/ci.mgmt.yml b/sdk/hdinsightcontainers/ci.mgmt.yml index 69a7566e0caa..66a879d8fbcd 100644 --- a/sdk/hdinsightcontainers/ci.mgmt.yml +++ b/sdk/hdinsightcontainers/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hdinsightcontainers/ci.mgmt.yml - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightcontainers/ci.mgmt.yml + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/healthbot/ci.mgmt.yml b/sdk/healthbot/ci.mgmt.yml index 14bfc7f855e6..4c2698659502 100644 --- a/sdk/healthbot/ci.mgmt.yml +++ b/sdk/healthbot/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/healthbot/ci.mgmt.yml - sdk/healthbot/Azure.ResourceManager.HealthBot/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthbot/ci.mgmt.yml + - sdk/healthbot/Azure.ResourceManager.HealthBot/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/healthcareapis/ci.mgmt.yml b/sdk/healthcareapis/ci.mgmt.yml index 57030df35e56..6f02ac8fd023 100644 --- a/sdk/healthcareapis/ci.mgmt.yml +++ b/sdk/healthcareapis/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/healthcareapis/ci.mgmt.yml - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthcareapis/ci.mgmt.yml + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/healthdataaiservices/ci.mgmt.yml b/sdk/healthdataaiservices/ci.mgmt.yml index 016a917c1e19..45857afa5722 100644 --- a/sdk/healthdataaiservices/ci.mgmt.yml +++ b/sdk/healthdataaiservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/healthdataaiservices/ci.mgmt.yml - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthdataaiservices/ci.mgmt.yml + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridaks/ci.mgmt.yml b/sdk/hybridaks/ci.mgmt.yml index 552eb3298d3a..af3d82703d11 100644 --- a/sdk/hybridaks/ci.mgmt.yml +++ b/sdk/hybridaks/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hybridaks/ci.mgmt.yml - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridaks/ci.mgmt.yml + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridcompute/ci.mgmt.yml b/sdk/hybridcompute/ci.mgmt.yml index d163a966512d..15f8656c399e 100644 --- a/sdk/hybridcompute/ci.mgmt.yml +++ b/sdk/hybridcompute/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hybridcompute/ci.mgmt.yml - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ci.mgmt.yml + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridconnectivity/ci.mgmt.yml b/sdk/hybridconnectivity/ci.mgmt.yml index 9ccca42ef557..8d809d4d9633 100644 --- a/sdk/hybridconnectivity/ci.mgmt.yml +++ b/sdk/hybridconnectivity/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hybridconnectivity/ci.mgmt.yml - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridconnectivity/ci.mgmt.yml + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridkubernetes/ci.mgmt.yml b/sdk/hybridkubernetes/ci.mgmt.yml index fff768430c9d..bb98635a8e1c 100644 --- a/sdk/hybridkubernetes/ci.mgmt.yml +++ b/sdk/hybridkubernetes/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hybridkubernetes/ci.mgmt.yml - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ci.mgmt.yml + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridnetwork/ci.mgmt.yml b/sdk/hybridnetwork/ci.mgmt.yml index 35f71f8ae870..39412ff81f05 100644 --- a/sdk/hybridnetwork/ci.mgmt.yml +++ b/sdk/hybridnetwork/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hybridnetwork/ci.mgmt.yml - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridnetwork/ci.mgmt.yml + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/informaticadatamanagement/ci.mgmt.yml b/sdk/informaticadatamanagement/ci.mgmt.yml index 03013cc9c90b..82d3bafd3f7f 100644 --- a/sdk/informaticadatamanagement/ci.mgmt.yml +++ b/sdk/informaticadatamanagement/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/informaticadatamanagement/ci.mgmt.yml - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/informaticadatamanagement/ci.mgmt.yml + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/iot/ci.mgmt.yml b/sdk/iot/ci.mgmt.yml index 6260cd0d71f2..199578b03331 100644 --- a/sdk/iot/ci.mgmt.yml +++ b/sdk/iot/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/iot/ci.mgmt.yml - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iot/ci.mgmt.yml + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/iotcentral/ci.mgmt.yml b/sdk/iotcentral/ci.mgmt.yml index 1702fd71c6dd..1225f99c37fd 100644 --- a/sdk/iotcentral/ci.mgmt.yml +++ b/sdk/iotcentral/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/iotcentral/ci.mgmt.yml - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotcentral/ci.mgmt.yml + - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/iothub/ci.mgmt.yml b/sdk/iothub/ci.mgmt.yml index 5eb9e999a89c..63fb10994eac 100644 --- a/sdk/iothub/ci.mgmt.yml +++ b/sdk/iothub/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/iothub/ci.mgmt.yml - sdk/iothub/Azure.ResourceManager.IotHub/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iothub/ci.mgmt.yml + - sdk/iothub/Azure.ResourceManager.IotHub/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/keyvault/ci.mgmt.yml b/sdk/keyvault/ci.mgmt.yml index b48c2f8d4ff4..8ad905079a0a 100644 --- a/sdk/keyvault/ci.mgmt.yml +++ b/sdk/keyvault/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/keyvault/ci.mgmt.yml - sdk/keyvault/Azure.ResourceManager.KeyVault/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/keyvault/ci.mgmt.yml + - sdk/keyvault/Azure.ResourceManager.KeyVault/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/kubernetesconfiguration/ci.mgmt.yml b/sdk/kubernetesconfiguration/ci.mgmt.yml index 4249ef57fa6e..d3fb470a7b6e 100644 --- a/sdk/kubernetesconfiguration/ci.mgmt.yml +++ b/sdk/kubernetesconfiguration/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/kubernetesconfiguration/ci.mgmt.yml - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfiguration/ci.mgmt.yml + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/kusto/ci.mgmt.yml b/sdk/kusto/ci.mgmt.yml index 374cf1f0cb81..c410d1487d18 100644 --- a/sdk/kusto/ci.mgmt.yml +++ b/sdk/kusto/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/kusto/ci.mgmt.yml - sdk/kusto/Azure.ResourceManager.Kusto/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ci.mgmt.yml + - sdk/kusto/Azure.ResourceManager.Kusto/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/labservices/ci.mgmt.yml b/sdk/labservices/ci.mgmt.yml index 48f80379ab14..f8a982072965 100644 --- a/sdk/labservices/ci.mgmt.yml +++ b/sdk/labservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/labservices/ci.mgmt.yml - sdk/labservices/Azure.ResourceManager.LabServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/labservices/ci.mgmt.yml + - sdk/labservices/Azure.ResourceManager.LabServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/loadtestservice/ci.mgmt.yml b/sdk/loadtestservice/ci.mgmt.yml index 4e3d99d42979..dfc32939e497 100644 --- a/sdk/loadtestservice/ci.mgmt.yml +++ b/sdk/loadtestservice/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/loadtestservice/ci.mgmt.yml - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/loadtestservice/ci.mgmt.yml + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/logic/ci.mgmt.yml b/sdk/logic/ci.mgmt.yml index b89b224082ee..5bed51facd34 100644 --- a/sdk/logic/ci.mgmt.yml +++ b/sdk/logic/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/logic/ci.mgmt.yml - sdk/logic/Azure.ResourceManager.Logic/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/logic/ci.mgmt.yml + - sdk/logic/Azure.ResourceManager.Logic/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/machinelearningcompute/ci.mgmt.yml b/sdk/machinelearningcompute/ci.mgmt.yml index 9ea84fdf4d15..5ea619231191 100644 --- a/sdk/machinelearningcompute/ci.mgmt.yml +++ b/sdk/machinelearningcompute/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/machinelearningcompute/ci.mgmt.yml - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningcompute/ci.mgmt.yml + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/machinelearningservices/ci.mgmt.yml b/sdk/machinelearningservices/ci.mgmt.yml index 457299ab20b9..3a99ed224fc2 100644 --- a/sdk/machinelearningservices/ci.mgmt.yml +++ b/sdk/machinelearningservices/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,18 @@ pr: - sdk/machinelearningservices/ci.mgmt.yml - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningservices/ci.mgmt.yml + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/maintenance/ci.mgmt.yml b/sdk/maintenance/ci.mgmt.yml index c49cc1565d6d..94c552b69f26 100644 --- a/sdk/maintenance/ci.mgmt.yml +++ b/sdk/maintenance/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/maintenance/ci.mgmt.yml - sdk/maintenance/Azure.ResourceManager.Maintenance/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maintenance/ci.mgmt.yml + - sdk/maintenance/Azure.ResourceManager.Maintenance/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managednetwork/ci.mgmt.yml b/sdk/managednetwork/ci.mgmt.yml index 431d66d1245b..08c9f3d0ce55 100644 --- a/sdk/managednetwork/ci.mgmt.yml +++ b/sdk/managednetwork/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/managednetwork/ci.mgmt.yml - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetwork/ci.mgmt.yml + - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managednetworkfabric/ci.mgmt.yml b/sdk/managednetworkfabric/ci.mgmt.yml index aa6b571b04e2..3212ad45bbde 100644 --- a/sdk/managednetworkfabric/ci.mgmt.yml +++ b/sdk/managednetworkfabric/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/managednetworkfabric/ci.mgmt.yml - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.mgmt.yml + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managedserviceidentity/ci.mgmt.yml b/sdk/managedserviceidentity/ci.mgmt.yml index c8f3a187f918..c9cd4b0f235a 100644 --- a/sdk/managedserviceidentity/ci.mgmt.yml +++ b/sdk/managedserviceidentity/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/managedserviceidentity/ci.mgmt.yml - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedserviceidentity/ci.mgmt.yml + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managedservices/ci.mgmt.yml b/sdk/managedservices/ci.mgmt.yml index d6c0ccd16eef..88360bb2defa 100644 --- a/sdk/managedservices/ci.mgmt.yml +++ b/sdk/managedservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/managedservices/ci.mgmt.yml - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedservices/ci.mgmt.yml + - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managementpartner/ci.mgmt.yml b/sdk/managementpartner/ci.mgmt.yml index 52c8e762088e..6fdd0118e1b9 100644 --- a/sdk/managementpartner/ci.mgmt.yml +++ b/sdk/managementpartner/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/managementpartner/ci.mgmt.yml - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managementpartner/ci.mgmt.yml + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/maps/ci.mgmt.yml b/sdk/maps/ci.mgmt.yml index 2f16079cab2e..7ee4f1ddad3c 100644 --- a/sdk/maps/ci.mgmt.yml +++ b/sdk/maps/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/maps/ci.mgmt.yml - sdk/maps/Azure.ResourceManager.Maps/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maps/ci.mgmt.yml + - sdk/maps/Azure.ResourceManager.Maps/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/marketplace/ci.mgmt.yml b/sdk/marketplace/ci.mgmt.yml index e6574bdb3039..42bc8a147b30 100644 --- a/sdk/marketplace/ci.mgmt.yml +++ b/sdk/marketplace/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/marketplace/ci.mgmt.yml - sdk/marketplace/Azure.ResourceManager.Marketplace/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplace/ci.mgmt.yml + - sdk/marketplace/Azure.ResourceManager.Marketplace/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/marketplaceordering/ci.mgmt.yml b/sdk/marketplaceordering/ci.mgmt.yml index 2b1f8721902e..c602647fb32d 100644 --- a/sdk/marketplaceordering/ci.mgmt.yml +++ b/sdk/marketplaceordering/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/marketplaceordering/ci.mgmt.yml - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplaceordering/ci.mgmt.yml + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mediaservices/ci.mgmt.yml b/sdk/mediaservices/ci.mgmt.yml index 55656f3ae48b..201ecc9d995d 100644 --- a/sdk/mediaservices/ci.mgmt.yml +++ b/sdk/mediaservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/mediaservices/ci.mgmt.yml - sdk/mediaservices/Azure.ResourceManager.Media/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mediaservices/ci.mgmt.yml + - sdk/mediaservices/Azure.ResourceManager.Media/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/migrationdiscoverysap/ci.mgmt.yml b/sdk/migrationdiscoverysap/ci.mgmt.yml index f5eb354d28e7..26c079f3d6f5 100644 --- a/sdk/migrationdiscoverysap/ci.mgmt.yml +++ b/sdk/migrationdiscoverysap/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/migrationdiscoverysap/ci.mgmt.yml - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrationdiscoverysap/ci.mgmt.yml + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mixedreality/ci.mgmt.yml b/sdk/mixedreality/ci.mgmt.yml index 81c0c2744232..d342a10a32e0 100644 --- a/sdk/mixedreality/ci.mgmt.yml +++ b/sdk/mixedreality/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,18 @@ pr: - sdk/mixedreality/ci.mgmt.yml - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mixedreality/ci.mgmt.yml + - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mobilenetwork/ci.mgmt.yml b/sdk/mobilenetwork/ci.mgmt.yml index 8a68e6749ba7..325154bfbfb7 100644 --- a/sdk/mobilenetwork/ci.mgmt.yml +++ b/sdk/mobilenetwork/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/mobilenetwork/ci.mgmt.yml - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.mgmt.yml + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mongocluster/ci.mgmt.yml b/sdk/mongocluster/ci.mgmt.yml index d2eafe7877dd..10f6e93db8bc 100644 --- a/sdk/mongocluster/ci.mgmt.yml +++ b/sdk/mongocluster/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/mongocluster/ci.mgmt.yml - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mongocluster/ci.mgmt.yml + - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/monitor/ci.mgmt.yml b/sdk/monitor/ci.mgmt.yml index 8beeded4e3b9..5933fd35d9e5 100644 --- a/sdk/monitor/ci.mgmt.yml +++ b/sdk/monitor/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/monitor/ci.mgmt.yml - sdk/monitor/Azure.ResourceManager.Monitor/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/monitor/ci.mgmt.yml + - sdk/monitor/Azure.ResourceManager.Monitor/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mysql/ci.mgmt.yml b/sdk/mysql/ci.mgmt.yml index e1521b4ed568..2ba5627ae3fc 100644 --- a/sdk/mysql/ci.mgmt.yml +++ b/sdk/mysql/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/mysql/ci.mgmt.yml - sdk/mysql/Azure.ResourceManager.MySql/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mysql/ci.mgmt.yml + - sdk/mysql/Azure.ResourceManager.MySql/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/netapp/ci.mgmt.yml b/sdk/netapp/ci.mgmt.yml index 05a683e910f5..5d0a3e741513 100644 --- a/sdk/netapp/ci.mgmt.yml +++ b/sdk/netapp/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/netapp/ci.mgmt.yml - sdk/netapp/Azure.ResourceManager.NetApp/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ci.mgmt.yml + - sdk/netapp/Azure.ResourceManager.NetApp/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/network/ci.mgmt.yml b/sdk/network/ci.mgmt.yml index edf77de02a49..f69378e6c236 100644 --- a/sdk/network/ci.mgmt.yml +++ b/sdk/network/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/network/ci.mgmt.yml - sdk/network/Azure.ResourceManager.Network/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.mgmt.yml + - sdk/network/Azure.ResourceManager.Network/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/networkanalytics/ci.mgmt.yml b/sdk/networkanalytics/ci.mgmt.yml index 9ece072ce867..52934a1bad24 100644 --- a/sdk/networkanalytics/ci.mgmt.yml +++ b/sdk/networkanalytics/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/networkanalytics/ci.mgmt.yml - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.mgmt.yml + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/networkcloud/ci.mgmt.yml b/sdk/networkcloud/ci.mgmt.yml index f6c281af22a9..940f908b8c75 100644 --- a/sdk/networkcloud/ci.mgmt.yml +++ b/sdk/networkcloud/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/networkcloud/ci.mgmt.yml - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.mgmt.yml + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/networkfunction/ci.mgmt.yml b/sdk/networkfunction/ci.mgmt.yml index a3c743ef532a..b05cf6e5e1cc 100644 --- a/sdk/networkfunction/ci.mgmt.yml +++ b/sdk/networkfunction/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/networkfunction/ci.mgmt.yml - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkfunction/ci.mgmt.yml + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/newrelicobservability/ci.mgmt.yml b/sdk/newrelicobservability/ci.mgmt.yml index d01ef74cd749..599cfd845f2c 100644 --- a/sdk/newrelicobservability/ci.mgmt.yml +++ b/sdk/newrelicobservability/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/newrelicobservability/ci.mgmt.yml - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/newrelicobservability/ci.mgmt.yml + - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/nginx/ci.mgmt.yml b/sdk/nginx/ci.mgmt.yml index f701b26a561a..39e047ce0015 100644 --- a/sdk/nginx/ci.mgmt.yml +++ b/sdk/nginx/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/nginx/ci.mgmt.yml - sdk/nginx/Azure.ResourceManager.Nginx/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.mgmt.yml + - sdk/nginx/Azure.ResourceManager.Nginx/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/notificationhubs/ci.mgmt.yml b/sdk/notificationhubs/ci.mgmt.yml index ba5a26631dd4..8d9f15f7758b 100644 --- a/sdk/notificationhubs/ci.mgmt.yml +++ b/sdk/notificationhubs/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/notificationhubs/ci.mgmt.yml - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/notificationhubs/ci.mgmt.yml + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/openenergyplatform/ci.mgmt.yml b/sdk/openenergyplatform/ci.mgmt.yml index 1ab74128b4db..f2394b80f6b9 100644 --- a/sdk/openenergyplatform/ci.mgmt.yml +++ b/sdk/openenergyplatform/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/openenergyplatform/ci.mgmt.yml - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/openenergyplatform/ci.mgmt.yml + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/operationalinsights/ci.mgmt.yml b/sdk/operationalinsights/ci.mgmt.yml index d4c3b61dac40..9e588305c901 100644 --- a/sdk/operationalinsights/ci.mgmt.yml +++ b/sdk/operationalinsights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/operationalinsights/ci.mgmt.yml - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/operationalinsights/ci.mgmt.yml + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/oracle/ci.mgmt.yml b/sdk/oracle/ci.mgmt.yml index ccbd7c096ecf..760950dbd58a 100644 --- a/sdk/oracle/ci.mgmt.yml +++ b/sdk/oracle/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/oracle/ci.mgmt.yml - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/oracle/ci.mgmt.yml + - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/orbital/ci.mgmt.yml b/sdk/orbital/ci.mgmt.yml index 701576d2fa62..2b2102df1da3 100644 --- a/sdk/orbital/ci.mgmt.yml +++ b/sdk/orbital/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/orbital/ci.mgmt.yml - sdk/orbital/Azure.ResourceManager.Orbital/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.mgmt.yml + - sdk/orbital/Azure.ResourceManager.Orbital/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/paloaltonetworks.ngfw/ci.mgmt.yml b/sdk/paloaltonetworks.ngfw/ci.mgmt.yml index 77dca48de9ef..6348d3109683 100644 --- a/sdk/paloaltonetworks.ngfw/ci.mgmt.yml +++ b/sdk/paloaltonetworks.ngfw/ci.mgmt.yml @@ -1,4 +1,5 @@ trigger: none + pr: branches: include: @@ -11,6 +12,18 @@ pr: - sdk/paloaltonetworks.ngfw/ci.mgmt.yml - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/paloaltonetworks.ngfw/ci.mgmt.yml + - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/peering/ci.mgmt.yml b/sdk/peering/ci.mgmt.yml index 4d3d67e73949..cfef409531ee 100644 --- a/sdk/peering/ci.mgmt.yml +++ b/sdk/peering/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/peering/ci.mgmt.yml - sdk/peering/Azure.ResourceManager.Peering/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/peering/ci.mgmt.yml + - sdk/peering/Azure.ResourceManager.Peering/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/playwrighttesting/ci.mgmt.yml b/sdk/playwrighttesting/ci.mgmt.yml index 79addf69162c..b6422b373563 100644 --- a/sdk/playwrighttesting/ci.mgmt.yml +++ b/sdk/playwrighttesting/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/playwrighttesting/ci.mgmt.yml - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ci.mgmt.yml + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/policyinsights/ci.mgmt.yml b/sdk/policyinsights/ci.mgmt.yml index 56fa5c3ead85..c0fa9e7dd917 100644 --- a/sdk/policyinsights/ci.mgmt.yml +++ b/sdk/policyinsights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/policyinsights/ci.mgmt.yml - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/policyinsights/ci.mgmt.yml + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/postgresql/ci.mgmt.yml b/sdk/postgresql/ci.mgmt.yml index 77dbaed301ba..08dff06cd11f 100644 --- a/sdk/postgresql/ci.mgmt.yml +++ b/sdk/postgresql/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/postgresql/ci.mgmt.yml - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/postgresql/ci.mgmt.yml + - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/powerbidedicated/ci.mgmt.yml b/sdk/powerbidedicated/ci.mgmt.yml index 414f2b8ef0a9..951d3e8d0434 100644 --- a/sdk/powerbidedicated/ci.mgmt.yml +++ b/sdk/powerbidedicated/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/powerbidedicated/ci.mgmt.yml - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerbidedicated/ci.mgmt.yml + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/privatedns/ci.mgmt.yml b/sdk/privatedns/ci.mgmt.yml index 86401f2f9675..31c567bfe408 100644 --- a/sdk/privatedns/ci.mgmt.yml +++ b/sdk/privatedns/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/privatedns/ci.mgmt.yml - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ci.mgmt.yml + - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/providerhub/ci.mgmt.yml b/sdk/providerhub/ci.mgmt.yml index 2c7f6ca61d3f..3de6a7f30b80 100644 --- a/sdk/providerhub/ci.mgmt.yml +++ b/sdk/providerhub/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/providerhub/ci.mgmt.yml - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ci.mgmt.yml + - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/purview/ci.mgmt.yml b/sdk/purview/ci.mgmt.yml index 226718ca583c..d5961aa8833a 100644 --- a/sdk/purview/ci.mgmt.yml +++ b/sdk/purview/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,18 @@ pr: - sdk/purview/ci.mgmt.yml - sdk/purview/Azure.ResourceManager.Purview/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/purview/ci.mgmt.yml + - sdk/purview/Azure.ResourceManager.Purview/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/quantum/ci.mgmt.yml b/sdk/quantum/ci.mgmt.yml index 8562320fa7c7..6ee02d7799bd 100644 --- a/sdk/quantum/ci.mgmt.yml +++ b/sdk/quantum/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/quantum/ci.mgmt.yml - sdk/quantum/Azure.ResourceManager.Quantum/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quantum/ci.mgmt.yml + - sdk/quantum/Azure.ResourceManager.Quantum/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/qumulo/ci.mgmt.yml b/sdk/qumulo/ci.mgmt.yml index e89c4bea0e70..fe6e1fa253d3 100644 --- a/sdk/qumulo/ci.mgmt.yml +++ b/sdk/qumulo/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/qumulo/ci.mgmt.yml - sdk/qumulo/Azure.ResourceManager.Qumulo/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/qumulo/ci.mgmt.yml + - sdk/qumulo/Azure.ResourceManager.Qumulo/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/quota/ci.mgmt.yml b/sdk/quota/ci.mgmt.yml index f1f545ad13f1..9409730d342e 100644 --- a/sdk/quota/ci.mgmt.yml +++ b/sdk/quota/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/quota/ci.mgmt.yml - sdk/quota/Azure.ResourceManager.Quota/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quota/ci.mgmt.yml + - sdk/quota/Azure.ResourceManager.Quota/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/recoveryservices-backup/ci.mgmt.yml b/sdk/recoveryservices-backup/ci.mgmt.yml index 5edfd823e3c0..402121c0f72c 100644 --- a/sdk/recoveryservices-backup/ci.mgmt.yml +++ b/sdk/recoveryservices-backup/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/recoveryservices-backup/ci.mgmt.yml - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-backup/ci.mgmt.yml + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/recoveryservices-datareplication/ci.mgmt.yml b/sdk/recoveryservices-datareplication/ci.mgmt.yml index 2e3966d67a88..143f2e0317c3 100644 --- a/sdk/recoveryservices-datareplication/ci.mgmt.yml +++ b/sdk/recoveryservices-datareplication/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/recoveryservices-datareplication/ci.mgmt.yml - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-datareplication/ci.mgmt.yml + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/recoveryservices-siterecovery/ci.mgmt.yml b/sdk/recoveryservices-siterecovery/ci.mgmt.yml index bded800f3ee2..3a8a3179d5a5 100644 --- a/sdk/recoveryservices-siterecovery/ci.mgmt.yml +++ b/sdk/recoveryservices-siterecovery/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/recoveryservices-siterecovery/ci.mgmt.yml - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-siterecovery/ci.mgmt.yml + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/recoveryservices/ci.mgmt.yml b/sdk/recoveryservices/ci.mgmt.yml index 0e7e6985f21c..d4a5e482dfa7 100644 --- a/sdk/recoveryservices/ci.mgmt.yml +++ b/sdk/recoveryservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/recoveryservices/ci.mgmt.yml - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices/ci.mgmt.yml + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/redis/ci.mgmt.yml b/sdk/redis/ci.mgmt.yml index 9e6845322580..dfc71e356b87 100644 --- a/sdk/redis/ci.mgmt.yml +++ b/sdk/redis/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/redis/ci.mgmt.yml - sdk/redis/Azure.ResourceManager.Redis/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.mgmt.yml + - sdk/redis/Azure.ResourceManager.Redis/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/redisenterprise/ci.mgmt.yml b/sdk/redisenterprise/ci.mgmt.yml index 93641cfe3983..294ec0377bdf 100644 --- a/sdk/redisenterprise/ci.mgmt.yml +++ b/sdk/redisenterprise/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/redisenterprise/ci.mgmt.yml - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redisenterprise/ci.mgmt.yml + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/relay/ci.mgmt.yml b/sdk/relay/ci.mgmt.yml index b69a1efbd0f9..fc5a3764ebb5 100644 --- a/sdk/relay/ci.mgmt.yml +++ b/sdk/relay/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/relay/ci.mgmt.yml - sdk/relay/Azure.ResourceManager.Relay/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/relay/ci.mgmt.yml + - sdk/relay/Azure.ResourceManager.Relay/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/reservations/ci.mgmt.yml b/sdk/reservations/ci.mgmt.yml index c46c8c69cd2e..8effbcdd4424 100644 --- a/sdk/reservations/ci.mgmt.yml +++ b/sdk/reservations/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/reservations/ci.mgmt.yml - sdk/reservations/Azure.ResourceManager.Reservations/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/reservations/ci.mgmt.yml + - sdk/reservations/Azure.ResourceManager.Reservations/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resourceconnector/ci.mgmt.yml b/sdk/resourceconnector/ci.mgmt.yml index 81269b9113c7..149f1805dab4 100644 --- a/sdk/resourceconnector/ci.mgmt.yml +++ b/sdk/resourceconnector/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/resourceconnector/ci.mgmt.yml - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.mgmt.yml + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resourcegraph/ci.mgmt.yml b/sdk/resourcegraph/ci.mgmt.yml index 5abe050f7709..27656bcd16c2 100644 --- a/sdk/resourcegraph/ci.mgmt.yml +++ b/sdk/resourcegraph/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/resourcegraph/ci.mgmt.yml - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcegraph/ci.mgmt.yml + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resourcehealth/ci.mgmt.yml b/sdk/resourcehealth/ci.mgmt.yml index fb0a27171a69..bf3868346c7b 100644 --- a/sdk/resourcehealth/ci.mgmt.yml +++ b/sdk/resourcehealth/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/resourcehealth/ci.mgmt.yml - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcehealth/ci.mgmt.yml + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index e844fdb04cde..bdacaf9962c3 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -11,197 +11,197 @@ trigger: - sdk/resourcemanager - common/ManagementTestShared - common/ManagementCoreShared - - sdk/advisor/Azure.ResourceManager.Advisor - - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform - - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement - - sdk/analysisservices/Azure.ResourceManager.Analysis - - sdk/apicenter/Azure.ResourceManager.ApiCenter - - sdk/apimanagement/Azure.ResourceManager.ApiManagement - - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration + - sdk/peering/Azure.ResourceManager.Peering + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge + - sdk/search/Azure.ResourceManager.Search + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication + - sdk/quota/Azure.ResourceManager.Quota + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration - - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights - - sdk/appplatform/Azure.ResourceManager.AppPlatform + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices + - sdk/signalr/Azure.ResourceManager.SignalR + - sdk/chaos/Azure.ResourceManager.Chaos + - sdk/communication/Azure.ResourceManager.Communication + - sdk/containerapps/Azure.ResourceManager.AppContainers + - sdk/cdn/Azure.ResourceManager.Cdn + - sdk/blueprint/Azure.ResourceManager.Blueprint + - sdk/sqlmanagement/Azure.ResourceManager.Sql + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService + - sdk/storagesync/Azure.ResourceManager.StorageSync + - sdk/frontdoor/Azure.ResourceManager.FrontDoor + - sdk/storage/Azure.ResourceManager.Storage + - sdk/labservices/Azure.ResourceManager.LabServices + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning + - sdk/sphere/Azure.ResourceManager.Sphere + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps - sdk/arc-scvmm/Azure.ResourceManager.ScVmm + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights + - sdk/advisor/Azure.ResourceManager.Advisor + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices + - sdk/relay/Azure.ResourceManager.Relay + - sdk/appplatform/Azure.ResourceManager.AppPlatform + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap + - sdk/resources/Azure.ResourceManager.Resources + - sdk/costmanagement/Azure.ResourceManager.CostManagement - sdk/astronomer/Azure.ResourceManager.Astro - - sdk/attestation/Azure.ResourceManager.Attestation + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated + - sdk/storagemover/Azure.ResourceManager.StorageMover + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager + - sdk/netapp/Azure.ResourceManager.NetApp + - sdk/dynatrace/Azure.ResourceManager.Dynatrace + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime - sdk/authorization/Azure.ResourceManager.Authorization - - sdk/automanage/Azure.ResourceManager.Automanage + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner + - sdk/qumulo/Azure.ResourceManager.Qumulo + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger + - sdk/managedservices/Azure.ResourceManager.ManagedServices - sdk/automation/Azure.ResourceManager.Automation - - sdk/avs/Azure.ResourceManager.Avs - - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance - - sdk/azurestackhci/Azure.ResourceManager.Hci - - sdk/batch/Azure.ResourceManager.Batch - - sdk/billing/Azure.ResourceManager.Billing + - sdk/mongocluster/Azure.ResourceManager.MongoCluster + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits - - sdk/blueprint/Azure.ResourceManager.Blueprint - - sdk/botservice/Azure.ResourceManager.BotService - - sdk/cdn/Azure.ResourceManager.Cdn - - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis - - sdk/chaos/Azure.ResourceManager.Chaos - - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices - - sdk/communication/Azure.ResourceManager.Communication - - sdk/compute/Azure.ResourceManager.Compute - - sdk/computefleet/Azure.ResourceManager.ComputeFleet + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule - - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger - - sdk/confluent/Azure.ResourceManager.Confluent - - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere - - sdk/consumption/Azure.ResourceManager.Consumption - - sdk/containerapps/Azure.ResourceManager.AppContainers - - sdk/containerinstance/Azure.ResourceManager.ContainerInstance - - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime - - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry - - sdk/containerservice/Azure.ResourceManager.ContainerService + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute - sdk/cosmosdb/Azure.ResourceManager.CosmosDB + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction + - sdk/computefleet/Azure.ResourceManager.ComputeFleet + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations + - sdk/attestation/Azure.ResourceManager.Attestation + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere + - sdk/eventhub/Azure.ResourceManager.EventHubs + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics + - sdk/synapse/Azure.ResourceManager.Synapse + - sdk/automanage/Azure.ResourceManager.Automanage + - sdk/voiceservices/Azure.ResourceManager.VoiceServices + - sdk/postgresql/Azure.ResourceManager.PostgreSql + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql - - sdk/costmanagement/Azure.ResourceManager.CostManagement - - sdk/customer-insights/Azure.ResourceManager.CustomerInsights - - sdk/databox/Azure.ResourceManager.DataBox - - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge - - sdk/datadog/Azure.ResourceManager.Datadog - - sdk/datafactory/Azure.ResourceManager.DataFactory - - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics - - sdk/datalake-store/Azure.ResourceManager.DataLakeStore - - sdk/datamigration/Azure.ResourceManager.DataMigration - - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup - - sdk/datashare/Azure.ResourceManager.DataShare - - sdk/defendereasm/Azure.ResourceManager.DefenderEasm - - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization - - sdk/devcenter/Azure.ResourceManager.DevCenter - - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices - - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry - - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate - - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure - - sdk/devspaces/Azure.ResourceManager.DevSpaces - - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs - - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins - - sdk/dns/Azure.ResourceManager.Dns + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting + - sdk/grafana/Azure.ResourceManager.Grafana + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric - sdk/dnsresolver/Azure.ResourceManager.DnsResolver - - sdk/dynatrace/Azure.ResourceManager.Dynatrace - - sdk/edgeorder/Azure.ResourceManager.EdgeOrder + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric + - sdk/iothub/Azure.ResourceManager.IotHub + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor + - sdk/webpubsub/Azure.ResourceManager.WebPubSub + - sdk/mysql/Azure.ResourceManager.MySql + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes + - sdk/apimanagement/Azure.ResourceManager.ApiManagement + - sdk/terraform/Azure.ResourceManager.Terraform + - sdk/kusto/Azure.ResourceManager.Kusto + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter + - sdk/support/Azure.ResourceManager.Support + - sdk/maps/Azure.ResourceManager.Maps + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis - sdk/edgezones/Azure.ResourceManager.EdgeZones - - sdk/elastic/Azure.ResourceManager.Elastic - - sdk/elasticsan/Azure.ResourceManager.ElasticSan - - sdk/eventgrid/Azure.ResourceManager.EventGrid - - sdk/eventhub/Azure.ResourceManager.EventHubs - - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations - - sdk/fabric/Azure.ResourceManager.Fabric - - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization + - sdk/selfhelp/Azure.ResourceManager.SelfHelp + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities + - sdk/orbital/Azure.ResourceManager.Orbital + - sdk/batch/Azure.ResourceManager.Batch - sdk/fluidrelay/Azure.ResourceManager.FluidRelay - - sdk/frontdoor/Azure.ResourceManager.FrontDoor - - sdk/grafana/Azure.ResourceManager.Grafana + - sdk/datashare/Azure.ResourceManager.DataShare + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery + - sdk/dns/Azure.ResourceManager.Dns + - sdk/compute/Azure.ResourceManager.Compute - sdk/graphservices/Azure.ResourceManager.GraphServices - - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration - - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules - - sdk/hdinsight/Azure.ResourceManager.HDInsight - - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers - - sdk/healthbot/Azure.ResourceManager.HealthBot - - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis - - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices - - sdk/hybridaks/Azure.ResourceManager.HybridContainerService - - sdk/hybridcompute/Azure.ResourceManager.HybridCompute - - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity - - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes - - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork - - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement - - sdk/iot/Azure.ResourceManager.IotFirmwareDefense - - sdk/iotcentral/Azure.ResourceManager.IotCentral - - sdk/iothub/Azure.ResourceManager.IotHub + - sdk/databox/Azure.ResourceManager.DataBox - sdk/keyvault/Azure.ResourceManager.KeyVault - - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration - - sdk/kusto/Azure.ResourceManager.Kusto - - sdk/labservices/Azure.ResourceManager.LabServices - - sdk/loadtestservice/Azure.ResourceManager.LoadTesting + - sdk/marketplace/Azure.ResourceManager.Marketplace + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise + - sdk/botservice/Azure.ResourceManager.BotService + - sdk/workloads/Azure.ResourceManager.Workloads + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting + - sdk/standbypool/Azure.ResourceManager.StandbyPool - sdk/logic/Azure.ResourceManager.Logic - - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute - - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning + - sdk/fabric/Azure.ResourceManager.Fabric + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector + - sdk/containerservice/Azure.ResourceManager.ContainerService + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement + - sdk/elasticsan/Azure.ResourceManager.ElasticSan + - sdk/devspaces/Azure.ResourceManager.DevSpaces + - sdk/storagepool/Azure.ResourceManager.StoragePool + - sdk/billing/Azure.ResourceManager.Billing + - sdk/monitor/Azure.ResourceManager.Monitor + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules + - sdk/datadog/Azure.ResourceManager.Datadog + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking - sdk/maintenance/Azure.ResourceManager.Maintenance + - sdk/avs/Azure.ResourceManager.Avs + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights + - sdk/privatedns/Azure.ResourceManager.PrivateDns + - sdk/websites/Azure.ResourceManager.AppService + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices + - sdk/mixedreality/Azure.ResourceManager.MixedReality - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork - - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric - - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities - - sdk/managedservices/Azure.ResourceManager.ManagedServices - - sdk/managementpartner/Azure.ResourceManager.ManagementPartner - - sdk/maps/Azure.ResourceManager.Maps - - sdk/marketplace/Azure.ResourceManager.Marketplace - - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering + - sdk/devcenter/Azure.ResourceManager.DevCenter - sdk/mediaservices/Azure.ResourceManager.Media - - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap - - sdk/mixedreality/Azure.ResourceManager.MixedReality - - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork - - sdk/mongocluster/Azure.ResourceManager.MongoCluster - - sdk/monitor/Azure.ResourceManager.Monitor - - sdk/mysql/Azure.ResourceManager.MySql - - sdk/netapp/Azure.ResourceManager.NetApp - - sdk/network/Azure.ResourceManager.Network - - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics - - sdk/networkcloud/Azure.ResourceManager.NetworkCloud - - sdk/networkfunction/Azure.ResourceManager.NetworkFunction + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph + - sdk/hdinsight/Azure.ResourceManager.HDInsight + - sdk/reservations/Azure.ResourceManager.Reservations + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis + - sdk/analysisservices/Azure.ResourceManager.Analysis - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure + - sdk/datamigration/Azure.ResourceManager.DataMigration + - sdk/network/Azure.ResourceManager.Network + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity + - sdk/subscription/Azure.ResourceManager.Subscription + - sdk/datafactory/Azure.ResourceManager.DataFactory + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry + - sdk/providerhub/Azure.ResourceManager.ProviderHub + - sdk/iotcentral/Azure.ResourceManager.IotCentral + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate - sdk/nginx/Azure.ResourceManager.Nginx - - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs - - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices - - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights - - sdk/oracle/Azure.ResourceManager.OracleDatabase - - sdk/orbital/Azure.ResourceManager.Orbital + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw - - sdk/peering/Azure.ResourceManager.Peering - - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting - - sdk/policyinsights/Azure.ResourceManager.PolicyInsights - - sdk/postgresql/Azure.ResourceManager.PostgreSql - - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated - - sdk/privatedns/Azure.ResourceManager.PrivateDns - - sdk/providerhub/Azure.ResourceManager.ProviderHub - - sdk/purview/Azure.ResourceManager.Purview - - sdk/quantum/Azure.ResourceManager.Quantum - - sdk/qumulo/Azure.ResourceManager.Qumulo - - sdk/quota/Azure.ResourceManager.Quota - - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices - - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup - - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication - - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery - - sdk/redis/Azure.ResourceManager.Redis - - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise - - sdk/relay/Azure.ResourceManager.Relay - - sdk/reservations/Azure.ResourceManager.Reservations - - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector - - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph - - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth - - sdk/resourcemover/Azure.ResourceManager.ResourceMover - - sdk/resources/Azure.ResourceManager.Resources - - sdk/search/Azure.ResourceManager.Search - - sdk/securitycenter/Azure.ResourceManager.SecurityCenter - - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps - - sdk/securityinsights/Azure.ResourceManager.SecurityInsights - - sdk/selfhelp/Azure.ResourceManager.SelfHelp - sdk/servicebus/Azure.ResourceManager.ServiceBus - - sdk/servicefabric/Azure.ResourceManager.ServiceFabric - - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters - - sdk/servicelinker/Azure.ResourceManager.ServiceLinker - - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking - - sdk/signalr/Azure.ResourceManager.SignalR - - sdk/sphere/Azure.ResourceManager.Sphere - - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery - - sdk/sqlmanagement/Azure.ResourceManager.Sql - - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine - - sdk/standbypool/Azure.ResourceManager.StandbyPool - - sdk/storage/Azure.ResourceManager.Storage + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup + - sdk/resourcemover/Azure.ResourceManager.ResourceMover - sdk/storageactions/Azure.ResourceManager.StorageActions + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork + - sdk/confluent/Azure.ResourceManager.Confluent + - sdk/consumption/Azure.ResourceManager.Consumption + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices + - sdk/redis/Azure.ResourceManager.Redis - sdk/storagecache/Azure.ResourceManager.StorageCache - - sdk/storagemover/Azure.ResourceManager.StorageMover - - sdk/storagepool/Azure.ResourceManager.StoragePool - - sdk/storagesync/Azure.ResourceManager.StorageSync - - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics - - sdk/subscription/Azure.ResourceManager.Subscription - - sdk/support/Azure.ResourceManager.Support - - sdk/synapse/Azure.ResourceManager.Synapse - - sdk/terraform/Azure.ResourceManager.Terraform - - sdk/trafficmanager/Azure.ResourceManager.TrafficManager - - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning - - sdk/voiceservices/Azure.ResourceManager.VoiceServices - - sdk/webpubsub/Azure.ResourceManager.WebPubSub - - sdk/websites/Azure.ResourceManager.AppService - - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor - - sdk/workloads/Azure.ResourceManager.Workloads + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet + - sdk/apicenter/Azure.ResourceManager.ApiCenter + - sdk/quantum/Azure.ResourceManager.Quantum + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance + - sdk/purview/Azure.ResourceManager.Purview + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense + - sdk/eventgrid/Azure.ResourceManager.EventGrid + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation + - sdk/elastic/Azure.ResourceManager.Elastic + - sdk/oracle/Azure.ResourceManager.OracleDatabase + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins + - sdk/healthbot/Azure.ResourceManager.HealthBot + - sdk/azurestackhci/Azure.ResourceManager.Hci pr: branches: @@ -215,197 +215,197 @@ pr: - sdk/resourcemanager - common/ManagementTestShared - common/ManagementCoreShared - - sdk/advisor/Azure.ResourceManager.Advisor - - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform - - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement - - sdk/analysisservices/Azure.ResourceManager.Analysis - - sdk/apicenter/Azure.ResourceManager.ApiCenter - - sdk/apimanagement/Azure.ResourceManager.ApiManagement - - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration + - sdk/peering/Azure.ResourceManager.Peering + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge + - sdk/search/Azure.ResourceManager.Search + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication + - sdk/quota/Azure.ResourceManager.Quota + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration - - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights - - sdk/appplatform/Azure.ResourceManager.AppPlatform + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices + - sdk/signalr/Azure.ResourceManager.SignalR + - sdk/chaos/Azure.ResourceManager.Chaos + - sdk/communication/Azure.ResourceManager.Communication + - sdk/containerapps/Azure.ResourceManager.AppContainers + - sdk/cdn/Azure.ResourceManager.Cdn + - sdk/blueprint/Azure.ResourceManager.Blueprint + - sdk/sqlmanagement/Azure.ResourceManager.Sql + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService + - sdk/storagesync/Azure.ResourceManager.StorageSync + - sdk/frontdoor/Azure.ResourceManager.FrontDoor + - sdk/storage/Azure.ResourceManager.Storage + - sdk/labservices/Azure.ResourceManager.LabServices + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning + - sdk/sphere/Azure.ResourceManager.Sphere + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps - sdk/arc-scvmm/Azure.ResourceManager.ScVmm + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights + - sdk/advisor/Azure.ResourceManager.Advisor + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices + - sdk/relay/Azure.ResourceManager.Relay + - sdk/appplatform/Azure.ResourceManager.AppPlatform + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap + - sdk/resources/Azure.ResourceManager.Resources + - sdk/costmanagement/Azure.ResourceManager.CostManagement - sdk/astronomer/Azure.ResourceManager.Astro - - sdk/attestation/Azure.ResourceManager.Attestation + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated + - sdk/storagemover/Azure.ResourceManager.StorageMover + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager + - sdk/netapp/Azure.ResourceManager.NetApp + - sdk/dynatrace/Azure.ResourceManager.Dynatrace + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime - sdk/authorization/Azure.ResourceManager.Authorization - - sdk/automanage/Azure.ResourceManager.Automanage + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner + - sdk/qumulo/Azure.ResourceManager.Qumulo + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger + - sdk/managedservices/Azure.ResourceManager.ManagedServices - sdk/automation/Azure.ResourceManager.Automation - - sdk/avs/Azure.ResourceManager.Avs - - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance - - sdk/azurestackhci/Azure.ResourceManager.Hci - - sdk/batch/Azure.ResourceManager.Batch - - sdk/billing/Azure.ResourceManager.Billing + - sdk/mongocluster/Azure.ResourceManager.MongoCluster + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits - - sdk/blueprint/Azure.ResourceManager.Blueprint - - sdk/botservice/Azure.ResourceManager.BotService - - sdk/cdn/Azure.ResourceManager.Cdn - - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis - - sdk/chaos/Azure.ResourceManager.Chaos - - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices - - sdk/communication/Azure.ResourceManager.Communication - - sdk/compute/Azure.ResourceManager.Compute - - sdk/computefleet/Azure.ResourceManager.ComputeFleet + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule - - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger - - sdk/confluent/Azure.ResourceManager.Confluent - - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere - - sdk/consumption/Azure.ResourceManager.Consumption - - sdk/containerapps/Azure.ResourceManager.AppContainers - - sdk/containerinstance/Azure.ResourceManager.ContainerInstance - - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime - - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry - - sdk/containerservice/Azure.ResourceManager.ContainerService + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute - sdk/cosmosdb/Azure.ResourceManager.CosmosDB + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction + - sdk/computefleet/Azure.ResourceManager.ComputeFleet + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations + - sdk/attestation/Azure.ResourceManager.Attestation + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere + - sdk/eventhub/Azure.ResourceManager.EventHubs + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics + - sdk/synapse/Azure.ResourceManager.Synapse + - sdk/automanage/Azure.ResourceManager.Automanage + - sdk/voiceservices/Azure.ResourceManager.VoiceServices + - sdk/postgresql/Azure.ResourceManager.PostgreSql + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql - - sdk/costmanagement/Azure.ResourceManager.CostManagement - - sdk/customer-insights/Azure.ResourceManager.CustomerInsights - - sdk/databox/Azure.ResourceManager.DataBox - - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge - - sdk/datadog/Azure.ResourceManager.Datadog - - sdk/datafactory/Azure.ResourceManager.DataFactory - - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics - - sdk/datalake-store/Azure.ResourceManager.DataLakeStore - - sdk/datamigration/Azure.ResourceManager.DataMigration - - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup - - sdk/datashare/Azure.ResourceManager.DataShare - - sdk/defendereasm/Azure.ResourceManager.DefenderEasm - - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization - - sdk/devcenter/Azure.ResourceManager.DevCenter - - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices - - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry - - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate - - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure - - sdk/devspaces/Azure.ResourceManager.DevSpaces - - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs - - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins - - sdk/dns/Azure.ResourceManager.Dns + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting + - sdk/grafana/Azure.ResourceManager.Grafana + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric - sdk/dnsresolver/Azure.ResourceManager.DnsResolver - - sdk/dynatrace/Azure.ResourceManager.Dynatrace - - sdk/edgeorder/Azure.ResourceManager.EdgeOrder + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric + - sdk/iothub/Azure.ResourceManager.IotHub + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor + - sdk/webpubsub/Azure.ResourceManager.WebPubSub + - sdk/mysql/Azure.ResourceManager.MySql + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes + - sdk/apimanagement/Azure.ResourceManager.ApiManagement + - sdk/terraform/Azure.ResourceManager.Terraform + - sdk/kusto/Azure.ResourceManager.Kusto + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter + - sdk/support/Azure.ResourceManager.Support + - sdk/maps/Azure.ResourceManager.Maps + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis - sdk/edgezones/Azure.ResourceManager.EdgeZones - - sdk/elastic/Azure.ResourceManager.Elastic - - sdk/elasticsan/Azure.ResourceManager.ElasticSan - - sdk/eventgrid/Azure.ResourceManager.EventGrid - - sdk/eventhub/Azure.ResourceManager.EventHubs - - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations - - sdk/fabric/Azure.ResourceManager.Fabric - - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization + - sdk/selfhelp/Azure.ResourceManager.SelfHelp + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities + - sdk/orbital/Azure.ResourceManager.Orbital + - sdk/batch/Azure.ResourceManager.Batch - sdk/fluidrelay/Azure.ResourceManager.FluidRelay - - sdk/frontdoor/Azure.ResourceManager.FrontDoor - - sdk/grafana/Azure.ResourceManager.Grafana + - sdk/datashare/Azure.ResourceManager.DataShare + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery + - sdk/dns/Azure.ResourceManager.Dns + - sdk/compute/Azure.ResourceManager.Compute - sdk/graphservices/Azure.ResourceManager.GraphServices - - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration - - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules - - sdk/hdinsight/Azure.ResourceManager.HDInsight - - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers - - sdk/healthbot/Azure.ResourceManager.HealthBot - - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis - - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices - - sdk/hybridaks/Azure.ResourceManager.HybridContainerService - - sdk/hybridcompute/Azure.ResourceManager.HybridCompute - - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity - - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes - - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork - - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement - - sdk/iot/Azure.ResourceManager.IotFirmwareDefense - - sdk/iotcentral/Azure.ResourceManager.IotCentral - - sdk/iothub/Azure.ResourceManager.IotHub + - sdk/databox/Azure.ResourceManager.DataBox - sdk/keyvault/Azure.ResourceManager.KeyVault - - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration - - sdk/kusto/Azure.ResourceManager.Kusto - - sdk/labservices/Azure.ResourceManager.LabServices - - sdk/loadtestservice/Azure.ResourceManager.LoadTesting + - sdk/marketplace/Azure.ResourceManager.Marketplace + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise + - sdk/botservice/Azure.ResourceManager.BotService + - sdk/workloads/Azure.ResourceManager.Workloads + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting + - sdk/standbypool/Azure.ResourceManager.StandbyPool - sdk/logic/Azure.ResourceManager.Logic - - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute - - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning + - sdk/fabric/Azure.ResourceManager.Fabric + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector + - sdk/containerservice/Azure.ResourceManager.ContainerService + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement + - sdk/elasticsan/Azure.ResourceManager.ElasticSan + - sdk/devspaces/Azure.ResourceManager.DevSpaces + - sdk/storagepool/Azure.ResourceManager.StoragePool + - sdk/billing/Azure.ResourceManager.Billing + - sdk/monitor/Azure.ResourceManager.Monitor + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules + - sdk/datadog/Azure.ResourceManager.Datadog + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking - sdk/maintenance/Azure.ResourceManager.Maintenance + - sdk/avs/Azure.ResourceManager.Avs + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights + - sdk/privatedns/Azure.ResourceManager.PrivateDns + - sdk/websites/Azure.ResourceManager.AppService + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices + - sdk/mixedreality/Azure.ResourceManager.MixedReality - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork - - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric - - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities - - sdk/managedservices/Azure.ResourceManager.ManagedServices - - sdk/managementpartner/Azure.ResourceManager.ManagementPartner - - sdk/maps/Azure.ResourceManager.Maps - - sdk/marketplace/Azure.ResourceManager.Marketplace - - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering + - sdk/devcenter/Azure.ResourceManager.DevCenter - sdk/mediaservices/Azure.ResourceManager.Media - - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap - - sdk/mixedreality/Azure.ResourceManager.MixedReality - - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork - - sdk/mongocluster/Azure.ResourceManager.MongoCluster - - sdk/monitor/Azure.ResourceManager.Monitor - - sdk/mysql/Azure.ResourceManager.MySql - - sdk/netapp/Azure.ResourceManager.NetApp - - sdk/network/Azure.ResourceManager.Network - - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics - - sdk/networkcloud/Azure.ResourceManager.NetworkCloud - - sdk/networkfunction/Azure.ResourceManager.NetworkFunction + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph + - sdk/hdinsight/Azure.ResourceManager.HDInsight + - sdk/reservations/Azure.ResourceManager.Reservations + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis + - sdk/analysisservices/Azure.ResourceManager.Analysis - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure + - sdk/datamigration/Azure.ResourceManager.DataMigration + - sdk/network/Azure.ResourceManager.Network + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity + - sdk/subscription/Azure.ResourceManager.Subscription + - sdk/datafactory/Azure.ResourceManager.DataFactory + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry + - sdk/providerhub/Azure.ResourceManager.ProviderHub + - sdk/iotcentral/Azure.ResourceManager.IotCentral + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate - sdk/nginx/Azure.ResourceManager.Nginx - - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs - - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices - - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights - - sdk/oracle/Azure.ResourceManager.OracleDatabase - - sdk/orbital/Azure.ResourceManager.Orbital + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw - - sdk/peering/Azure.ResourceManager.Peering - - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting - - sdk/policyinsights/Azure.ResourceManager.PolicyInsights - - sdk/postgresql/Azure.ResourceManager.PostgreSql - - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated - - sdk/privatedns/Azure.ResourceManager.PrivateDns - - sdk/providerhub/Azure.ResourceManager.ProviderHub - - sdk/purview/Azure.ResourceManager.Purview - - sdk/quantum/Azure.ResourceManager.Quantum - - sdk/qumulo/Azure.ResourceManager.Qumulo - - sdk/quota/Azure.ResourceManager.Quota - - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices - - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup - - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication - - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery - - sdk/redis/Azure.ResourceManager.Redis - - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise - - sdk/relay/Azure.ResourceManager.Relay - - sdk/reservations/Azure.ResourceManager.Reservations - - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector - - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph - - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth - - sdk/resourcemover/Azure.ResourceManager.ResourceMover - - sdk/resources/Azure.ResourceManager.Resources - - sdk/search/Azure.ResourceManager.Search - - sdk/securitycenter/Azure.ResourceManager.SecurityCenter - - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps - - sdk/securityinsights/Azure.ResourceManager.SecurityInsights - - sdk/selfhelp/Azure.ResourceManager.SelfHelp - sdk/servicebus/Azure.ResourceManager.ServiceBus - - sdk/servicefabric/Azure.ResourceManager.ServiceFabric - - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters - - sdk/servicelinker/Azure.ResourceManager.ServiceLinker - - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking - - sdk/signalr/Azure.ResourceManager.SignalR - - sdk/sphere/Azure.ResourceManager.Sphere - - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery - - sdk/sqlmanagement/Azure.ResourceManager.Sql - - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine - - sdk/standbypool/Azure.ResourceManager.StandbyPool - - sdk/storage/Azure.ResourceManager.Storage + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup + - sdk/resourcemover/Azure.ResourceManager.ResourceMover - sdk/storageactions/Azure.ResourceManager.StorageActions + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork + - sdk/confluent/Azure.ResourceManager.Confluent + - sdk/consumption/Azure.ResourceManager.Consumption + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices + - sdk/redis/Azure.ResourceManager.Redis - sdk/storagecache/Azure.ResourceManager.StorageCache - - sdk/storagemover/Azure.ResourceManager.StorageMover - - sdk/storagepool/Azure.ResourceManager.StoragePool - - sdk/storagesync/Azure.ResourceManager.StorageSync - - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics - - sdk/subscription/Azure.ResourceManager.Subscription - - sdk/support/Azure.ResourceManager.Support - - sdk/synapse/Azure.ResourceManager.Synapse - - sdk/terraform/Azure.ResourceManager.Terraform - - sdk/trafficmanager/Azure.ResourceManager.TrafficManager - - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning - - sdk/voiceservices/Azure.ResourceManager.VoiceServices - - sdk/webpubsub/Azure.ResourceManager.WebPubSub - - sdk/websites/Azure.ResourceManager.AppService - - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor - - sdk/workloads/Azure.ResourceManager.Workloads + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet + - sdk/apicenter/Azure.ResourceManager.ApiCenter + - sdk/quantum/Azure.ResourceManager.Quantum + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance + - sdk/purview/Azure.ResourceManager.Purview + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense + - sdk/eventgrid/Azure.ResourceManager.EventGrid + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation + - sdk/elastic/Azure.ResourceManager.Elastic + - sdk/oracle/Azure.ResourceManager.OracleDatabase + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins + - sdk/healthbot/Azure.ResourceManager.HealthBot + - sdk/azurestackhci/Azure.ResourceManager.Hci extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml diff --git a/sdk/resourcemover/ci.mgmt.yml b/sdk/resourcemover/ci.mgmt.yml index 519b8a431926..bbb814c6a4f0 100644 --- a/sdk/resourcemover/ci.mgmt.yml +++ b/sdk/resourcemover/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/resourcemover/ci.mgmt.yml - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ci.mgmt.yml + - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resources/ci.mgmt.yml b/sdk/resources/ci.mgmt.yml index 3fefd5254c85..ff65cb96d07d 100644 --- a/sdk/resources/ci.mgmt.yml +++ b/sdk/resources/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/resources/ci.mgmt.yml - sdk/resources/Azure.ResourceManager.Resources/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.mgmt.yml + - sdk/resources/Azure.ResourceManager.Resources/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/search/ci.mgmt.yml b/sdk/search/ci.mgmt.yml index a8c2a632c1c8..63c0e200644f 100644 --- a/sdk/search/ci.mgmt.yml +++ b/sdk/search/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/search/ci.mgmt.yml - sdk/search/Azure.ResourceManager.Search/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/search/ci.mgmt.yml + - sdk/search/Azure.ResourceManager.Search/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/securitycenter/ci.mgmt.yml b/sdk/securitycenter/ci.mgmt.yml index c728522efab2..6ed8ff4d67a9 100644 --- a/sdk/securitycenter/ci.mgmt.yml +++ b/sdk/securitycenter/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/securitycenter/ci.mgmt.yml - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitycenter/ci.mgmt.yml + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/securitydevops/ci.mgmt.yml b/sdk/securitydevops/ci.mgmt.yml index c5a54a9ad206..972d98a7376e 100644 --- a/sdk/securitydevops/ci.mgmt.yml +++ b/sdk/securitydevops/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/securitydevops/ci.mgmt.yml - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitydevops/ci.mgmt.yml + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/securityinsights/ci.mgmt.yml b/sdk/securityinsights/ci.mgmt.yml index f1d428ebef90..0659cac2858f 100644 --- a/sdk/securityinsights/ci.mgmt.yml +++ b/sdk/securityinsights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/securityinsights/ci.mgmt.yml - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.mgmt.yml + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/selfhelp/ci.mgmt.yml b/sdk/selfhelp/ci.mgmt.yml index bb6a162210eb..ac13ec845ce7 100644 --- a/sdk/selfhelp/ci.mgmt.yml +++ b/sdk/selfhelp/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/selfhelp/ci.mgmt.yml - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/selfhelp/ci.mgmt.yml + - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicebus/ci.mgmt.yml b/sdk/servicebus/ci.mgmt.yml index 02c45dc88e18..f2ead205ced6 100644 --- a/sdk/servicebus/ci.mgmt.yml +++ b/sdk/servicebus/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/servicebus/ci.mgmt.yml - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicebus/ci.mgmt.yml + - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicefabric/ci.mgmt.yml b/sdk/servicefabric/ci.mgmt.yml index 430f48c8c87b..afc886a4f7f2 100644 --- a/sdk/servicefabric/ci.mgmt.yml +++ b/sdk/servicefabric/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/servicefabric/ci.mgmt.yml - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ci.mgmt.yml + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicefabricmanagedclusters/ci.mgmt.yml b/sdk/servicefabricmanagedclusters/ci.mgmt.yml index e73289f589f4..022ac0f03cd1 100644 --- a/sdk/servicefabricmanagedclusters/ci.mgmt.yml +++ b/sdk/servicefabricmanagedclusters/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/servicefabricmanagedclusters/ci.mgmt.yml - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmanagedclusters/ci.mgmt.yml + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicelinker/ci.mgmt.yml b/sdk/servicelinker/ci.mgmt.yml index 77df314e977a..6069e04a3157 100644 --- a/sdk/servicelinker/ci.mgmt.yml +++ b/sdk/servicelinker/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/servicelinker/ci.mgmt.yml - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicelinker/ci.mgmt.yml + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicenetworking/ci.mgmt.yml b/sdk/servicenetworking/ci.mgmt.yml index b2332ae15224..4551f1325475 100644 --- a/sdk/servicenetworking/ci.mgmt.yml +++ b/sdk/servicenetworking/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/servicenetworking/ci.mgmt.yml - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicenetworking/ci.mgmt.yml + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/signalr/ci.mgmt.yml b/sdk/signalr/ci.mgmt.yml index c934ed4314fa..f066849c56a1 100644 --- a/sdk/signalr/ci.mgmt.yml +++ b/sdk/signalr/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/signalr/ci.mgmt.yml - sdk/signalr/Azure.ResourceManager.SignalR/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ci.mgmt.yml + - sdk/signalr/Azure.ResourceManager.SignalR/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/sphere/ci.mgmt.yml b/sdk/sphere/ci.mgmt.yml index f3f33e9d00f4..749774244735 100644 --- a/sdk/sphere/ci.mgmt.yml +++ b/sdk/sphere/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/sphere/ci.mgmt.yml - sdk/sphere/Azure.ResourceManager.Sphere/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sphere/ci.mgmt.yml + - sdk/sphere/Azure.ResourceManager.Sphere/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/springappdiscovery/ci.mgmt.yml b/sdk/springappdiscovery/ci.mgmt.yml index 7676386684df..f86c14368089 100644 --- a/sdk/springappdiscovery/ci.mgmt.yml +++ b/sdk/springappdiscovery/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/springappdiscovery/ci.mgmt.yml - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/springappdiscovery/ci.mgmt.yml + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/sqlmanagement/ci.mgmt.yml b/sdk/sqlmanagement/ci.mgmt.yml index da93d03f2d33..8377a2663681 100644 --- a/sdk/sqlmanagement/ci.mgmt.yml +++ b/sdk/sqlmanagement/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/sqlmanagement/ci.mgmt.yml - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlmanagement/ci.mgmt.yml + - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/sqlvirtualmachine/ci.mgmt.yml b/sdk/sqlvirtualmachine/ci.mgmt.yml index 28c6192fa86b..049e315855ed 100644 --- a/sdk/sqlvirtualmachine/ci.mgmt.yml +++ b/sdk/sqlvirtualmachine/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/sqlvirtualmachine/ci.mgmt.yml - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlvirtualmachine/ci.mgmt.yml + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/standbypool/ci.mgmt.yml b/sdk/standbypool/ci.mgmt.yml index 0763a516e2c1..54ce1137a123 100644 --- a/sdk/standbypool/ci.mgmt.yml +++ b/sdk/standbypool/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/standbypool/ci.mgmt.yml - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/standbypool/ci.mgmt.yml + - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storage/ci.mgmt.yml b/sdk/storage/ci.mgmt.yml index 95bc19b325d5..6f05608983be 100644 --- a/sdk/storage/ci.mgmt.yml +++ b/sdk/storage/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/storage/ci.mgmt.yml - sdk/storage/Azure.ResourceManager.Storage/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storage/ci.mgmt.yml + - sdk/storage/Azure.ResourceManager.Storage/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storageactions/ci.mgmt.yml b/sdk/storageactions/ci.mgmt.yml index 27062b4565a8..b27838343a2e 100644 --- a/sdk/storageactions/ci.mgmt.yml +++ b/sdk/storageactions/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/storageactions/ci.mgmt.yml - sdk/storageactions/Azure.ResourceManager.StorageActions/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.mgmt.yml + - sdk/storageactions/Azure.ResourceManager.StorageActions/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storagecache/ci.mgmt.yml b/sdk/storagecache/ci.mgmt.yml index c6abf63baf2c..84c922940939 100644 --- a/sdk/storagecache/ci.mgmt.yml +++ b/sdk/storagecache/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/storagecache/ci.mgmt.yml - sdk/storagecache/Azure.ResourceManager.StorageCache/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagecache/ci.mgmt.yml + - sdk/storagecache/Azure.ResourceManager.StorageCache/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storagemover/ci.mgmt.yml b/sdk/storagemover/ci.mgmt.yml index e9055f49e1a9..4e45261a60aa 100644 --- a/sdk/storagemover/ci.mgmt.yml +++ b/sdk/storagemover/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/storagemover/ci.mgmt.yml - sdk/storagemover/Azure.ResourceManager.StorageMover/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagemover/ci.mgmt.yml + - sdk/storagemover/Azure.ResourceManager.StorageMover/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storagepool/ci.mgmt.yml b/sdk/storagepool/ci.mgmt.yml index 2178fc390757..6592a12a262a 100644 --- a/sdk/storagepool/ci.mgmt.yml +++ b/sdk/storagepool/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/storagepool/ci.mgmt.yml - sdk/storagepool/Azure.ResourceManager.StoragePool/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ci.mgmt.yml + - sdk/storagepool/Azure.ResourceManager.StoragePool/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storagesync/ci.mgmt.yml b/sdk/storagesync/ci.mgmt.yml index a8789947c687..b9fcbb66b30f 100644 --- a/sdk/storagesync/ci.mgmt.yml +++ b/sdk/storagesync/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/storagesync/ci.mgmt.yml - sdk/storagesync/Azure.ResourceManager.StorageSync/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.mgmt.yml + - sdk/storagesync/Azure.ResourceManager.StorageSync/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/streamanalytics/ci.mgmt.yml b/sdk/streamanalytics/ci.mgmt.yml index 09d108a1a7d9..860cd851bbd1 100644 --- a/sdk/streamanalytics/ci.mgmt.yml +++ b/sdk/streamanalytics/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/streamanalytics/ci.mgmt.yml - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/streamanalytics/ci.mgmt.yml + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/subscription/ci.mgmt.yml b/sdk/subscription/ci.mgmt.yml index f9067b4c0af3..a00a0e9c56ad 100644 --- a/sdk/subscription/ci.mgmt.yml +++ b/sdk/subscription/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/subscription/ci.mgmt.yml - sdk/subscription/Azure.ResourceManager.Subscription/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/subscription/ci.mgmt.yml + - sdk/subscription/Azure.ResourceManager.Subscription/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/support/ci.mgmt.yml b/sdk/support/ci.mgmt.yml index 5a947c4c4939..d5c857ad8346 100644 --- a/sdk/support/ci.mgmt.yml +++ b/sdk/support/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/support/ci.mgmt.yml - sdk/support/Azure.ResourceManager.Support/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/support/ci.mgmt.yml + - sdk/support/Azure.ResourceManager.Support/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/synapse/ci.mgmt.yml b/sdk/synapse/ci.mgmt.yml index 0a089a504291..18c8132c4803 100644 --- a/sdk/synapse/ci.mgmt.yml +++ b/sdk/synapse/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/synapse/ci.mgmt.yml - sdk/synapse/Azure.ResourceManager.Synapse/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/synapse/ci.mgmt.yml + - sdk/synapse/Azure.ResourceManager.Synapse/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/terraform/ci.mgmt.yml b/sdk/terraform/ci.mgmt.yml index 82c4c1f05a4c..5f7b3d41fb27 100644 --- a/sdk/terraform/ci.mgmt.yml +++ b/sdk/terraform/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/terraform/ci.mgmt.yml - sdk/terraform/Azure.ResourceManager.Terraform/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/terraform/ci.mgmt.yml + - sdk/terraform/Azure.ResourceManager.Terraform/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/trafficmanager/ci.mgmt.yml b/sdk/trafficmanager/ci.mgmt.yml index 528f78b70b96..86b17c08ac4e 100644 --- a/sdk/trafficmanager/ci.mgmt.yml +++ b/sdk/trafficmanager/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/trafficmanager/ci.mgmt.yml - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trafficmanager/ci.mgmt.yml + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/trustedsigning/ci.mgmt.yml b/sdk/trustedsigning/ci.mgmt.yml index 5b67358a4477..07fb171ee416 100644 --- a/sdk/trustedsigning/ci.mgmt.yml +++ b/sdk/trustedsigning/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/trustedsigning/ci.mgmt.yml - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trustedsigning/ci.mgmt.yml + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/voiceservices/ci.mgmt.yml b/sdk/voiceservices/ci.mgmt.yml index a914d1640296..64ea2eb63c0f 100644 --- a/sdk/voiceservices/ci.mgmt.yml +++ b/sdk/voiceservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/voiceservices/ci.mgmt.yml - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/voiceservices/ci.mgmt.yml + - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/webpubsub/ci.mgmt.yml b/sdk/webpubsub/ci.mgmt.yml index 6bcb8439a2b0..a312a96feb5a 100644 --- a/sdk/webpubsub/ci.mgmt.yml +++ b/sdk/webpubsub/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,18 @@ pr: - sdk/webpubsub/ci.mgmt.yml - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/webpubsub/ci.mgmt.yml + - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/websites/ci.mgmt.yml b/sdk/websites/ci.mgmt.yml index d67c580bc414..4dbf184acc87 100644 --- a/sdk/websites/ci.mgmt.yml +++ b/sdk/websites/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/websites/ci.mgmt.yml - sdk/websites/Azure.ResourceManager.AppService/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/websites/ci.mgmt.yml + - sdk/websites/Azure.ResourceManager.AppService/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/workloadmonitor/ci.mgmt.yml b/sdk/workloadmonitor/ci.mgmt.yml index 7c6a51fbe75c..e834be340ea9 100644 --- a/sdk/workloadmonitor/ci.mgmt.yml +++ b/sdk/workloadmonitor/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/workloadmonitor/ci.mgmt.yml - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadmonitor/ci.mgmt.yml + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/workloads/ci.mgmt.yml b/sdk/workloads/ci.mgmt.yml index e3457d69ceaa..bf3983053473 100644 --- a/sdk/workloads/ci.mgmt.yml +++ b/sdk/workloads/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/workloads/ci.mgmt.yml - sdk/workloads/Azure.ResourceManager.Workloads/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloads/ci.mgmt.yml + - sdk/workloads/Azure.ResourceManager.Workloads/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: